Safir SDK Core
Loading...
Searching...
No Matches
Safir::Dob::Typesystem::GenericObjectSequenceContainer< T > Class Template Reference

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

Inheritance diagram for Safir::Dob::Typesystem::GenericObjectSequenceContainer< T >:
[legend]
Collaboration diagram for Safir::Dob::Typesystem::GenericObjectSequenceContainer< T >:
[legend]

Public Types

typedef std::shared_ptr< T > T_Ptr
 Typedef for the contained smart pointer.
 
- Public Types inherited from Safir::Dob::Typesystem::SequenceContainer< std::shared_ptr< T > >
typedef T ContainedType
 
typedef std::deque< T > StorageType
 
typedef StorageType::const_iterator const_iterator
 

Public Member Functions

bool IsChanged () const override
 Is the change flag set on the container?
 
bool IsChangedHere () const override
 Is the change flag in the container set?
 
void SetChanged (const bool changed) override
 Set the containers change flag.
 
void SetChangedHere (const bool changed) override
 Set the change flag in the container.
 
size_t size () const override
 Get the size of the sequence, i.e number of contained values.
 
ObjectPtr GetObj (const size_t index) override
 Get a generic pointer to the object at the specified index.
 
ObjectConstPtr GetObj (const size_t index) const override
 Get a const generic pointer to the object at the specified index.
 
T_Ptr GetPtr (const size_t index)
 Get the object at the specified index.
 
ObjectPtr GetObjectPointer (const size_t index) override
 Get a generic pointer to the object at the specified index.
 
std::shared_ptr< const T > GetPtr (const size_t index) const
 Get the object at the specified index, const version.
 
ObjectConstPtr GetObjectPointer (const size_t index) const override
 Get a const generic pointer to the object at the specified index.
 
void SetPtr (const size_t index, const T_Ptr &ptr)
 Set a the object pointer a the specified index.
 
void SetObjectPointer (const size_t index, const ObjectPtr &ptr) override
 Set the smart pointer at a certain index in the container.
 
void PushBackObjectPointer (const ObjectPtr &ptr) override
 Insert a new object last in the sequence.
 
- Public Member Functions inherited from Safir::Dob::Typesystem::SequenceContainer< std::shared_ptr< T > >
 SequenceContainer ()
 Default Constructor.
 
bool IsNull () const override
 Is the container set to null?
 
void SetNull () override
 Set the container to null.
 
size_t size () const
 Get the size of the sequence, i.e number of contained values.
 
bool empty () const
 Check if sequence is empty.
 
const ContainedTypefront () const
 Get a const reference to the first value in the sequence.
 
const ContainedTypeback () const
 Get a const reference to the last value in the sequence.
 
const_iterator begin () const
 Get const_iterator pointing to the first element in the sequence.
 
const_iterator end () const
 Get const_iterator pointing past the last element in the sequence.
 
void clear ()
 Clear the sequence, i.e remove all values.
 
const ContainedTypeoperator[] (const size_t index) const
 Get const reference to the value with specified index.
 
const ContainedTypeat (const size_t index) const
 Get const reference to the value with specified index.
 
void push_back (const ContainedType &val)
 Insert a new value last in the sequence.
 
void SetVal (const size_t index, const ContainedType &val)
 Update a specific value.
 
const ContainedTypeGetVal (const size_t index) const
 Get const reference to the value with specified index.
 
void InsertAt (const size_t index, const ContainedType &value)
 Insert a new value at specified index.
 
void EraseAt (const size_t index)
 Erase a value at specified index.
 
void Copy (const ContainerBase &that) override
 Copy all the members from "that" into "this".
 
- Public Member Functions inherited from Safir::Dob::Typesystem::ContainerBase
constexpr ContainerBase ()
 Default Constructor.
 
constexpr ContainerBase (const ContainerBase &)=default
 Copy constructor.
 
virtual ~ContainerBase ()
 Virtual destructor.
 
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.

Additional Inherited Members

- Protected Member Functions inherited from Safir::Dob::Typesystem::ContainerBase
ContainerBaseoperator= (const ContainerBase &other)
 Copy assignment operator.
 
- Protected Attributes inherited from Safir::Dob::Typesystem::ContainerBase
bool m_bIsChanged
 The variable containing the change flag.
 

Member Typedef Documentation

