8#ifndef META_OCEAN_DEVICES_ARCORE_AC_SCOPED_AR_OBJECT_H
9#define META_OCEAN_DEVICES_ARCORE_AC_SCOPED_AR_OBJECT_H
13#include <arcore_c_api.h>
25template <
typename T,
void (*tDestroyFunction)(T*)>
126template <
typename T,
void (*tDestroyFunction)(T*)>
185 inline operator T*()
const;
191 explicit inline operator bool()
const;
218template <
typename T,
void (*tDestroyFunction)(T*)>
222 static_assert(tDestroyFunction !=
nullptr,
"Invalid destroy function!");
225template <
typename T,
void (*tDestroyFunction)(T*)>
228 ocean_assert(arSession !=
nullptr);
229 ocean_assert(createFunction !=
nullptr);
231 createFunction(arSession, &
object_);
232 ocean_assert(
object_ !=
nullptr);
235template <
typename T,
void (*tDestroyFunction)(T*)>
238 *
this = std::move(arScopedObject);
241template <
typename T,
void (*tDestroyFunction)(T*)>
247template <
typename T,
void (*tDestroyFunction)(T*)>
255template <
typename T,
void (*tDestroyFunction)(T*)>
265template <
typename T,
void (*tDestroyFunction)(T*)>
271template <
typename T,
void (*tDestroyFunction)(T*)>
277template <
typename T,
void (*tDestroyFunction)(T*)>
280 if (
this != &arScopedObject)
284 object_ = arScopedObject.object_;
285 arScopedObject.object_ =
nullptr;
This class implements a scoped object for ARCore objects.
Definition ScopedARObject.h:128
T ** ingest()
Allows ingesting an object via an external function.
Definition ScopedARObject.h:248
void(*)(const ArSession *arSession, ArSession **object) CreateFunction
Definition ScopedARObject.h:136
~ScopedARObject()
Destructs the object and destroys it.
Definition ScopedARObject.h:242
ScopedARObject< T, tDestroyFunction > & operator=(ScopedARObject< T, tDestroyFunction > &&arScopedObject)
Move operator.
Definition ScopedARObject.h:278
ScopedARObject(T *object)
Creates a new scoped ARCore object.
Definition ScopedARObject.h:219
ScopedARObject(const ArSession *arSession, const CreateFunction &createFunction)
Creates a new scoped ARCore object.
Definition ScopedARObject.h:226
ScopedARObject(const ScopedARObject< T, tDestroyFunction > &)=delete
Disabled copy constructor.
ScopedARObject()=default
Default constructor creating an invalid object.
void release()
Explicitly releases the scoped object.
Definition ScopedARObject.h:256
ScopedARObject< T, tDestroyFunction > & operator=(const ScopedARObject< T, tDestroyFunction > &)=delete
Disabled assign operator.
ScopedARObject(ScopedARObject< T, tDestroyFunction > &&arScopedObject)
Move constructor.
Definition ScopedARObject.h:236
ArSession * object_
Definition ScopedARObject.h:215
ScopedARObject< ArTrackable, ArTrackable_release > ScopedARTrackable
Definition of a scoped object for ArTrackable.
Definition ScopedARObject.h:103
ScopedARObject< ArImage, ArImage_release > ScopedARImage
Definition of a scoped object for ArImage.
Definition ScopedARObject.h:61
ScopedARObject< ArPointCloud, ArPointCloud_release > ScopedARPointCloud
Definition of a scoped object for ArPointCloud.
Definition ScopedARObject.h:117
ScopedARObject< ArCameraConfig, ArCameraConfig_destroy > ScopedARCameraConfig
Definition of a scoped object for ArCameraConfig.
Definition ScopedARObject.h:75
ScopedARObject< ArPose, ArPose_destroy > ScopedARPose
Definition of a scoped object for ArPose.
Definition ScopedARObject.h:47
ScopedARObject< ArTrackableList, ArTrackableList_destroy > ScopedARTrackableList
Definition of a scoped object for ArTrackableList.
Definition ScopedARObject.h:110
ScopedARObject< ArCameraConfigList, ArCameraConfigList_destroy > ScopedARCameraConfigList
Definition of a scoped object for ArCameraConfigList.
Definition ScopedARObject.h:82
ScopedARObject< ArSession, ArSession_destroy > ScopedARSession
Definition of a scoped object for ArSession.
Definition ScopedARObject.h:33
ScopedARObject< ArCameraConfigFilter, ArCameraConfigFilter_destroy > ScopedARCameraConfigFilter
Definition of a scoped object for ArCameraConfigFilter.
Definition ScopedARObject.h:89
ScopedARObject< ArCameraIntrinsics, ArCameraIntrinsics_destroy > ScopedARCameraIntrinsics
Definition of a scoped object for ArCameraIntrinsics.
Definition ScopedARObject.h:96
ScopedARObject< ArCamera, ArCamera_release > ScopedARCamera
Definition of a scoped object for ArCamera.
Definition ScopedARObject.h:68
ScopedARObject< ArConfig, ArConfig_destroy > ScopedARConfig
Definition of a scoped object for ArConfig.
Definition ScopedARObject.h:40
ScopedARObject< ArFrame, ArFrame_destroy > ScopedARFrame
Definition of a scoped object for ArFrame.
Definition ScopedARObject.h:54
Namespace of the Devices ARCore library.
Definition ACDepthTracker6DOF.h:23
Namespace of the Devices library.
Definition AccelerationSensor3DOF.h:24
The namespace covering the entire Ocean framework.
Definition Accessor.h:15