Specific container implementation for factorisable items. More...
#include <TFactorisableContainer.h>
Public Member Functions | |
TFactorisableContainer () | |
virtual | ~TFactorisableContainer () |
InterfaceClass * | InsertElement (int index, const QByteArray &elementFactoryKey) |
Insert an element into the container at given index. More... | |
InterfaceClass * | AddElement (const QByteArray &elementFactoryKey) |
Add an element to the container. More... | |
InterfaceClass * | GetElement (int elementIndex) const |
Gets an element with given index elementIndex from the container. More... | |
int | GetElementIndex (const InterfaceClass &elementRef) const |
Gets the index of given element from the container. More... | |
QByteArray | GetElementKey (int elementIndex) const |
Gets the element key associated with the element with given elementIndex from the container. More... | |
void | RegisterItemFactory (istd::TIFactory< InterfaceClass > *itemFactoryPtr) |
bool | Serialize (iser::IArchive &archive) |
Load or store state of this object as a archive stream. More... | |
![]() | |
virtual void | Reserve (int count) |
virtual void | Resize (int count) |
const QPair< istd::TSmartPtr < InterfaceClass >, QByteArray > & | GetAt (int index) const |
QPair< istd::TSmartPtr < InterfaceClass >, QByteArray > & | GetAt (int index) |
QPair< istd::TSmartPtr < InterfaceClass >, QByteArray > & | PushBack (const QPair< istd::TSmartPtr< InterfaceClass >, QByteArray > &item) |
QPair< istd::TSmartPtr < InterfaceClass >, QByteArray > & | PushFront (const QPair< istd::TSmartPtr< InterfaceClass >, QByteArray > &item) |
QPair< istd::TSmartPtr < InterfaceClass >, QByteArray > & | InsertAt (const QPair< istd::TSmartPtr< InterfaceClass >, QByteArray > &item, int index) |
void | PopBack () |
void | PopFront () |
void | RemoveAt (int index) |
virtual void | Reset () |
TContainer & | operator= (const TContainer &container) |
virtual int | GetItemsCount () const |
Returns number of elements in the container. More... | |
virtual bool | IsEmpty () const |
Returns a true if container is empty, otherwise a false . More... | |
virtual bool | IsIndexValid (int index) const |
virtual bool | CopyFrom (const IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS) |
![]() | |
virtual int | GetSupportedOperations () const |
Get set of flags for supported operations. More... | |
virtual bool | CopyFrom (const IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS) |
Copy this object from another one. More... | |
virtual bool | IsEqual (const IChangeable &object) const |
Compare this object with another object. More... | |
virtual IChangeable * | CloneMe (CompatibilityMode mode=CM_WITHOUT_REFS) const |
Make a copy of this object. More... | |
virtual bool | ResetData (CompatibilityMode mode=CM_WITHOUT_REFS) |
Reset data to its default state. More... | |
virtual void | BeginChanges (const ChangeSet &changeSet) |
Starts the change transaction. More... | |
virtual void | EndChanges (const ChangeSet &changeSet) |
Ends the change transaction. More... | |
virtual void | BeginChangeGroup (const ChangeSet &changeSet) |
Starts group of changes. More... | |
virtual void | EndChangeGroup (const ChangeSet &changeSet) |
Ends group of changes. More... | |
![]() | |
virtual | ~IPolymorphic () |
![]() | |
virtual quint32 | GetMinimalVersion (int versionId) const |
Get minimal needed version to correct storing of this data. More... | |
Protected Member Functions | |
virtual InterfaceClass * | CreateElement (const QByteArray &itemKey) |
virtual void | OnElementCreated (InterfaceClass *elementPtr) |
virtual bool | SerializeItem (ItemClass &item, iser::IArchive &archive) |
Serialize a single item in the container. More... | |
![]() | |
virtual void | OnBeginChanges () |
Callback function for begin change event. More... | |
virtual void | OnEndChanges (const ChangeSet &changeSet) |
Callback function for end change event. More... | |
Protected Attributes | |
istd::TIFactory< InterfaceClass > * | m_itemFactoryPtr |
![]() | |
Items | m_items |
Specific container implementation for factorisable items.
This container implementation supports following features:
Definition at line 26 of file TFactorisableContainer.h.
typedef ibase::TSerializableContainer<ItemClass> ibase::TFactorisableContainer< InterfaceClass >::BaseClass |
Definition at line 32 of file TFactorisableContainer.h.
typedef QPair<istd::TSmartPtr<InterfaceClass>, QByteArray> ibase::TFactorisableContainer< InterfaceClass >::ItemClass |
Definition at line 31 of file TFactorisableContainer.h.
ibase::TFactorisableContainer< InterfaceClass >::TFactorisableContainer | ( | ) |
Definition at line 82 of file TFactorisableContainer.h.
References NULL.
|
virtual |
Definition at line 89 of file TFactorisableContainer.h.
InterfaceClass * ibase::TFactorisableContainer< InterfaceClass >::AddElement | ( | const QByteArray & | elementFactoryKey | ) |
Add an element to the container.
Definition at line 96 of file TFactorisableContainer.h.
References istd::TTransPtr< Type >::GetPtr(), and istd::TTransPtr< Type >::IsValid().
|
protectedvirtual |
Definition at line 228 of file TFactorisableContainer.h.
References NULL.
InterfaceClass * ibase::TFactorisableContainer< InterfaceClass >::GetElement | ( | int | elementIndex | ) | const |
Gets an element with given index elementIndex
from the container.
You will need this function, because the GetAt() returns an ItemClass instance, which is not usable.
Definition at line 120 of file TFactorisableContainer.h.
References NULL.
int ibase::TFactorisableContainer< InterfaceClass >::GetElementIndex | ( | const InterfaceClass & | elementRef | ) | const |
Gets the index of given element from the container.
Definition at line 131 of file TFactorisableContainer.h.
QByteArray ibase::TFactorisableContainer< InterfaceClass >::GetElementKey | ( | int | elementIndex | ) | const |
Gets the element key associated with the element with given elementIndex
from the container.
Definition at line 145 of file TFactorisableContainer.h.
InterfaceClass * ibase::TFactorisableContainer< InterfaceClass >::InsertElement | ( | int | index, |
const QByteArray & | elementFactoryKey | ||
) |
Insert an element into the container at given index.
Definition at line 108 of file TFactorisableContainer.h.
References istd::TTransPtr< Type >::GetPtr(), and istd::TTransPtr< Type >::IsValid().
|
protectedvirtual |
Definition at line 252 of file TFactorisableContainer.h.
void ibase::TFactorisableContainer< InterfaceClass >::RegisterItemFactory | ( | istd::TIFactory< InterfaceClass > * | itemFactoryPtr | ) |
Definition at line 156 of file TFactorisableContainer.h.
|
virtual |
Load or store state of this object as a archive stream.
Type of operation is depending on archive type.
Reimplemented from ibase::TSerializableContainer< QPair< istd::TSmartPtr< InterfaceClass >, QByteArray > >.
Definition at line 165 of file TFactorisableContainer.h.
References iser::IArchive::BeginMultiTag(), iser::IArchive::BeginTag(), iser::IArchive::EndTag(), istd::IChangeable::GetAllChanges(), iser::IArchive::IsStoring(), NULL, iser::IArchive::Process(), iser::CArchiveTag::TT_GROUP, iser::CArchiveTag::TT_LEAF, and iser::CArchiveTag::TT_MULTIPLE.
|
protectedvirtual |
Serialize a single item in the container.
Implements ibase::TSerializableContainer< QPair< istd::TSmartPtr< InterfaceClass >, QByteArray > >.
Definition at line 260 of file TFactorisableContainer.h.
References NULL, and iser::ISerializable::Serialize().
|
protected |
Definition at line 77 of file TFactorisableContainer.h.
© 2007-2017 Witold Gantzke and Kirill Lepskiy