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

Base class for all Containers. More...

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

Inheritance diagram for Safir::Dob::Typesystem::ContainerBase:
[legend]

Public Member Functions

constexpr ContainerBase ()
 Default Constructor.
 
constexpr ContainerBase (const ContainerBase &)=default
 Copy constructor.
 
virtual ~ContainerBase ()
 Virtual destructor.
 
virtual bool IsNull () const =0
 Is the container set to null?
 
virtual void SetNull ()=0
 Set the container to null.
 
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.
 

Protected Member Functions

ContainerBaseoperator= (const ContainerBase &other)
 Copy assignment operator.
 

Protected Attributes

bool m_bIsChanged
 The variable containing the change flag.
 

Detailed Description

Base class for all Containers.

This class contains common functionality for all Containers. Basically this amounts to the interface for nullability and the change flag.

Constructor & Destructor Documentation

◆ ContainerBase() [1/2]

constexpr Safir::Dob::Typesystem::ContainerBase::ContainerBase ( )
constexpr

Default Constructor.

Construct a container that is not changed.

◆ ContainerBase() [2/2]

constexpr Safir::Dob::Typesystem::ContainerBase::ContainerBase ( const ContainerBase & )
constexprdefault

Copy constructor.

◆ ~ContainerBase()

virtual Safir::Dob::Typesystem::ContainerBase::~ContainerBase ( )
virtual

Virtual destructor.

Needed to ensure proper destruction of Object pointers.

Member Function Documentation

◆ Copy()

virtual void Safir::Dob::Typesystem::ContainerBase::Copy ( const ContainerBase & that)
pure virtual

◆ IsChanged()

virtual bool Safir::Dob::Typesystem::ContainerBase::IsChanged ( ) const
virtual

◆ IsNull()

virtual bool Safir::Dob::Typesystem::ContainerBase::IsNull ( ) const
pure virtual

Is the container set to null?

Returns
True if the container is set to null.

Implemented in Safir::Dob::Typesystem::DictionaryContainer< KeyT, ValT >, Safir::Dob::Typesystem::EnumerationContainerBase, Safir::Dob::Typesystem::ObjectContainerImpl< T >, Safir::Dob::Typesystem::ObjectContainerImpl< ClassType >, Safir::Dob::Typesystem::ObjectContainerImpl< Entity >, Safir::Dob::Typesystem::ObjectContainerImpl< Safir::Dob::Typesystem::Object >, Safir::Dob::Typesystem::ObjectContainerImpl< U >, Safir::Dob::Typesystem::ObjectContainerImpl< Object >, Safir::Dob::Typesystem::SequenceContainer< T >, Safir::Dob::Typesystem::SequenceContainer< std::shared_ptr< ClassType > >, Safir::Dob::Typesystem::SequenceContainer< std::shared_ptr< ConnectionStatisticsItem > >, Safir::Dob::Typesystem::SequenceContainer< std::shared_ptr< ConnectionStatisticsResponse > >, Safir::Dob::Typesystem::SequenceContainer< std::shared_ptr< EnumType > >, Safir::Dob::Typesystem::SequenceContainer< std::shared_ptr< Member > >, Safir::Dob::Typesystem::SequenceContainer< std::shared_ptr< T > >, Safir::Dob::Typesystem::EnumerationSequenceContainerBase, Safir::Dob::Typesystem::ValueContainer< T >, Safir::Dob::Typesystem::StringContainer, and Safir::Dob::Typesystem::BinaryContainer.

Referenced by Safir::Dob::Typesystem::ObjectContainerImpl< T >::Copy(), and Safir::Dob::Typesystem::ObjectContainerImpl< Object >::Copy().

Here is the caller graph for this function:

◆ operator=()

ContainerBase & Safir::Dob::Typesystem::ContainerBase::operator= ( const ContainerBase & other)
protected

Copy assignment operator.

Declared protected to stop incorrect non-virtual assignments (use Copy for virtual assignment).

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

References m_bIsChanged.

Referenced by Safir::Dob::Typesystem::ObjectContainerBase::operator=().

Here is the caller graph for this function:

◆ SetChanged()

virtual void Safir::Dob::Typesystem::ContainerBase::SetChanged ( const bool changed)
virtual

Set the containers change flag.

It should be fairly unusual for an application to have to use this operation. There is nothing dangerous about it, but are you sure this is the operation you were after?

The change flag is how receivers of objects can work out what the sender really wanted done on the object.

Note: If this is a container containing one or more objects this call will recursively set all the change flags in the contained objects.

Parameters
changed[in] - The value to set the change flag(s) to.

