glibmm: Gio::Mount Class Reference
The Mount interface represents user-visible mounts. More...
#include <giomm/mount.h>
Public Types | |
Public Types inherited from sigc::trackable | |
typedef internal::func_destroy_notify | func_destroy_notify |
Public Types inherited from sigc::notifiable | |
typedef internal::func_destroy_notify | func_destroy_notify |
Public Member Functions | |
Mount (Mount&& src) noexcept | |
Mount& | operator= (Mount&& src) noexcept |
~Mount () noexcept override | |
GMount* | gobj () |
Provides access to the underlying C GObject. More... | |
const GMount* | gobj () const |
Provides access to the underlying C GObject. More... | |
Glib::RefPtr< File > | get_root () |
Gets the root directory on mount. More... | |
Glib::RefPtr< const File > | get_root () const |
Gets the root directory on mount. More... | |
std::string | get_name () const |
Gets the name of mount. More... | |
Glib::RefPtr< Icon > | get_icon () |
Gets the icon for mount. More... | |
Glib::RefPtr< const Icon > | get_icon () const |
Gets the icon for mount. More... | |
Glib::RefPtr< Icon > | get_symbolic_icon () |
Gets the symbolic icon for mount. More... | |
Glib::RefPtr< const Icon > | get_symbolic_icon () const |
Gets the symbolic icon for mount. More... | |
std::string | get_uuid () const |
Gets the UUID for the mount. More... | |
Glib::RefPtr< Volume > | get_volume () |
Gets the volume for the mount. More... | |
Glib::RefPtr< const Volume > | get_volume () const |
Gets the volume for the mount. More... | |
Glib::RefPtr< Drive > | get_drive () |
Gets the drive for the mount. More... | |
Glib::RefPtr< const Drive > | get_drive () const |
Gets the drive for the mount. More... | |
bool | can_unmount () const |
Checks if mount can be unmounted. More... | |
bool | can_eject () const |
Checks if mount can be ejected. More... | |
void | unmount (const SlotAsyncReady& slot, const Glib::RefPtr< Cancellable >& cancellable, UnmountFlags flags=UnmountFlags::NONE) |
void | unmount (const SlotAsyncReady& slot, UnmountFlags flags=UnmountFlags::NONE) |
void | unmount (UnmountFlags flags=UnmountFlags::NONE) |
void | unmount (const Glib::RefPtr< MountOperation >& mount_operation, UnmountFlags flags=UnmountFlags::NONE) |
void | unmount (const Glib::RefPtr< MountOperation >& mount_operation, const SlotAsyncReady& slot, UnmountFlags flags=UnmountFlags::NONE) |
void | unmount (const Glib::RefPtr< MountOperation >& mount_operation, const SlotAsyncReady& slot, const Glib::RefPtr< Cancellable >& cancellable, UnmountFlags flags=UnmountFlags::NONE) |
bool | unmount_finish (const Glib::RefPtr< AsyncResult >& result) |
Finishes unmounting a mount. More... | |
void | remount (const Glib::RefPtr< MountOperation >& operation, const SlotAsyncReady& slot, const Glib::RefPtr< Cancellable >& cancellable, MountFlags flags=MountFlags::NONE) |
Remounts a mount. More... | |
void | remount (const Glib::RefPtr< MountOperation >& operation, const SlotAsyncReady& slot, MountFlags flags=MountFlags::NONE) |
Remounts a mount. More... | |
void | remount (const Glib::RefPtr< MountOperation >& operation, MountFlags flags=MountFlags::NONE) |
Remounts a mount. More... | |
void | remount (MountFlags flags=MountFlags::NONE) |
Remounts a mount, without user interaction. More... | |
bool | remount_finish (const Glib::RefPtr< AsyncResult >& result) |
Finishes remounting a mount. More... | |
void | eject (const SlotAsyncReady& slot, const Glib::RefPtr< Cancellable >& cancellable, UnmountFlags flags=UnmountFlags::NONE) |
void | eject (const SlotAsyncReady& slot, UnmountFlags flags=UnmountFlags::NONE) |
void | eject (UnmountFlags flags=UnmountFlags::NONE) |
void | eject (const Glib::RefPtr< MountOperation >& mount_operation, const SlotAsyncReady& slot, const Glib::RefPtr< Cancellable >& cancellable, UnmountFlags flags=UnmountFlags::NONE) |
void | eject (const Glib::RefPtr< MountOperation >& mount_operation, const SlotAsyncReady& slot, UnmountFlags flags=UnmountFlags::NONE) |
void | eject (const Glib::RefPtr< MountOperation >& mount_operation, UnmountFlags flags=UnmountFlags::NONE) |
bool | eject_finish (const Glib::RefPtr< AsyncResult >& result) |
Finishes ejecting a mount. More... | |
void | guess_content_type (const SlotAsyncReady& slot, const Glib::RefPtr< Cancellable >& cancellable, bool force_rescan=true) |
Tries to guess the type of content stored on the mount. More... | |
void | guess_content_type (const SlotAsyncReady& slot, bool force_rescan=true) |
Tries to guess the type of content stored on the mount. More... | |
void | guess_content_type (bool force_rescan=true) |
Tries to guess the type of content stored on the mount. More... | |
void | guess_content_type_sync (const Glib::RefPtr< Cancellable >& cancellable, bool force_rescan=true) |
void | guess_content_type_sync (bool force_rescan=true) |
std::vector< Glib::ustring > | guess_content_type_finish (const Glib::RefPtr< AsyncResult >& result) |
Finishes guessing content types of the Mount. More... | |
bool | is_shadowed () const |
Determines if mount is shadowed. More... | |
void | shadow () |
Increments the shadow count on mount. More... | |
void | unshadow () |
Decrements the shadow count on mount. More... | |
Glib::RefPtr< File > | get_default_location () const |
Gets the default location of mount. More... | |
Glib::ustring | get_sort_key () const |
Gets the sort key for mount, if any. More... | |
Glib::SignalProxy< void()> | signal_changed () |
Glib::SignalProxy< void()> | signal_unmounted () |
Glib::SignalProxy< void()> | signal_pre_unmount () |
Public Member Functions inherited from Glib::Interface | |
Interface () | |
A Default constructor. More... | |
Interface (Interface&& src) noexcept | |
Interface& | operator= (Interface&& src) noexcept |
Interface (const Glib::Interface_Class& interface_class) | |
Called by constructors of derived classes. More... | |
Interface (GObject* castitem) | |
Called by constructors of derived classes. More... | |
~Interface () noexcept override | |
Interface (const Interface&)=delete | |
Interface& | operator= (const Interface&)=delete |
GObject* | gobj () |
const GObject* | gobj () const |
Public Member Functions inherited from Glib::ObjectBase | |
ObjectBase (const ObjectBase&)=delete | |
ObjectBase& | operator= (const ObjectBase&)=delete |
void | set_property_value (const Glib::ustring& property_name, const Glib::ValueBase& value) |
You probably want to use a specific property_*() accessor method instead. More... | |
void | get_property_value (const Glib::ustring& property_name, Glib::ValueBase& value) const |
You probably want to use a specific property_*() accessor method instead. More... | |
template<class PropertyType > | |
void | set_property (const Glib::ustring& property_name, const PropertyType& value) |
You probably want to use a specific property_*() accessor method instead. More... | |
template<class PropertyType > | |
void | get_property (const Glib::ustring& property_name, PropertyType& value) const |
You probably want to use a specific property_*() accessor method instead. More... | |
template<class PropertyType > | |
PropertyType | get_property (const Glib::ustring& property_name) const |
You probably want to use a specific property_*() accessor method instead. More... | |
sigc::connection | connect_property_changed (const Glib::ustring& property_name, const sigc::slot< void()>& slot) |
You can use the signal_changed() signal of the property proxy instead. More... | |
sigc::connection | connect_property_changed (const Glib::ustring& property_name, sigc::slot< void()>&& slot) |
You can use the signal_changed() signal of the property proxy instead. More... | |
void | freeze_notify () |
Increases the freeze count on object. More... | |
void | thaw_notify () |
Reverts the effect of a previous call to freeze_notify(). More... | |
virtual void | reference () const |
Increment the reference count for this object. More... | |
virtual void | unreference () const |
Decrement the reference count for this object. More... | |
GObject* | gobj () |
Provides access to the underlying C GObject. More... | |
const GObject* | gobj () const |
Provides access to the underlying C GObject. More... | |
GObject* | gobj_copy () const |
Give a ref-ed copy to someone. Use for direct struct access. More... | |
Public Member Functions inherited from sigc::trackable | |
trackable () noexcept | |
trackable (const trackable &src) noexcept | |
trackable (trackable &&src) noexcept | |
~trackable () | |
void | add_destroy_notify_callback (notifiable *data, func_destroy_notify func) const |
void | notify_callbacks () |
trackable & | operator= (const trackable &src) |
trackable & | operator= (trackable &&src) noexcept |
void | remove_destroy_notify_callback (notifiable *data) const |
Static Public Member Functions | |
static void | add_interface (GType gtype_implementer) |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. More... | |
Protected Member Functions | |
Mount () | |
You should derive from this class to use it. More... | |
virtual void | on_changed () |
This is a default handler for the signal signal_changed(). More... | |
virtual void | on_unmounted () |
This is a default handler for the signal signal_unmounted(). More... | |
virtual void | on_pre_unmount () |
This is a default handler for the signal signal_pre_unmount(). More... | |
Protected Member Functions inherited from Glib::ObjectBase | |
ObjectBase () | |
This default constructor is called implicitly from the constructor of user-derived classes, even if, for instance, Gtk::Button calls a different ObjectBase constructor. More... | |
ObjectBase (const char* custom_type_name) | |
A derived constructor always overrides this choice. More... | |
ObjectBase (const std::type_info& custom_type_info) | |
This constructor is a special feature to allow creation of derived types on the fly, without having to use g_object_new() manually. More... | |
ObjectBase (ObjectBase&& src) noexcept | |
ObjectBase& | operator= (ObjectBase&& src) noexcept |
virtual | ~ObjectBase () noexcept=0 |
void | initialize (GObject* castitem) |
void | initialize_move (GObject* castitem, Glib::ObjectBase* previous_wrapper) |
Related Functions | |
(Note that these are not member functions.) | |
Glib::RefPtr< Gio::Mount > | wrap (GMount* object, bool take_copy=false) |
A Glib::wrap() method for this object. More... | |
Detailed Description
The Mount interface represents user-visible mounts.
Mount is a "mounted" filesystem that you can access. Mounted is in quotes because it's not the same as a unix mount: it might be a gvfs mount, but you can still access the files on it if you use GIO. It might or might not be related to a volume object.
Unmounting a Mount instance is an asynchronous operation. For more information about asynchronous operations, see AsyncReady. To unmount a Mount instance, first call unmount(). The callback slot will be called when the operation has resolved (either with success or failure), and a AsyncReady structure will be passed to the callback. That callback should then call unmount_finish() with the AsyncReady data to see if the operation was completed successfully.
Constructor & Destructor Documentation
|
protected |
You should derive from this class to use it.
|
noexcept |
|
overridenoexcept |
Member Function Documentation
|
static |
bool Gio::Mount::can_eject | ( | ) | const |
Checks if mount can be ejected.
- Returns
true
if the mount can be ejected.
bool Gio::Mount::can_unmount | ( | ) | const |
Checks if mount can be unmounted.
- Returns
true
if the mount can be unmounted.
void Gio::Mount::eject | ( | const SlotAsyncReady & | slot, |
const Glib::RefPtr< Cancellable >& | cancellable, | ||
UnmountFlags | flags = UnmountFlags::NONE |
||
) |
void Gio::Mount::eject | ( | const SlotAsyncReady & | slot, |
UnmountFlags | flags = UnmountFlags::NONE |
||
) |
void Gio::Mount::eject | ( | UnmountFlags | flags = UnmountFlags::NONE | ) |
void Gio::Mount::eject | ( | const Glib::RefPtr< MountOperation >& | mount_operation, |
const SlotAsyncReady & | slot, | ||
const Glib::RefPtr< Cancellable >& | cancellable, | ||
UnmountFlags | flags = UnmountFlags::NONE |
||
) |
void Gio::Mount::eject | ( | const Glib::RefPtr< MountOperation >& | mount_operation, |
const SlotAsyncReady & | slot, | ||
UnmountFlags | flags = UnmountFlags::NONE |
||
) |
void Gio::Mount::eject | ( | const Glib::RefPtr< MountOperation >& | mount_operation, |
UnmountFlags | flags = UnmountFlags::NONE |
||
) |
bool Gio::Mount::eject_finish | ( | const Glib::RefPtr< AsyncResult >& | result | ) |
Finishes ejecting a mount.
If any errors occurred during the operation, error will be set to contain the errors and false
will be returned.
- Parameters
-
result A AsyncResult.
- Returns
true
if the mount was successfully ejected.false
otherwise.
- Exceptions
-
Glib::Error
Glib::RefPtr<File> Gio::Mount::get_default_location | ( | ) | const |
Gets the default location of mount.
The default location of the given mount is a path that reflects the main entry point for the user (e.g. the home directory, or the root of the volume).
- Returns
- A File. The returned object should be unreffed with Glib::object_unref() when no longer needed.
Glib::RefPtr<Drive> Gio::Mount::get_drive | ( | ) |
Glib::RefPtr<const Drive> Gio::Mount::get_drive | ( | ) | const |
Glib::RefPtr<Icon> Gio::Mount::get_icon | ( | ) |
Gets the icon for mount.
- Returns
- A Icon. The returned object should be unreffed with Glib::object_unref() when no longer needed.
Glib::RefPtr<const Icon> Gio::Mount::get_icon | ( | ) | const |
Gets the icon for mount.
- Returns
- A Icon. The returned object should be unreffed with Glib::object_unref() when no longer needed.
std::string Gio::Mount::get_name | ( | ) | const |
Gets the name of mount.
- Returns
- The name for the given mount.
Glib::RefPtr<File> Gio::Mount::get_root | ( | ) |
Gets the root directory on mount.
- Returns
- A File. The returned object should be unreffed with Glib::object_unref() when no longer needed.
Glib::RefPtr<const File> Gio::Mount::get_root | ( | ) | const |
Gets the root directory on mount.
- Returns
- A File. The returned object should be unreffed with Glib::object_unref() when no longer needed.
Glib::ustring Gio::Mount::get_sort_key | ( | ) | const |
Gets the sort key for mount, if any.
- Returns
- Sorting key for mount or
nullptr
if no such key is available.
Glib::RefPtr<Icon> Gio::Mount::get_symbolic_icon | ( | ) |
Gets the symbolic icon for mount.
- Returns
- A Icon. The returned object should be unreffed with Glib::object_unref() when no longer needed.
Glib::RefPtr<const Icon> Gio::Mount::get_symbolic_icon | ( | ) | const |
Gets the symbolic icon for mount.
- Returns
- A Icon. The returned object should be unreffed with Glib::object_unref() when no longer needed.
|
static |
Get the GType for this class, for use with the underlying GObject type system.
std::string Gio::Mount::get_uuid | ( | ) | const |
Gets the UUID for the mount.
The reference is typically based on the file system UUID for the mount in question and should be considered an opaque string. Returns nullptr
if there is no UUID available.
- Returns
- The UUID for mount or
nullptr
if no UUID can be computed.
Glib::RefPtr<Volume> Gio::Mount::get_volume | ( | ) |
Gets the volume for the mount.
- Returns
- A Volume or
nullptr
if mount is not associated with a volume. The returned object should be unreffed with Glib::object_unref() when no longer needed.
Glib::RefPtr<const Volume> Gio::Mount::get_volume | ( | ) | const |
Gets the volume for the mount.
- Returns
- A Volume or
nullptr
if mount is not associated with a volume. The returned object should be unreffed with Glib::object_unref() when no longer needed.
|
inline |
Provides access to the underlying C GObject.
|
inline |
Provides access to the underlying C GObject.
void Gio::Mount::guess_content_type | ( | const SlotAsyncReady & | slot, |
const Glib::RefPtr< Cancellable >& | cancellable, | ||
bool | force_rescan = true |
||
) |
Tries to guess the type of content stored on the mount.
Returns one or more textual identifiers of well-known content types (typically prefixed with "x-content/"), e.g. x-content/image-dcf for camera memory cards. See the shared-mime-info specification for more on x-content types.
This is an asynchronous operation, and is finished by calling guess_content_type_finish().
- Parameters
-
slot A callback which will be called when the operation is completed or canceled. cancellable A cancellable object which can be used to cancel the operation. force_rescan Whether to force a rescan of the content. Otherwise a cached result will be used if available.
void Gio::Mount::guess_content_type | ( | const SlotAsyncReady & | slot, |
bool | force_rescan = true |
||
) |
Tries to guess the type of content stored on the mount.
Returns one or more textual identifiers of well-known content types (typically prefixed with "x-content/"), e.g. x-content/image-dcf for camera memory cards. See the shared-mime-info specification for more on x-content types.
This is an asynchronous operation, and is finished by calling guess_content_type_finish().
- Parameters
-
slot A callback which will be called when the operation is completed or canceled. force_rescan Whether to force a rescan of the content. Otherwise a cached result will be used if available.
void Gio::Mount::guess_content_type | ( | bool | force_rescan = true | ) |
Tries to guess the type of content stored on the mount.
Returns one or more textual identifiers of well-known content types (typically prefixed with "x-content/"), e.g. x-content/image-dcf for camera memory cards. See the shared-mime-info specification for more on x-content types.
- Parameters
-
force_rescan Whether to force a rescan of the content. Otherwise a cached result will be used if available.
std::vector<Glib::ustring> Gio::Mount::guess_content_type_finish | ( | const Glib::RefPtr< AsyncResult >& | result | ) |
Finishes guessing content types of the Mount.
If any errors occurred during the operation, an exception will be thrown. In particular, you may get a Gio::Error::NOT_SUPPORTED if the mount does not support content guessing.
- Parameters
-
result An AsyncResult.
- Returns
- An array of content types.
- Exceptions
-
Glib::Error
void Gio::Mount::guess_content_type_sync | ( | const Glib::RefPtr< Cancellable >& | cancellable, |
bool | force_rescan = true |
||
) |
void Gio::Mount::guess_content_type_sync | ( | bool | force_rescan = true | ) |
bool Gio::Mount::is_shadowed | ( | ) | const |
Determines if mount is shadowed.
Applications or libraries should avoid displaying mount in the user interface if it is shadowed.
A mount is said to be shadowed if there exists one or more user visible objects (currently Mount objects) with a root that is inside the root of mount.
One application of shadow mounts is when exposing a single file system that is used to address several logical volumes. In this situation, a VolumeMonitor implementation would create two Volume objects (for example, one for the camera functionality of the device and one for a SD card reader on the device) with activation URIs gphoto2://[usb:001,002]/store1/
and gphoto2://[usb:001,002]/store2/
. When the underlying mount (with root gphoto2://[usb:001,002]/
) is mounted, said VolumeMonitor implementation would create two Mount objects (each with their root matching the corresponding volume activation root) that would shadow the original mount.
The proxy monitor in GVfs 2.26 and later, automatically creates and manage shadow mounts (and shadows the underlying mount) if the activation root on a Volume is set.
- Returns
true
if mount is shadowed.
|
protectedvirtual |
This is a default handler for the signal signal_changed().
|
protectedvirtual |
This is a default handler for the signal signal_pre_unmount().
|
protectedvirtual |
This is a default handler for the signal signal_unmounted().
void Gio::Mount::remount | ( | const Glib::RefPtr< MountOperation >& | operation, |
const SlotAsyncReady & | slot, | ||
const Glib::RefPtr< Cancellable >& | cancellable, | ||
MountFlags | flags = MountFlags::NONE |
||
) |
Remounts a mount.
This is an asynchronous operation, and is finished by calling mount_finish() with the AsyncResult data returned in the callback slot.
Remounting is useful when some setting affecting the operation of the volume has been changed, as this may need a remount to take affect. While this is semantically equivalent with unmounting and then remounting, not all backends might need to actually be unmounted.
- Parameters
-
operation A mount operation. slot A callback which will be called when the operation is completed or canceled. cancellable A cancellable object which can be used to cancel the operation. flags Flags affecting the operation.
void Gio::Mount::remount | ( | const Glib::RefPtr< MountOperation >& | operation, |
const SlotAsyncReady & | slot, | ||
MountFlags | flags = MountFlags::NONE |
||
) |
Remounts a mount.
This is an asynchronous operation, and is finished by calling mount_finish() with the AsyncResult data returned in the callback slot.
Remounting is useful when some setting affecting the operation of the volume has been changed, as this may need a remount to take affect. While this is semantically equivalent with unmounting and then remounting, not all backends might need to actually be unmounted.
- Parameters
-
operation A mount operation. slot A callback which will be called when the operation is completed or canceled. flags Flags affecting the operation.
void Gio::Mount::remount | ( | const Glib::RefPtr< MountOperation >& | operation, |
MountFlags | flags = MountFlags::NONE |
||
) |
Remounts a mount.
Remounting is useful when some setting affecting the operation of the volume has been changed, as this may need a remount to take affect. While this is semantically equivalent with unmounting and then remounting, not all backends might need to actually be unmounted.
- Parameters
-
operation A mount operation. flags Flags affecting the operation.
void Gio::Mount::remount | ( | MountFlags | flags = MountFlags::NONE | ) |
Remounts a mount, without user interaction.
Remounting is useful when some setting affecting the operation of the volume has been changed, as this may need a remount to take affect. While this is semantically equivalent with unmounting and then remounting, not all backends might need to actually be unmounted.
- Parameters
-
flags Flags affecting the operation.
bool Gio::Mount::remount_finish | ( | const Glib::RefPtr< AsyncResult >& | result | ) |
Finishes remounting a mount.
If any errors occurred during the operation, error will be set to contain the errors and false
will be returned.
- Parameters
-
result A AsyncResult.
- Returns
true
if the mount was successfully remounted.false
otherwise.
- Exceptions
-
Glib::Error
void Gio::Mount::shadow | ( | ) |
Increments the shadow count on mount.
Usually used by VolumeMonitor implementations when creating a shadow mount for mount, see g_mount_is_shadowed() for more information. The caller will need to emit the Mount::signal_changed() signal on mount manually.
Glib::SignalProxy<void()> Gio::Mount::signal_changed | ( | ) |
- Slot Prototype:
void on_my_changed()
Flags: Run Last
Emitted when the mount has been changed.
Glib::SignalProxy<void()> Gio::Mount::signal_pre_unmount | ( | ) |
- Slot Prototype:
void on_my_pre_unmount()
Flags: Run Last
This signal may be emitted when the Mount is about to be unmounted.
This signal depends on the backend and is only emitted if GIO was used to unmount.
Glib::SignalProxy<void()> Gio::Mount::signal_unmounted | ( | ) |
- Slot Prototype:
void on_my_unmounted()
Flags: Run Last
This signal is emitted when the Mount have been unmounted. If the recipient is holding references to the object they should release them so the object can be finalized.
void Gio::Mount::unmount | ( | const SlotAsyncReady & | slot, |
const Glib::RefPtr< Cancellable >& | cancellable, | ||
UnmountFlags | flags = UnmountFlags::NONE |
||
) |
void Gio::Mount::unmount | ( | const SlotAsyncReady & | slot, |
UnmountFlags | flags = UnmountFlags::NONE |
||
) |
void Gio::Mount::unmount | ( | UnmountFlags | flags = UnmountFlags::NONE | ) |
void Gio::Mount::unmount | ( | const Glib::RefPtr< MountOperation >& | mount_operation, |
UnmountFlags | flags = UnmountFlags::NONE |
||
) |
void Gio::Mount::unmount | ( | const Glib::RefPtr< MountOperation >& | mount_operation, |
const SlotAsyncReady & | slot, | ||
UnmountFlags | flags = UnmountFlags::NONE |
||
) |
void Gio::Mount::unmount | ( | const Glib::RefPtr< MountOperation >& | mount_operation, |
const SlotAsyncReady & | slot, | ||
const Glib::RefPtr< Cancellable >& | cancellable, | ||
UnmountFlags | flags = UnmountFlags::NONE |
||
) |
bool Gio::Mount::unmount_finish | ( | const Glib::RefPtr< AsyncResult >& | result | ) |
Finishes unmounting a mount.
If any errors occurred during the operation, error will be set to contain the errors and false
will be returned.
- Parameters
-
result A AsyncResult.
- Returns
true
if the mount was successfully unmounted.false
otherwise.
- Exceptions
-
Glib::Error
void Gio::Mount::unshadow | ( | ) |
Decrements the shadow count on mount.
Usually used by VolumeMonitor implementations when destroying a shadow mount for mount, see g_mount_is_shadowed() for more information. The caller will need to emit the Mount::signal_changed() signal on mount manually.
Friends And Related Function Documentation
|
related |
A Glib::wrap() method for this object.
- Parameters
-
object The C instance. take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
- Returns
- A C++ instance that wraps this C instance.