◆ T_Ptr

template<class T >
typedef std::shared_ptr<T> Safir::Dob::Typesystem::GenericObjectSequenceContainer< T >::T_Ptr

Typedef for the contained smart pointer.

Member Function Documentation

◆ GetObj() [1/2]

template<class T >
ObjectConstPtr Safir::Dob::Typesystem::GenericObjectSequenceContainer< T >::GetObj ( const size_t index) const
overridevirtual

Get a const generic pointer to the object at the specified index.

Note: Unless you know that you need to use the reflection interface you should prefer to use the functions in GenericObjectSequenceContainer.

Indexing outside the sequence provokes undefined behavior.

Parameters
index[in] - The index of the object to get.
Returns
Const pointer to object.
Deprecated
use GetObjectPointer() or GetPtr() instead.

Implements Safir::Dob::Typesystem::GenericObjectSequenceContainerBase.

References Safir::Dob::Typesystem::SequenceContainer< std::shared_ptr< T > >::operator[]().

Here is the call graph for this function:

◆ GetObj() [2/2]

template<class T >
ObjectPtr Safir::Dob::Typesystem::GenericObjectSequenceContainer< T >::GetObj ( const size_t index)
overridevirtual

Get a generic pointer to the object at the specified index.

Note: Unless you know that you need to use the reflection interface you should prefer to use the functions in GenericObjectSequenceContainer.

Indexing outside the sequence provokes undefined behavior.

Parameters
index[in] - The index of the object to get.
Returns
Pointer to object.
Deprecated
use GetObjectPointer() or GetPtr() instead.

Implements Safir::Dob::Typesystem::GenericObjectSequenceContainerBase.

References Safir::Dob::Typesystem::SequenceContainer< std::shared_ptr< T > >::operator[]().

Here is the call graph for this function:

◆ GetObjectPointer() [1/2]

template<class T >
ObjectConstPtr Safir::Dob::Typesystem::GenericObjectSequenceContainer< T >::GetObjectPointer ( const size_t index) const
overridevirtual

Get a const generic pointer to the object at the specified index.

Parameters
index[in] - The index of the object to get.
Returns
Const pointer to object.
Exceptions
std::out_of_rangeexception if index is not in range

Implements Safir::Dob::Typesystem::GenericObjectSequenceContainerBase.

References Safir::Dob::Typesystem::GenericObjectSequenceContainer< T >::GetPtr().

Here is the call graph for this function:

◆ GetObjectPointer() [2/2]

template<class T >
ObjectPtr Safir::Dob::Typesystem::GenericObjectSequenceContainer< T >::GetObjectPointer ( const size_t index)
overridevirtual

Get a generic pointer to the object at the specified index.

Parameters
index[in] - The index of the object to get.
Returns
Pointer to object.
Exceptions
std::out_of_rangeexception if index is not in range

Implements Safir::Dob::Typesystem::GenericObjectSequenceContainerBase.

References Safir::Dob::Typesystem::GenericObjectSequenceContainer< T >::GetPtr().

Here is the call graph for this function:

◆ GetPtr() [1/2]

template<class T >
T_Ptr Safir::Dob::Typesystem::GenericObjectSequenceContainer< T >::GetPtr ( const size_t index)

Get the object at the specified index.

Parameters
index[in] - Index of the value to get.
Returns
Const reference to a value.
Exceptions
std::out_of_rangeexception if index is not in range

References Safir::Dob::Typesystem::SequenceContainer< std::shared_ptr< T > >::at().

Referenced by Safir::Dob::Typesystem::GenericObjectSequenceContainer< T >::GetObjectPointer(), and Safir::Dob::Typesystem::GenericObjectSequenceContainer< T >::GetObjectPointer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetPtr() [2/2]

template<class T >
std::shared_ptr< const T > Safir::Dob::Typesystem::GenericObjectSequenceContainer< T >::GetPtr ( const size_t index) const

Get the object at the specified index, const version.

Parameters
index[in] - Index of the value to get.
Returns
Const reference to a value.
Exceptions
std::out_of_rangeexception if index is not in range

References Safir::Dob::Typesystem::SequenceContainer< std::shared_ptr< T > >::at().

Here is the call graph for this function:

◆ IsChanged()

