mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This was part of the original weak design that there was never any particular reason to rush the implementation for. It's convenient to do this now so that we can use it to implement Unmanaged<T> for importing CF types. Swift SVN r16693
42 lines
1.1 KiB
C++
42 lines
1.1 KiB
C++
//===--- Ownership.h - Swift ASTs for Reference Ownership -------*- C++ -*-===//
|
|
//
|
|
// This source file is part of the Swift.org open source project
|
|
//
|
|
// Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
|
|
// Licensed under Apache License v2.0 with Runtime Library Exception
|
|
//
|
|
// See http://swift.org/LICENSE.txt for license information
|
|
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This file defines common structures for working with the different
|
|
// kinds of reference ownership supported by Swift, such as [weak] and
|
|
// [unowned].
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef SWIFT_OWNERSHIP_H
|
|
#define SWIFT_OWNERSHIP_H
|
|
|
|
namespace swift {
|
|
|
|
/// Different kinds of reference ownership supported by Swift.
|
|
enum class Ownership {
|
|
/// \brief a strong reference (the default semantics)
|
|
Strong,
|
|
|
|
/// \brief a @weak reference
|
|
Weak,
|
|
|
|
/// \brief an @unowned reference
|
|
Unowned,
|
|
|
|
/// \brief an @unowned(unsafe) reference
|
|
Unmanaged,
|
|
};
|
|
|
|
} // end namespace swift
|
|
|
|
#endif
|