diff options
Diffstat (limited to 'platform/darwin/src/MGLSource_Private.h')
-rw-r--r-- | platform/darwin/src/MGLSource_Private.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/platform/darwin/src/MGLSource_Private.h b/platform/darwin/src/MGLSource_Private.h index acb325e2f3..2fc170b86b 100644 --- a/platform/darwin/src/MGLSource_Private.h +++ b/platform/darwin/src/MGLSource_Private.h @@ -1,5 +1,7 @@ #import "MGLSource.h" +#include <memory> + NS_ASSUME_NONNULL_BEGIN namespace mbgl { @@ -13,18 +15,25 @@ namespace mbgl { @interface MGLSource (Private) /** - Initializes and returns a source with a raw pointer to the backing store. + Initializes and returns a source with a raw pointer to the backing store, + associated with a style. */ - (instancetype)initWithRawSource:(mbgl::style::Source *)rawSource; /** + Initializes and returns a source with an owning pointer to the backing store, + unassociated from a style. + */ +- (instancetype)initWithPendingSource:(std::unique_ptr<mbgl::style::Source>)pendingSource; + +/** A raw pointer to the mbgl object, which is always initialized, either to the value returned by `mbgl::Map getSource`, or for independently created objects, to the pointer value held in `pendingSource`. In the latter case, this raw pointer value stays even after ownership of the object is transferred via `mbgl::Map addSource`. */ -@property (nonatomic) mbgl::style::Source *rawSource; +@property (nonatomic, readonly) mbgl::style::Source *rawSource; /** Adds the mbgl source that this object represents to the mbgl map. |