CVB++ 15.0
Composite Class Referencefinal

Component class is a container for CVB objects. More...

#include <cvb/composite.hpp>

Public Member Functions

void * Handle () const noexcept
 Classic API node handle. More...
 
CompositePurpose Purpose () const noexcept
 Gets the purpose of this Composite. More...
 
bool ContainsItem (const CompositeVariant &item) const
 Checks whether item is in this Composite. More...
 
int ItemCount () const noexcept
 Number of variants in the composite. More...
 
void InsertItemAt (int index, const CompositeVariant &item)
 Insert a composite item specified at given index. More...
 
void PushBackItem (const CompositeVariant &item)
 Appends a composite item. More...
 
CompositeVariant ItemAt (int index) const
 Access to a composite item specified by its index. More...
 
void RemoveItemAt (int index)
 Remove a composite item specified by its index. More...
 

Static Public Member Functions

static std::unique_ptr< CompositeCreate (CompositePurpose purpose=CompositePurpose::Custom)
 Creates a composite with the given optional parameter. More...
 
static std::unique_ptr< CompositeFromHandle (HandleGuard< Composite > &&guard)
 Creates a composite from a classic API handle. More...
 
template<class T >
static CompositePtr FromObject (std::shared_ptr< T > object)
 Returns a composite object from the given composite compatible object. More...
 

Detailed Description

Component class is a container for CVB objects.

Member Function Documentation

◆ ContainsItem()

bool ContainsItem ( const CompositeVariant item) const
inline

Checks whether item is in this Composite.

Returns
true if item is in this composite; false if not.

◆ Create()

static std::unique_ptr< Composite > Create ( CompositePurpose  purpose = CompositePurpose::Custom)
inlinestatic

Creates a composite with the given optional parameter.

Parameters
[in]purposeThe purpose of this container.
Returns
Pointer to the created composite.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ FromHandle()

static std::unique_ptr< Composite > FromHandle ( HandleGuard< Composite > &&  guard)
inlinestatic

Creates a composite from a classic API handle.

Parameters
[in]guardLife time guard for C-API handle.
Returns
The composite created from the classic API handle.
Exceptions
Anyexception derived from std::exception including CvbException.

The composite takes ownership of the handle, so you must share it before using this function.

◆ FromObject()

static CompositePtr FromObject ( std::shared_ptr< T >  object)
static

Returns a composite object from the given composite compatible object.

Parameters
[in]objectA composite compatible object to share.
Returns
A composite that shares resources with the given object.
Examples
Cvb/CppPointCloudAcquisition.

◆ Handle()

void * Handle ( ) const
inlinenoexcept

Classic API node handle.

Returns
Classic API handle.
Exceptions
Doesnot throw any exception.

It is normally not necessary to work with this handle.

◆ InsertItemAt()

void InsertItemAt ( int  index,
const CompositeVariant item 
)
inline

Insert a composite item specified at given index.

Parameters
[in]indexItem index to insert the composite item at given index.
[in]itemThe composite item to insert.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ ItemAt()

CompositeVariant ItemAt ( int  index) const
inline

Access to a composite item specified by its index.

Parameters
[in]indexItem index of the composite item to access.
Returns
A variant.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ ItemCount()

int ItemCount ( ) const
inlinenoexcept

Number of variants in the composite.

Returns
Number of variants.
Exceptions
Doesnot throw any exception.

◆ Purpose()

CompositePurpose Purpose ( ) const
inlinenoexcept

Gets the purpose of this Composite.

Returns
The Cvb::CompositePurpose of this object.

◆ PushBackItem()

void PushBackItem ( const CompositeVariant item)
inline

Appends a composite item.

Parameters
[in]itemThe composite item to append.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ RemoveItemAt()

void RemoveItemAt ( int  index)
inline

Remove a composite item specified by its index.

Parameters
[in]indexItem index of the composite item to remove.
Exceptions
Anyexception derived from std::exception including CvbException.