template<class T >
bool Safir::Dob::Typesystem::GenericObjectSequenceContainer< T >::IsChanged ( ) const
overridevirtual

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.

Returns
True if the containers change flag is set.

Reimplemented from Safir::Dob::Typesystem::ContainerBase.

References Safir::Dob::Typesystem::SequenceContainer< std::shared_ptr< T > >::begin(), Safir::Dob::Typesystem::SequenceContainer< std::shared_ptr< T > >::end(), and Safir::Dob::Typesystem::ContainerBase::m_bIsChanged.

Here is the call graph for this function:

◆ IsChangedHere()

template<class T >
bool Safir::Dob::Typesystem::GenericObjectSequenceContainer< T >::IsChangedHere ( ) const
overridevirtual

Is the change flag in the container set?

This method is like IsChanged without the recursion.

Returns
True if the containers change flag is set.

Implements Safir::Dob::Typesystem::GenericObjectSequenceContainerBase.

References Safir::Dob::Typesystem::ContainerBase::m_bIsChanged.

◆ PushBackObjectPointer()

template<class T >
void Safir::Dob::Typesystem::GenericObjectSequenceContainer< T >::PushBackObjectPointer ( const ObjectPtr & ptr)
overridevirtual

Insert a new object last in the sequence.

If the sequence was null before it will no longer be null after this call. Change flag is updated.

Parameters
ptr[in] - Object to be inserted.

Implements Safir::Dob::Typesystem::GenericObjectSequenceContainerBase.

References __WFILE__, and Safir::Dob::Typesystem::SequenceContainer< std::shared_ptr< T > >::push_back().

Here is the call graph for this function:

◆ SetChanged()

template<class T >
void Safir::Dob::Typesystem::GenericObjectSequenceContainer< T >::SetChanged ( const bool changed)
overridevirtual

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 from Safir::Dob::Typesystem::ContainerBase.

References Safir::Dob::Typesystem::SequenceContainer< std::shared_ptr< T > >::begin(), Safir::Dob::Typesystem::SequenceContainer< std::shared_ptr< T > >::end(), and Safir::Dob::Typesystem::ContainerBase::m_bIsChanged.

Here is the call graph for this function:

◆ SetChangedHere()

template<class T >
void Safir::Dob::Typesystem::GenericObjectSequenceContainer< T >::SetChangedHere ( const bool changed)
overridevirtual

Set the change flag in the container.

This method is like SetChanged without the recursion

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

Implements Safir::Dob::Typesystem::GenericObjectSequenceContainerBase.

References Safir::Dob::Typesystem::ContainerBase::m_bIsChanged.

◆ SetObjectPointer()

template<class T >
void Safir::Dob::Typesystem::GenericObjectSequenceContainer< T >::SetObjectPointer ( const size_t index,
const ObjectPtr & ptr )
overridevirtual

Set the smart pointer at a certain index in the container.

This method will set the contained pointer to point to another object. Change flag is updated.

Parameters
ptr[in] A pointer to the new object to point to.
index[in] - The index of the object to set.
Exceptions
std::out_of_rangeexception if index is not in range

Implements Safir::Dob::Typesystem::GenericObjectSequenceContainerBase.

References __WFILE__, and Safir::Dob::Typesystem::GenericObjectSequenceContainer< T >::SetPtr().

Here is the call graph for this function:

◆ SetPtr()

template<class T >
void Safir::Dob::Typesystem::GenericObjectSequenceContainer< T >::SetPtr ( const size_t index,
const T_Ptr & ptr )

Set a the object pointer a the specified index.

Parameters
index[in] - Index of the object to set.
ptr[in] - Object to set.
Exceptions
std::out_of_rangeexception if index is not in range

References Safir::Dob::Typesystem::SequenceContainer< std::shared_ptr< T > >::SetVal().

Referenced by Safir::Dob::Typesystem::GenericObjectSequenceContainer< T >::SetObjectPointer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ size()

template<class T >
size_t Safir::Dob::Typesystem::GenericObjectSequenceContainer< T >::size ( ) const
overridevirtual

Get the size of the sequence, i.e number of contained values.

Returns
The number of values in the sequence.

Implements Safir::Dob::Typesystem::GenericObjectSequenceContainerBase.

References Safir::Dob::Typesystem::SequenceContainer< std::shared_ptr< T > >::size().

Here is the call graph for this function: