![]() |
Safir SDK Core
|
Base class for containers for sequences of enumeration values. More...
#include <Safir/Dob/Typesystem/SequenceContainer.h>
Public Member Functions | |
EnumerationSequenceContainerBase () | |
Default Constructor. | |
bool | IsNull () const override |
Is the container set to null? | |
void | SetNull () override |
Set the container to null. | |
virtual size_t | size () const =0 |
Get the size of the sequence, i.e number of contained values. | |
virtual bool | empty () const =0 |
Check if sequence is empty. | |
virtual void | clear ()=0 |
Clear the sequence, i.e remove all values. | |
virtual void | PushBackOrdinal (const EnumerationValue val)=0 |
Insert a new ordinal value last in the sequence. | |
virtual void | SetOrdinal (const size_t index, const EnumerationValue val)=0 |
Update a specific value, using ordinal value. | |
virtual EnumerationValue | GetOrdinal (const size_t index) const =0 |
Get the ordinal value of the value at the specified index. | |
virtual void | InsertOrdinalAt (const size_t index, EnumerationValue value)=0 |
Insert a new ordinal value at specified index, growing the sequence. | |
virtual void | EraseAt (const size_t index)=0 |
Erase a value at specified index. | |
![]() | |
constexpr | ContainerBase () |
Default Constructor. | |
constexpr | ContainerBase (const ContainerBase &)=default |
Copy constructor. | |
virtual | ~ContainerBase () |
Virtual destructor. | |
virtual bool | IsChanged () const |
Is the change flag set on the container? | |
virtual void | SetChanged (const bool changed) |
Set the containers change flag. | |
virtual void | Copy (const ContainerBase &that)=0 |
Virtual assignment. | |
Additional Inherited Members | |
![]() | |
ContainerBase & | operator= (const ContainerBase &other) |
Copy assignment operator. | |
![]() | |
bool | m_bIsChanged |
The variable containing the change flag. | |
Base class for containers for sequences of enumeration values.
It allows for reflection on enumeration values, using ordinal values.
Safir::Dob::Typesystem::EnumerationSequenceContainerBase::EnumerationSequenceContainerBase | ( | ) |
Default Constructor.
Construct a container that is not changed and not null.
|
pure virtual |
Clear the sequence, i.e remove all values.
After a call to clear the sequence will be empty, which is implicitly the same as being null.
Implemented in Safir::Dob::Typesystem::EnumerationSequenceContainer< T >.
Referenced by SetNull().
|
pure virtual |
Check if sequence is empty.
Implemented in Safir::Dob::Typesystem::EnumerationSequenceContainer< T >.
Referenced by IsNull().
|
pure virtual |
Erase a value at specified index.
The sequence will shrink.
index | [in] - Index of the value to be removed. |
Implemented in Safir::Dob::Typesystem::EnumerationSequenceContainer< T >.
|
pure virtual |
Get the ordinal value of the value at the specified index.
index | [in] - Index of the value to get. |
std::out_of_range | exception if index is not in range |
Implemented in Safir::Dob::Typesystem::EnumerationSequenceContainer< T >.
|
pure virtual |
Insert a new ordinal value at specified index, growing the sequence.
index | [in] - Index of the new value. |
value | [in] - Value to insert. |
IllegalValueException | if the value is not in the enumeration. |
Implemented in Safir::Dob::Typesystem::EnumerationSequenceContainer< T >.
|
overridevirtual |
Is the container set to null?
Implements Safir::Dob::Typesystem::ContainerBase.
References empty().
|
pure virtual |
Insert a new ordinal value last in the sequence.
If the sequence was null before it will no longer be null after this call.
val | [in] - Value to be inserted. |
IllegalValueException | if the value is not in the enumeration. |
Implemented in Safir::Dob::Typesystem::EnumerationSequenceContainer< T >.
|
overridevirtual |
Set the container to null.
Implements Safir::Dob::Typesystem::ContainerBase.
References clear().
|
pure virtual |
Update a specific value, using ordinal value.
Will not add new values to the sequence.
index | [in] - Index of the value to set. |
val | [in] - Value to set. |
std::out_of_range | exception if index is not in range |
IllegalValueException | if the value is not in the enumeration. |
Implemented in Safir::Dob::Typesystem::EnumerationSequenceContainer< T >.
|
pure virtual |
Get the size of the sequence, i.e number of contained values.
Implemented in Safir::Dob::Typesystem::EnumerationSequenceContainer< T >.