This site has been permanently archived. The content on this site was last updated in 2019.
Stay organized with collections
Save and categorize content based on your preferences.
gvr::WrapperBase
#include <gvr_types.h>
Base class for all C++ wrapper objects.
Summary
Protected attributes
|
cobject_
|
WrappedType *
|
Public functions
|
cobj()
|
WrappedType *
Returns the wrapped C object. Does not affect ownership.
|
cobj() const
|
const WrappedType *
|
operator bool() const
|
Returns true if the wrapper holds an object.
|
operator=(WrapperBase && other)
|
|
operator=(const WrapperBase &)=delete
|
void
|
release()
|
WrappedType *
Returns the wrapped C object and transfers its ownership to the caller.
|
Protected attributes
cobject_
WrappedType * cobject_
Public functions
WrapperBase
WrapperBase(
WrappedType *cobject
)
Initializes a wrapper that holds a C object.
cobj
WrappedType * cobj()
Returns the wrapped C object. Does not affect ownership.
cobj
const WrappedType * cobj() const
operator bool
operator bool() const
Returns true if the wrapper holds an object.
release
WrappedType * release()
Returns the wrapped C object and transfers its ownership to the caller.
The wrapper becomes invalid and should not be used.
~WrapperBase
~WrapperBase()
All rights reserved. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-09 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-09 UTC."],[[["\u003cp\u003e\u003ccode\u003egvr::WrapperBase\u003c/code\u003e is a base class for all C++ wrapper objects, providing a consistent interface for managing wrapped C objects.\u003c/p\u003e\n"],["\u003cp\u003eIt offers methods to access (\u003ccode\u003ecobj()\u003c/code\u003e), release ownership (\u003ccode\u003erelease()\u003c/code\u003e), and check the validity (\u003ccode\u003eoperator bool()\u003c/code\u003e) of the wrapped C object.\u003c/p\u003e\n"],["\u003cp\u003eConstructors allow initialization with a C object pointer and move semantics, while copy construction and assignment are explicitly deleted.\u003c/p\u003e\n"],["\u003cp\u003eThe wrapped C object is stored internally as a protected attribute \u003ccode\u003ecobject_\u003c/code\u003e of type \u003ccode\u003eWrappedType *\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eUpon destruction (\u003ccode\u003e~WrapperBase()\u003c/code\u003e), the wrapper does not automatically manage the lifetime of the wrapped C object, leaving it to the user.\u003c/p\u003e\n"]]],["`WrapperBase` is a base class for C++ wrapper objects, managing a wrapped C object (`cobject_`). It initializes wrappers, handling object ownership. Key functions include `cobj()`, which returns the C object without changing ownership, and `release()`, which returns the C object and transfers ownership. Other operations include move construction/assignment and a boolean operator to check if an object is held. The copy constructor and copy assignment operator are deleted. It also provides a destructor `~WrapperBase()`.\n"],null,["# gvr::WrapperBase Class Reference\n\ngvr::WrapperBase\n================\n\n`#include \u003cgvr_types.h\u003e`\n\nBase class for all C++ wrapper objects.\n\nSummary\n-------\n\n| ### Constructors and Destructors ||\n|---|---|\n| [WrapperBase](#classgvr_1_1_wrapper_base_1a719b5bb3af8845ed01ba178ae35d6200)`(WrappedType *cobject)` Initializes a wrapper that holds a C object. ||\n| [WrapperBase](#classgvr_1_1_wrapper_base_1acc418dded94e3d0506b1c940a02bb970)`(`[WrapperBase](/vr/reference/android-ndk/class/gvr/wrapper-base#classgvr_1_1_wrapper_base)` && other)` ||\n| [WrapperBase](#classgvr_1_1_wrapper_base_1a6374058b8513939ef2665a43f0b734c8)`(const `[WrapperBase](/vr/reference/android-ndk/class/gvr/wrapper-base#classgvr_1_1_wrapper_base)` &)` ||\n| [~WrapperBase](#classgvr_1_1_wrapper_base_1a8af405555dbf161b4e0b3c2149f161d2)`()` ||\n\n| ### Protected attributes ||\n|---------------------------------------------------------------------------|-----------------|\n| [cobject_](#classgvr_1_1_wrapper_base_1a9ad323ad428dd01b1a27c4335486fd2c) | `WrappedType *` |\n\n| ### Public functions ||\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------|\n| [cobj](#classgvr_1_1_wrapper_base_1afdc3102922a7222eeb3cc067d364b544)`()` | `WrappedType *` Returns the wrapped C object. Does not affect ownership. |\n| [cobj](#classgvr_1_1_wrapper_base_1a05a9e9b968c5af4b391b3a6cc635745f)`() const ` | `const WrappedType *` |\n| [operator bool](#classgvr_1_1_wrapper_base_1a2cab548cbc3db1a70dc96c8ab8f90f4a)`() const ` | ` ` ` `Returns true if the wrapper holds an object. ` ` |\n| [operator=](#classgvr_1_1_wrapper_base_1ad66f367a80e385d9ed9dd3499f2e59cf)`(`[WrapperBase](/vr/reference/android-ndk/class/gvr/wrapper-base#classgvr_1_1_wrapper_base)` && other)` | [WrapperBase](/vr/reference/android-ndk/class/gvr/wrapper-base#classgvr_1_1_wrapper_base)` &` |\n| [operator=](#classgvr_1_1_wrapper_base_1ae702d573bb8d0cc6436743010cb21d45)`(const `[WrapperBase](/vr/reference/android-ndk/class/gvr/wrapper-base#classgvr_1_1_wrapper_base)` &)=delete` | `void` |\n| [release](#classgvr_1_1_wrapper_base_1a32d4d80350f27851f541aa3b81a2cb73)`()` | `WrappedType *` Returns the wrapped C object and transfers its ownership to the caller. |\n\nProtected attributes\n--------------------\n\n### cobject_\n\n```scdoc\nWrappedType * cobject_\n``` \n\nPublic functions\n----------------\n\n### WrapperBase\n\n```scdoc\n WrapperBase(\n WrappedType *cobject\n)\n``` \nInitializes a wrapper that holds a C object. \n\n### WrapperBase\n\n```text\n WrapperBase(\n WrapperBase && other\n)\n``` \n\n### WrapperBase\n\n```gdscript\n WrapperBase(\n const WrapperBase &\n)=delete\n``` \n\n### cobj\n\n```scdoc\nWrappedType * cobj()\n``` \nReturns the wrapped C object. Does not affect ownership. \n\n### cobj\n\n```gdscript\nconst WrappedType * cobj() const \n``` \n\n### operator bool\n\n```gdscript\n operator bool() const \n``` \nReturns true if the wrapper holds an object. \n\n### operator=\n\n```text\nWrapperBase & operator=(\n WrapperBase && other\n)\n``` \n\n### operator=\n\n```gdscript\nvoid operator=(\n const WrapperBase &\n)=delete\n``` \n\n### release\n\n```scdoc\nWrappedType * release()\n``` \nReturns the wrapped C object and transfers its ownership to the caller.\n\nThe wrapper becomes invalid and should not be used. \n\n### \\~WrapperBase\n\n```text\n ~WrapperBase()\n```"]]