![]() |
Safir SDK Core
|
Base class for containers of enumeration values. More...
#include <Safir/Dob/Typesystem/EnumerationContainerBase.h>
Public Member Functions | |
constexpr | EnumerationContainerBase () |
Default Constructor. | |
virtual void | SetOrdinal (const EnumerationValue value)=0 |
Set the ordinal value of the enumeration container. | |
virtual EnumerationValue | GetOrdinal () const =0 |
Get the ordinal value of the enumeration container. | |
bool | IsNull () const override |
Is the container set to null? | |
void | SetNull () override |
Set the container to null. | |
void | Copy (const ContainerBase &that) override |
Virtual assignment. | |
![]() | |
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. | |
Protected Member Functions | |
constexpr | EnumerationContainerBase (const EnumerationContainerBase &other)=default |
Copy constructor. | |
EnumerationContainerBase & | operator= (const EnumerationContainerBase &other)=default |
Copy assignment operator. | |
![]() | |
ContainerBase & | operator= (const ContainerBase &other) |
Copy assignment operator. | |
Protected Attributes | |
bool | m_bIsNull |
The null flag for the enumeration container. | |
EnumerationValue | m_Value |
The value of the enumeration container. | |
![]() | |
bool | m_bIsChanged |
The variable containing the change flag. | |
Friends | |
class | Safir::Dob::Typesystem::Internal::BlobOperations |
Base class for containers of enumeration values.
The containers for enumerations are defined in the automatically generated code, but this class defines the common functionality for them. Enumeration containers really store the ordinal values (integer representation of the enumeration), and this class has methods for setting and getting the ordinal. The derived class (in the generated code) has methods for setting and getting the value as an enumeration value. Most applications should not use the GetOrdinal/SetOrdinal functions, but should use the SetVal and GetVal methods defined in the derived classes.
|
constexpr |
Default Constructor.
Constructs an enumeration container that is null and not changed.
|
constexprprotecteddefault |
Copy constructor.
other | [in] - The object to copy. |
|
overridevirtual |
Virtual assignment.
Copy all the members from "that" into "this". Types must be the same for this to work!
that | [in] - The object to copy into this. |
SoftwareViolationException | If the types are not of the same kind. |
Implements Safir::Dob::Typesystem::ContainerBase.
References __WFILE__.
|
pure virtual |
Get the ordinal value of the enumeration container.
Note: Only applications that need to use "anonymous enums" should use this method. All other applications should be using the GetVal method.
NullException | The container is null. |
Implemented in Safir::Control::Operation::EnumerationContainer, Safir::Dob::CallbackId::EnumerationContainer, Safir::Dob::ConnectionQueueId::EnumerationContainer, Safir::Dob::DistributionScope::EnumerationContainer, Safir::Dob::InjectionKind::EnumerationContainer, Safir::Dob::InstanceIdPolicy::EnumerationContainer, Safir::Dob::MemoryLevel::EnumerationContainer, Safir::Dob::NodeState::EnumerationContainer, Safir::Dob::PersistenceBackend::EnumerationContainer, Safir::Dob::PersistentDataState::EnumerationContainer, and Safir::Utilities::ForEach::ResponseType::EnumerationContainer.
|
overridevirtual |
Is the container set to null?
Implements Safir::Dob::Typesystem::ContainerBase.
References m_bIsNull.
|
protecteddefault |
Copy assignment operator.
other | [in] - The object to copy. |
|
overridevirtual |
Set the container to null.
Implements Safir::Dob::Typesystem::ContainerBase.
References Safir::Dob::Typesystem::ContainerBase::m_bIsChanged, and m_bIsNull.
|
pure virtual |
Set the ordinal value of the enumeration container.
Note: Only applications that need to use "anonymous enums" should use this method. All other applications should be using the SetVal method.
value | [in] - The new value. |
IllegalValueException | The value is not in the range of the enumeration. |
Implemented in Safir::Control::Operation::EnumerationContainer, Safir::Dob::CallbackId::EnumerationContainer, Safir::Dob::ConnectionQueueId::EnumerationContainer, Safir::Dob::DistributionScope::EnumerationContainer, Safir::Dob::InjectionKind::EnumerationContainer, Safir::Dob::InstanceIdPolicy::EnumerationContainer, Safir::Dob::MemoryLevel::EnumerationContainer, Safir::Dob::NodeState::EnumerationContainer, Safir::Dob::PersistenceBackend::EnumerationContainer, Safir::Dob::PersistentDataState::EnumerationContainer, and Safir::Utilities::ForEach::ResponseType::EnumerationContainer.
|
friend |
|
protected |
|
protected |
The value of the enumeration container.
This is the ordinal value. Needs to be cast to the correct type in the derived classes.