Visual Computing Library
Loading...
Searching...
No Matches
vcl::CustomComponentVectorHandle< T > Class Template Reference

Allows to access directly to a custom component. More...

#include <vclib/mesh/containers/custom_component_vector_handle.h>

Classes

class  ConstIterator
 
class  Iterator
 

Public Member Functions

 CustomComponentVectorHandle (std::vector< std::any > &cc)
 
T & at (uint i)
 
const T & at (uint i) const
 
T & front ()
 
const T & front () const
 
T & back ()
 
const T & back () const
 
uint size () const
 
T & operator[] (uint i)
 
const T & operator[] (uint i) const
 
Iterator begin ()
 
Iterator end ()
 
ConstIterator begin () const
 
ConstIterator end () const
 

Private Attributes

std::vector< std::reference_wrapper< T > > mVec
 

Detailed Description

template<typename T>
class vcl::CustomComponentVectorHandle< T >

Allows to access directly to a custom component.

The class allows to access a custom component stored in a Contaner of Elements without having to use the Container itself and avoiding copies, and it can be used as a normal std::vector. The class stores references to the custom components, therefore it allows to modify them.

It is meant to be created by a Container, that constructs it from the vector of custom components and then returns it to the user.

Note
A CustomComponentVectorHandle object is meant to be used to access the custom components. It does not make sense to modify the size of the container or to add or remove elements. Member functions that modify the size of the container are not implemented.
If the Element Container is modified after the creation of a CustomComponentVectorHandle, the CustomComponentVectorHandle is not updated and still contains the old references to the custom components (that may be invalidated).
Template Parameters
TThe type of the custom component.

The documentation for this class was generated from the following file: