24#ifndef __DOTS_OBJECT_CONTAINER_H__
25#define __DOTS_OBJECT_CONTAINER_H__
216 m_pObject = std::dynamic_pointer_cast<T>(other.m_pObject->Clone());
217 if (m_pObject == NULL)
240 m_pObject = std::dynamic_pointer_cast<T>(other.m_pObject->Clone());
241 if (m_pObject == NULL)
267 m_pObject = std::dynamic_pointer_cast<T>(ptr);
268 if (m_pObject == NULL)
303 bool IsNull()
const override {
return m_pObject == NULL;}
315 if (
typeid(*
this) !=
typeid(that))
359 m_pObject = std::dynamic_pointer_cast<T>(ptr);
360 if(m_pObject == NULL)
365 m_pObject = std::static_pointer_cast<T>(ptr);
384 typedef std::shared_ptr<Object>
T_Ptr;
407 m_pObject = other.m_pObject->Clone();
426 m_pObject = other.m_pObject->Clone();
471 return m_pObject.operator->();
479 m_pObject->SetChanged(changed);
485 bool IsNull()
const override {
return m_pObject == NULL;}
497 if (
typeid(*
this) !=
typeid(that))
#define __WFILE__
Definition Exceptions.h:31
This namespace contains all the functionality and definitions of the SAFIR SDK.
Definition Backdoor.h:31
DotsC_Int32 Int32
32 bit integer type.
Definition Defs.h:66
Safir::Dob::Typesystem::ObjectContainerImpl< Object > ObjectContainer
Container for DOB Objects.
Definition ObjectContainer.h:540
std::shared_ptr< Object > ObjectPtr
A smart pointer to an Object.
Definition Object.h:44
Base class for all Containers.
Definition ContainerBase.h:44
bool m_bIsChanged
The variable containing the change flag.
Definition ContainerBase.h:127
virtual bool IsNull() const =0
Is the container set to null?
ContainerBase & operator=(const ContainerBase &other)
Copy assignment operator.
Definition ContainerBase.h:121
This exception is thrown if a class cannot be cast to the expected type.
Definition Exceptions.h:297
Meant to be used when something goes very wrong.
Definition Exceptions.h:364
Thrown when an application attempts to get the value of a member that is null.
Definition Exceptions.h:396
The base class for all DOB objects.
Definition Object.h:55
Base class for all object containers.
Definition ObjectContainer.h:45
void SetChangedHere(const bool changed)
Set the change flag in the container.
Definition ObjectContainer.h:82
virtual ContainerBase & GetMember(const int member, const int index)=0
Get a reference to a member container from an object.
virtual void ResetObjectPointer()=0
Reset (ie set to null) the contained pointer.
friend class Safir::Dob::Typesystem::Internal::BlobOperations
Definition ObjectContainer.h:164
virtual const ObjectPtr GetObjectPointer() const =0
Get a smart pointer to the contained object.
bool IsChangedHere() const
Is the change flag in the container set?
Definition ObjectContainer.h:73
virtual const ContainerBase & GetMember(const int member, const int index) const =0
Get a const reference to a member container from an object.
ObjectContainerBase()
Default constructor.
Definition ObjectContainer.h:48
virtual void SetPtr(const ObjectPtr &ptr)=0
Set the smart pointer in the container.
ObjectContainerBase(const ObjectContainerBase &)=default
Copy constructor.
ObjectContainerBase & operator=(const ObjectContainerBase &other)
Copy assignment operator.
Definition ObjectContainer.h:172
virtual void SetObjectPointer(const ObjectPtr ptr)=0
Set the smart pointer in the container.
Template class for all containers of automatically generated DOB objects.
Definition ObjectContainer.h:190
void SetObjectPointer(const ObjectPtr ptr) override
Set the smart pointer in the container.
Definition ObjectContainer.h:356
Int32 CalculateBlobSize() const
Calculate the size of the blob-serialized form of the contained object.
Definition ObjectContainer.h:351
void ResetObjectPointer() override
Reset (ie set to null) the contained pointer.
Definition ObjectContainer.h:368
void SetPtr(const ObjectPtr &ptr) override
Set the smart pointer in the container.
Definition ObjectContainer.h:264
void SetChanged(const bool changed) override
Set the containers change flag.
Definition ObjectContainer.h:299
ContainerBase & GetMember(const int member, const int index) override
Get a reference to a member container from an object.
Definition ObjectContainer.h:333
T_Ptr ContainedType
Definition ObjectContainer.h:194
bool IsNull() const override
Is the container set to null?
Definition ObjectContainer.h:303
const ObjectPtr GetObjectPointer() const override
Get a smart pointer to the contained object.
Definition ObjectContainer.h:355
ObjectContainerImpl & operator=(const ObjectContainerImpl &other)
Copy assignment operator.
Definition ObjectContainer.h:231
const T_Ptr & GetPtr() const
Get the smart pointer from the container.
Definition ObjectContainer.h:283
const ContainerBase & GetMember(const int member, const int index) const override
Get a const reference to a member container from an object.
Definition ObjectContainer.h:335
T * operator->() const
Dereference the smart pointer in the container.
Definition ObjectContainer.h:295
ObjectContainerImpl(const ObjectContainerImpl &other)
Copy constructor.
Definition ObjectContainer.h:211
void Copy(const ContainerBase &that) override
Virtual assignment.
Definition ObjectContainer.h:311
bool IsChanged() const override
Is the change flag set on the container?
Definition ObjectContainer.h:301
void SetNull() override
Set the container to null.
Definition ObjectContainer.h:305
ObjectContainerImpl()
Default constructor.
Definition ObjectContainer.h:201
std::shared_ptr< T > T_Ptr
Typedef for the contained smart pointer.
Definition ObjectContainer.h:193
void SetPtr(const T_Ptr &ptr)
Set the smart pointer in the container.
Definition ObjectContainer.h:258
ObjectContainerImpl & operator=(const ObjectContainerImpl &other)
Copy assignment operator.
Definition ObjectContainer.h:417
const T_Ptr & GetPtr() const
Get the smart pointer from the container.
Definition ObjectContainer.h:447
Object * operator->() const
Dereference the smart pointer in the container.
Definition ObjectContainer.h:465
void SetChanged(const bool changed) override
Set the containers change flag.
Definition ObjectContainer.h:474
ContainerBase & GetMember(const int member, const int index) override
Get a reference to a member container from an object.
Definition ObjectContainer.h:515
void SetPtr(const ObjectPtr &ptr) override
Set the smart pointer in the container.
Definition ObjectContainer.h:432
ObjectContainerImpl()
Default constructor.
Definition ObjectContainer.h:392
T_Ptr ContainedType
Definition ObjectContainer.h:385
bool IsChanged() const override
Is the change flag set on the container?
Definition ObjectContainer.h:483
bool IsNull() const override
Is the container set to null?
Definition ObjectContainer.h:485
void Copy(const ContainerBase &that) override
Virtual assignment.
Definition ObjectContainer.h:493
std::shared_ptr< Object > T_Ptr
Typedef for the contained smart pointer.
Definition ObjectContainer.h:384
ObjectContainerImpl(const ObjectContainerImpl &other)
Copy constructor.
Definition ObjectContainer.h:402
void SetNull() override
Set the container to null.
Definition ObjectContainer.h:487
const ContainerBase & GetMember(const int member, const int index) const override
Get a const reference to a member container from an object.
Definition ObjectContainer.h:517