eVision C++ API 26.10.0-beta.2.dev
Loading...
Searching...
No Matches
eVision::EColorVector Class Reference

Vector objects are used to store 1-dimensional data. More...

#include <eVision/Easy/EColorVector.h>

Inheritance diagram for eVision::EColorVector:
Collaboration diagram for eVision::EColorVector:

Public Member Functions

 EColorVector ()
 Constructs a vector.
 EColorVector (uint32_t un32MaxElements)
 EColorVector (const eVision::EColorVector &other)
 Constructs a vector.
virtual ~EColorVector () throw ()
eVision::EColor & operator[] (uint32_t index) const
 Gives access to the vector element at the given index.
eVision::EColorVector & operator= (const eVision::EColorVector &other)
 Copies all the data from another EColorVector object into the current EColorVector object.
void * GetRawDataPtr () const
 Pointer to the vector data.
void AddElement (eVision::EColor element)
 Appends (adds at the tail) an element to the vector.
eVision::EColor GetElement (int32_t index) const
 Returns the vector element at the given index.
void SetElement (int32_t index, eVision::EColor value)
 Modifies the vector element at the given index by the given value.
 EColorVector (CppWrapperInternal::InternalConstructor)
Public Member Functions inherited from eVision::EVector
virtual ~EVector () throw ()
uint32_t GetNumElements () const
 Number of elements in the vector.
void SetNumElements (uint32_t un32NumElements)
 Number of elements in the vector.
void Empty ()
 Resets the number of elements to 0.
virtual void RemoveElement (uint32_t index)
 Removes the element at the specified position.
void Save (const std::string &path)
 Saves the EVector object with all its attributes.
void Save (eVision::ESerializer *serializer)
 Saves the EVector object with all its attributes.
void Save (const std::string &path, uint32_t un32Version)
 Saves the EVector object with all its attributes.
void Save (eVision::ESerializer *serializer, uint32_t un32Version)
 Saves the EVector object with all its attributes.
void Load (const std::string &path)
 Loads the EVector object with all its attributes.
void Load (eVision::ESerializer *serializer)
 Loads the EVector object with all its attributes.
void Load (const std::string &path, uint32_t un32Version)
 Loads the EVector object with all its attributes.
void Load (eVision::ESerializer *serializer, uint32_t un32Version)
 Loads the EVector object with all its attributes.
 EVector (CppWrapperInternal::InternalConstructor)

Additional Inherited Members

Public Attributes inherited from eVision::EVector
CppWrapperInternal::WrappedClass wrappedClass_

Detailed Description

Vector objects are used to store 1-dimensional data.

Using vectors is very similar to using 1-dimensional arrays, except that the size can vary at runtime. Memory allocation is handled internally.

  • To create a vector, use its constructor.
  • To fill a vector with values, first empty it, using the EVector::Empty member, and then add elements one at time at the tail by calling the EColorVector::AddElement member.
  • To access a vector element, either for reading or writing, use the [] operator.
  • To inquire for the current number of elements, use member EVector::GetNumElements.

License(s): BasicTypes

Constructor & Destructor Documentation

◆ EColorVector() [1/4]

eVision::EColorVector::EColorVector ( )

Constructs a vector.

◆ EColorVector() [2/4]

eVision::EColorVector::EColorVector ( uint32_t un32MaxElements)
Parameters
un32MaxElementsMax number of elements in the EColorVector.

◆ EColorVector() [3/4]

eVision::EColorVector::EColorVector ( const eVision::EColorVector & other)

Constructs a vector.

Parameters
otherEColorVector object to be copied

◆ ~EColorVector()

eVision::EColorVector::~EColorVector ( )
throw ( )
virtual

◆ EColorVector() [4/4]

eVision::EColorVector::EColorVector ( CppWrapperInternal::InternalConstructor )

Member Function Documentation

◆ AddElement()

void eVision::EColorVector::AddElement ( eVision::EColor element)

Appends (adds at the tail) an element to the vector.

Parameters
elementThe element to be added.

◆ GetElement()

eVision::EColor eVision::EColorVector::GetElement ( int32_t index) const

Returns the vector element at the given index.

Parameters
indexIndex, between 0 and EVector::GetNumElements (excluded) of the element to be accessed.

If the given index is outside the bounds of the vector, the error code EError::EError_Parameter1OutOfRange is set.

◆ GetRawDataPtr()

void * eVision::EColorVector::GetRawDataPtr ( ) const

Pointer to the vector data.

◆ operator=()

eVision::EColorVector & eVision::EColorVector::operator= ( const eVision::EColorVector & other)

Copies all the data from another EColorVector object into the current EColorVector object.

Parameters
otherEColorVector object to be copied

◆ operator[]()

eVision::EColor & eVision::EColorVector::operator[] ( uint32_t index) const

Gives access to the vector element at the given index.

Parameters
indexIndex, between 0 and EVector::GetNumElements (excluded) of the element to be accessed.

◆ SetElement()

void eVision::EColorVector::SetElement ( int32_t index,
eVision::EColor value )

Modifies the vector element at the given index by the given value.

Parameters
indexIndex, between 0 and EVector::GetNumElements (excluded), of the element to be modified.
valueThe new value for the element.

If the given index is outside the bounds of the vector, the error code EError::EError_Parameter1OutOfRange is set.