Reimplemented in Safir::Dob::Typesystem::DictionaryContainer< KeyT, ValT >, Safir::Dob::Typesystem::ObjectContainerImpl< T >, Safir::Dob::Typesystem::ObjectContainerImpl< ClassType >, Safir::Dob::Typesystem::ObjectContainerImpl< Entity >, Safir::Dob::Typesystem::ObjectContainerImpl< Safir::Dob::Typesystem::Object >, Safir::Dob::Typesystem::ObjectContainerImpl< U >, Safir::Dob::Typesystem::ObjectContainerImpl< Object >, Safir::Dob::Typesystem::GenericObjectSequenceContainer< T >, Safir::Dob::Typesystem::GenericObjectSequenceContainer< ClassType >, Safir::Dob::Typesystem::GenericObjectSequenceContainer< ConnectionStatisticsItem >, Safir::Dob::Typesystem::GenericObjectSequenceContainer< ConnectionStatisticsResponse >, Safir::Dob::Typesystem::GenericObjectSequenceContainer< EnumType >, and Safir::Dob::Typesystem::GenericObjectSequenceContainer< Member >.

References m_bIsChanged.

◆ SetNull()

Member Data Documentation

◆ m_bIsChanged

bool Safir::Dob::Typesystem::ContainerBase::m_bIsChanged
protected

The variable containing the change flag.

Referenced by Safir::Dob::Typesystem::DictionaryContainer< KeyT, ValT >::clear(), Safir::Dob::Typesystem::SequenceContainer< T >::clear(), Safir::Dob::Typesystem::EnumerationSequenceContainer< T >::clear(), Safir::Dob::Typesystem::DictionaryContainer< KeyT, ValT >::Copy(), Safir::Dob::Typesystem::ObjectContainerImpl< T >::Copy(), Safir::Dob::Typesystem::ObjectContainerImpl< Object >::Copy(), Safir::Dob::Typesystem::SequenceContainer< T >::Copy(), Safir::Dob::Typesystem::EnumerationSequenceContainer< T >::Copy(), Safir::Dob::Typesystem::DictionaryContainer< KeyT, ValT >::erase(), Safir::Dob::Typesystem::SequenceContainer< T >::EraseAt(), Safir::Dob::Typesystem::EnumerationSequenceContainer< T >::EraseAt(), Safir::Dob::Typesystem::DictionaryContainer< KeyT, ValT >::Insert(), Safir::Dob::Typesystem::SequenceContainer< T >::InsertAt(), Safir::Dob::Typesystem::DictionaryContainer< KeyT, ValT >::InsertNullInternal(), Safir::Dob::Typesystem::EnumerationSequenceContainer< T >::InsertOrdinalAt(), IsChanged(), Safir::Dob::Typesystem::DictionaryContainer< KeyT, ValT >::IsChanged(), Safir::Dob::Typesystem::ObjectContainerImpl< T >::IsChanged(), Safir::Dob::Typesystem::ObjectContainerImpl< Object >::IsChanged(), Safir::Dob::Typesystem::GenericObjectSequenceContainer< T >::IsChanged(), Safir::Dob::Typesystem::DictionaryContainerBase::IsChangedHere(), Safir::Dob::Typesystem::ObjectContainerBase::IsChangedHere(), Safir::Dob::Typesystem::GenericObjectSequenceContainer< T >::IsChangedHere(), operator=(), Safir::Dob::Typesystem::DictionaryContainer< KeyT, ValT >::operator[](), Safir::Dob::Typesystem::SequenceContainer< T >::push_back(), Safir::Dob::Typesystem::EnumerationSequenceContainer< T >::PushBackOrdinal(), SetChanged(), Safir::Dob::Typesystem::DictionaryContainer< KeyT, ValT >::SetChanged(), Safir::Dob::Typesystem::ObjectContainerImpl< T >::SetChanged(), Safir::Dob::Typesystem::ObjectContainerImpl< Object >::SetChanged(), Safir::Dob::Typesystem::GenericObjectSequenceContainer< T >::SetChanged(), Safir::Dob::Typesystem::DictionaryContainerBase::SetChangedHere(), Safir::Dob::Typesystem::ObjectContainerBase::SetChangedHere(), Safir::Dob::Typesystem::GenericObjectSequenceContainer< T >::SetChangedHere(), Safir::Dob::Typesystem::EnumerationContainerBase::SetNull(), Safir::Dob::Typesystem::ObjectContainerImpl< T >::SetNull(), Safir::Dob::Typesystem::ObjectContainerImpl< Object >::SetNull(), Safir::Dob::Typesystem::ValueContainer< T >::SetNull(), Safir::Dob::Typesystem::StringContainer::SetNull(), Safir::Dob::Typesystem::BinaryContainer::SetNull(), Safir::Dob::Typesystem::EnumerationSequenceContainer< T >::SetOrdinal(), Safir::Dob::Typesystem::ObjectContainerImpl< T >::SetPtr(), Safir::Dob::Typesystem::ObjectContainerImpl< Object >::SetPtr(), Safir::Dob::Typesystem::ObjectContainerImpl< T >::SetPtr(), Safir::Dob::Typesystem::BinaryContainer::SetVal(), Safir::Dob::Typesystem::SequenceContainer< T >::SetVal(), Safir::Dob::Typesystem::StringContainer::SetVal(), and Safir::Dob::Typesystem::ValueContainer< T >::SetVal().