![]() |
Safir SDK Core
|
Base class for all Containers. More...
#include <Safir/Dob/Typesystem/ContainerBase.h>
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 | |
ContainerBase & | operator= (const ContainerBase &other) |
Copy assignment operator. | |
Protected Attributes | |
bool | m_bIsChanged |
The variable containing the change flag. | |
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.
|
constexpr |
Default Constructor.
Construct a container that is not changed.
|
constexprdefault |
Copy constructor.
|
virtual |
Virtual destructor.
Needed to ensure proper destruction of Object pointers.
|
pure virtual |
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. |
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::EnumerationSequenceContainer< T >, Safir::Dob::Typesystem::ValueContainer< T >, Safir::Dob::Typesystem::StringContainer, and Safir::Dob::Typesystem::BinaryContainer.
|
virtual |
Is the change flag set on the container?
The change flag gets updated every time the contained value changes.
Note: If this is a container containing objects this call will recursively check change flags in the contained objects.
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.
Referenced by Safir::Dob::Typesystem::IsChanged().
|
pure virtual |
Is the container 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().
|
protected |
Copy assignment operator.
Declared protected to stop incorrect non-virtual assignments (use Copy for virtual assignment).
other | [in] - The object to copy into this. |
References m_bIsChanged.
Referenced by Safir::Dob::Typesystem::ObjectContainerBase::operator=().
|
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.
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.
|
pure virtual |
Set the container 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.
|
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().