Safir SDK Core
Loading...
Searching...
No Matches
Safir::Dob::Typesystem::EnumerationContainerBase Class Referenceabstract

Base class for containers of enumeration values. More...

#include <Safir/Dob/Typesystem/EnumerationContainerBase.h>

Inheritance diagram for Safir::Dob::Typesystem::EnumerationContainerBase:
[legend]
Collaboration diagram for Safir::Dob::Typesystem::EnumerationContainerBase:
[legend]

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.
 
- Public Member Functions inherited from Safir::Dob::Typesystem::ContainerBase
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.
 
EnumerationContainerBaseoperator= (const EnumerationContainerBase &other)=default
 Copy assignment operator.
 
- Protected Member Functions inherited from Safir::Dob::Typesystem::ContainerBase
ContainerBaseoperator= (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.
 
- Protected Attributes inherited from Safir::Dob::Typesystem::ContainerBase
bool m_bIsChanged
 The variable containing the change flag.
 

Friends

class Safir::Dob::Typesystem::Internal::BlobOperations
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ EnumerationContainerBase() [1/2]

constexpr Safir::Dob::Typesystem::EnumerationContainerBase::EnumerationContainerBase ( )
constexpr

Default Constructor.

Constructs an enumeration container that is null and not changed.

◆ EnumerationContainerBase() [2/2]

constexpr Safir::Dob::Typesystem::EnumerationContainerBase::EnumerationContainerBase ( const EnumerationContainerBase & other)
constexprprotecteddefault

Copy constructor.

Parameters
other[in] - The object to copy.

Member Function Documentation

◆ Copy()

void Safir::Dob::Typesystem::EnumerationContainerBase::Copy ( const ContainerBase & that)
overridevirtual

Virtual assignment.

Copy all the members from "that" into "this". Types must be the same for this to work!

Parameters
that[in] - The object to copy into this.
Exceptions
SoftwareViolationExceptionIf the types are not of the same kind.

Implements Safir::Dob::Typesystem::ContainerBase.

References __WFILE__.

◆ GetOrdinal()

virtual EnumerationValue Safir::Dob::Typesystem::EnumerationContainerBase::GetOrdinal ( ) const
pure virtual

◆ IsNull()

bool Safir::Dob::Typesystem::EnumerationContainerBase::IsNull ( ) const
overridevirtual

Is the container set to null?

Returns
True if the container is set to null.

Implements Safir::Dob::Typesystem::ContainerBase.

References m_bIsNull.

◆ operator=()

EnumerationContainerBase & Safir::Dob::Typesystem::EnumerationContainerBase::operator= ( const EnumerationContainerBase & other)
protecteddefault

Copy assignment operator.

Parameters
other[in] - The object to copy.
Returns
A reference to this.

◆ SetNull()

void Safir::Dob::Typesystem::EnumerationContainerBase::SetNull ( )
overridevirtual

◆ SetOrdinal()

virtual void Safir::Dob::Typesystem::EnumerationContainerBase::SetOrdinal ( const EnumerationValue value)
pure virtual

Friends And Related Symbol Documentation

◆ Safir::Dob::Typesystem::Internal::BlobOperations

friend class Safir::Dob::Typesystem::Internal::BlobOperations
friend

Member Data Documentation

◆ m_bIsNull

bool Safir::Dob::Typesystem::EnumerationContainerBase::m_bIsNull
protected

The null flag for the enumeration container.

Referenced by IsNull(), and SetNull().

◆ m_Value

EnumerationValue Safir::Dob::Typesystem::EnumerationContainerBase::m_Value
protected

The value of the enumeration container.

This is the ordinal value. Needs to be cast to the correct type in the derived classes.