![]() |
Safir SDK Core
|
Base class for all object containers. More...
#include <Safir/Dob/Typesystem/ObjectContainer.h>
Public Member Functions | |
ObjectContainerBase () | |
Default constructor. | |
ObjectContainerBase (const ObjectContainerBase &)=default | |
Copy constructor. | |
virtual void | SetPtr (const ObjectPtr &ptr)=0 |
Set the smart pointer in the container. | |
bool | IsChangedHere () const |
Is the change flag in the container set? | |
void | SetChangedHere (const bool changed) |
Set the change flag in the container. | |
Reflection part. | |
These methods allow applications to manipulate the members of objects without having been compiled against it. There should be no reason for most applications to use these methods. | |
virtual ContainerBase & | GetMember (const int member, const int index)=0 |
Get a reference to a member container from an object. | |
virtual const ContainerBase & | GetMember (const int member, const int index) const =0 |
Get a const reference to a member container from an object. | |
virtual const ObjectPtr | GetObjectPointer () const =0 |
Get a smart pointer to the contained object. | |
virtual void | SetObjectPointer (const ObjectPtr ptr)=0 |
Set the smart pointer in the container. | |
virtual void | ResetObjectPointer ()=0 |
Reset (ie set to null) the contained pointer. | |
![]() | |
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 | |
ObjectContainerBase & | operator= (const ObjectContainerBase &other) |
Copy assignment operator. | |
![]() | |
ContainerBase & | operator= (const ContainerBase &other) |
Copy assignment operator. | |
Friends | |
class | Safir::Dob::Typesystem::Internal::BlobOperations |
Additional Inherited Members | |
![]() | |
bool | m_bIsChanged |
The variable containing the change flag. | |
Base class for all object containers.
The reason for the existence of this class is that code that uses the reflection functionality must be able to get hold of members of items.
Safir::Dob::Typesystem::ObjectContainerBase::ObjectContainerBase | ( | ) |
Default constructor.
|
default |
Copy constructor.
|
pure virtual |
Get a const reference to a member container from an object.
Use the methods in Members to get member indices and array sizes for use with this method.
Note: Do not use this method unless you're very sure it is the one you need!
member | [in] - The index of the member to get. |
index | [in] - The array index of the member to get. |
IllegalValueException | If the index is not in the range of the array. |
SoftwareViolationException | If the element is not an array and the index is not 0. |
Implemented in 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 >, and Safir::Dob::Typesystem::ObjectContainerImpl< Object >.
|
pure virtual |
Get a reference to a member container from an object.
Use the methods in Members to get member indices and array sizes for use with this method.
Note: Do not use this method unless you're very sure it is the one you need!
member | [in] - The index of the member to get. |
index | [in] - The array index of the member to get. |
IllegalValueException | If the index is not in the range of the array. |
SoftwareViolationException | If the element is not an array and the index is not 0. |
Implemented in 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 >, and Safir::Dob::Typesystem::ObjectContainerImpl< Object >.
|
pure virtual |
Get a smart pointer to the contained object.
This method will cast the smart object pointer to the derived type contained by the container to a smart pointer to an Object (the DOB object base class.
This method does not check if the container is null!
Note: Do not use this method unless you're very sure it is the one you need!
Implemented in Safir::Dob::Typesystem::ObjectContainerImpl< T >, Safir::Dob::Typesystem::ObjectContainerImpl< ClassType >, Safir::Dob::Typesystem::ObjectContainerImpl< Entity >, Safir::Dob::Typesystem::ObjectContainerImpl< Safir::Dob::Typesystem::Object >, and Safir::Dob::Typesystem::ObjectContainerImpl< U >.
bool Safir::Dob::Typesystem::ObjectContainerBase::IsChangedHere | ( | ) | const |
Is the change flag in the container set?
This method is like IsChanged without the recursion (on object containers IsChanged is recursive).
References Safir::Dob::Typesystem::ContainerBase::m_bIsChanged.
|
protected |
Copy assignment operator.
other | [in] - The object to copy. |
References Safir::Dob::Typesystem::ContainerBase::operator=().
Referenced by Safir::Dob::Typesystem::ObjectContainerImpl< T >::operator=(), and Safir::Dob::Typesystem::ObjectContainerImpl< Object >::operator=().
|
pure virtual |
Reset (ie set to null) the contained pointer.
Warning: This method does not update the change flag!
Note: Do not use this method unless you're very sure it is the one you need!
Implemented in Safir::Dob::Typesystem::ObjectContainerImpl< T >, Safir::Dob::Typesystem::ObjectContainerImpl< ClassType >, Safir::Dob::Typesystem::ObjectContainerImpl< Entity >, Safir::Dob::Typesystem::ObjectContainerImpl< Safir::Dob::Typesystem::Object >, and Safir::Dob::Typesystem::ObjectContainerImpl< U >.
void Safir::Dob::Typesystem::ObjectContainerBase::SetChangedHere | ( | const bool | changed | ) |
Set the change flag in the container.
This method is like SetChanged without the recursion (on object containers SetChanged is recursive).
changed | [in] - The value to set the change flag to. |
References Safir::Dob::Typesystem::ContainerBase::m_bIsChanged.
|
pure virtual |
Set the smart pointer in the container.
This method will set the contained pointer to point to another object. Checks are NOT always made to see that it is of the correct type.
Warning: This method does not update the change flag!
Note: Do not use this method unless you're very sure it is the one you need!
ptr | [in] A pointer to the new object to point to. |
Implemented in Safir::Dob::Typesystem::ObjectContainerImpl< T >, Safir::Dob::Typesystem::ObjectContainerImpl< ClassType >, Safir::Dob::Typesystem::ObjectContainerImpl< Entity >, Safir::Dob::Typesystem::ObjectContainerImpl< Safir::Dob::Typesystem::Object >, and Safir::Dob::Typesystem::ObjectContainerImpl< U >.
|
pure virtual |
Set the smart pointer in the container.
This method will set the contained pointer to point to another object. Checks are always made to see that it is of the correct type. The change flag of the container will be updated.
ptr | [in] A pointer to the new object to point to. |
IncompatibleTypesException | If the ptr is not of the type contained by the container. |
Implemented in 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 >, and Safir::Dob::Typesystem::ObjectContainerImpl< Object >.
|
friend |