Public Types | Public Member Functions | Protected Types | Protected Attributes | Static Protected Attributes | List of all members
ibase::TContainer< ItemClass, ContainerType > Class Template Reference

Common implementation of an abstract container. More...

#include <TContainer.h>

Inheritance diagram for ibase::TContainer< ItemClass, ContainerType >:
istd::IContainerInfo istd::IChangeable istd::IPolymorphic ibase::TSerializableContainer< ItemClass, ContainerType >

Public Types

enum  ChangeFlags { CF_ELEMENT_ADDED = 0x382b230, CF_ELEMENT_REMOVED, CF_RESET }
 
typedef ContainerType Container
 
- Public Types inherited from istd::IChangeable
enum  ChangeFlags {
  CF_ACF_INTERNAL = 0, CF_ALL_DATA, CF_ANY, CF_DESTROYING,
  CF_DELEGATED, CF_NO_UNDO
}
 Data model change notification flags. More...
 
enum  SupportedOperations {
  SO_NONE = 0, SO_OBSERVE = 1 << 0, SO_COPY = 1 << 1, SO_CLONE = 1 << 2,
  SO_COMPARE = 1 << 3, SO_RESET = 1 << 4
}
 Flags for supported operations. More...
 
enum  CompatibilityMode { CM_STRICT, CM_WITHOUT_REFS, CM_WITH_REFS, CM_CONVERT }
 Control how relationship betweeen objects are interpreted. More...
 

Public Member Functions

virtual void Reserve (int count)
 
virtual void Resize (int count)
 
const ItemClass & GetAt (int index) const
 
ItemClass & GetAt (int index)
 
ItemClass & PushBack (const ItemClass &item)
 
ItemClass & PushFront (const ItemClass &item)
 
ItemClass & InsertAt (const ItemClass &item, int index)
 
void PopBack ()
 
void PopFront ()
 
void RemoveAt (int index)
 
virtual void Reset ()
 
TContaineroperator= (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)
 
- Public Member Functions inherited from istd::IChangeable
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 IChangeableCloneMe (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...
 
- Public Member Functions inherited from istd::IPolymorphic
virtual ~IPolymorphic ()
 

Protected Types

typedef ContainerType Items
 

Protected Attributes

Items m_items
 

Static Protected Attributes

static const ChangeSet s_elementAddChange
 
static const ChangeSet s_elementRemoveChange
 
static const ChangeSet s_resetChange
 

Additional Inherited Members

- Static Public Member Functions inherited from istd::IChangeable
static const ChangeSetGetNoChanges ()
 Get empty set of changes. More...
 
static const ChangeSetGetAnyChange ()
 Get anonymous change set. More...
 
static const ChangeSetGetAllChanges ()
 Get anonymous change set. More...
 
static const ChangeSetGetDelegatedChanges ()
 Get delegated change set. More...
 
- Protected Member Functions inherited from istd::IChangeable
virtual void OnBeginChanges ()
 Callback function for begin change event. More...
 
virtual void OnEndChanges (const ChangeSet &changeSet)
 Callback function for end change event. More...
 

Detailed Description

template<typename ItemClass, class ContainerType = QList<ItemClass>>
class ibase::TContainer< ItemClass, ContainerType >

Common implementation of an abstract container.

Definition at line 21 of file TContainer.h.

Member Typedef Documentation

template<typename ItemClass, class ContainerType = QList<ItemClass>>
typedef ContainerType ibase::TContainer< ItemClass, ContainerType >::Container

Definition at line 24 of file TContainer.h.

template<typename ItemClass, class ContainerType = QList<ItemClass>>
typedef ContainerType ibase::TContainer< ItemClass, ContainerType >::Items
protected

Definition at line 61 of file TContainer.h.

Member Enumeration Documentation

template<typename ItemClass, class ContainerType = QList<ItemClass>>
enum ibase::TContainer::ChangeFlags
Enumerator
CF_ELEMENT_ADDED 
CF_ELEMENT_REMOVED 
CF_RESET 

Definition at line 26 of file TContainer.h.

Member Function Documentation

template<typename ItemClass , typename ContainerType >
bool ibase::TContainer< ItemClass, ContainerType >::CopyFrom ( const IChangeable &  object,
CompatibilityMode  mode = CM_WITHOUT_REFS 
)
virtual

Definition at line 222 of file TContainer.h.

References ibase::TContainer< ItemClass, ContainerType >::m_items, and NULL.

template<typename ItemClass , typename ContainerType >
const ItemClass & ibase::TContainer< ItemClass, ContainerType >::GetAt ( int  index) const
template<typename ItemClass , typename ContainerType >
ItemClass & ibase::TContainer< ItemClass, ContainerType >::GetAt ( int  index)
template<typename ItemClass , typename ContainerType >
int ibase::TContainer< ItemClass, ContainerType >::GetItemsCount ( ) const
virtual

Returns number of elements in the container.

Implements istd::IContainerInfo.

Definition at line 199 of file TContainer.h.

template<typename ItemClass, typename ContainerType >
ItemClass & ibase::TContainer< ItemClass, ContainerType >::InsertAt ( const ItemClass &  item,
int  index 
)

Definition at line 124 of file TContainer.h.

template<typename ItemClass , typename ContainerType >
bool ibase::TContainer< ItemClass, ContainerType >::IsEmpty ( ) const
virtual

Returns a true if container is empty, otherwise a false.

Implements istd::IContainerInfo.

Definition at line 206 of file TContainer.h.

template<typename ItemClass , typename ContainerType >
bool ibase::TContainer< ItemClass, ContainerType >::IsIndexValid ( int  index) const
virtual

Implements istd::IContainerInfo.

Definition at line 213 of file TContainer.h.

Referenced by ibase::TContainer< ItemClass, ContainerType >::GetAt().

template<typename ItemClass , typename ContainerType >
TContainer< ItemClass, ContainerType > & ibase::TContainer< ItemClass, ContainerType >::operator= ( const TContainer< ItemClass, ContainerType > &  container)
template<typename ItemClass , typename ContainerType >
void ibase::TContainer< ItemClass, ContainerType >::PopBack ( )

Definition at line 143 of file TContainer.h.

template<typename ItemClass , typename ContainerType >
void ibase::TContainer< ItemClass, ContainerType >::PopFront ( )

Definition at line 153 of file TContainer.h.

template<typename ItemClass, typename ContainerType >
ItemClass & ibase::TContainer< ItemClass, ContainerType >::PushBack ( const ItemClass &  item)

Definition at line 100 of file TContainer.h.

template<typename ItemClass, typename ContainerType >
ItemClass & ibase::TContainer< ItemClass, ContainerType >::PushFront ( const ItemClass &  item)

Definition at line 112 of file TContainer.h.

template<typename ItemClass , typename ContainerType >
void ibase::TContainer< ItemClass, ContainerType >::RemoveAt ( int  index)

Definition at line 163 of file TContainer.h.

template<typename ItemClass , typename ContainerType >
void ibase::TContainer< ItemClass, ContainerType >::Reserve ( int  count)
virtual

Definition at line 70 of file TContainer.h.

template<typename ItemClass , typename ContainerType >
void ibase::TContainer< ItemClass, ContainerType >::Reset ( )
virtual

Definition at line 178 of file TContainer.h.

template<typename ItemClass , typename ContainerType >
void ibase::TContainer< ItemClass, ContainerType >::Resize ( int  count)
virtual

Definition at line 76 of file TContainer.h.

Member Data Documentation

template<typename ItemClass, class ContainerType = QList<ItemClass>>
Items ibase::TContainer< ItemClass, ContainerType >::m_items
protected
template<typename ItemClass, class ContainerType = QList<ItemClass>>
const istd::IChangeable::ChangeSet ibase::TContainer< ItemClass, ContainerType >::s_elementAddChange
staticprotected

Definition at line 57 of file TContainer.h.

template<typename ItemClass, class ContainerType = QList<ItemClass>>
const istd::IChangeable::ChangeSet ibase::TContainer< ItemClass, ContainerType >::s_elementRemoveChange
staticprotected

Definition at line 58 of file TContainer.h.

template<typename ItemClass, class ContainerType = QList<ItemClass>>
const istd::IChangeable::ChangeSet ibase::TContainer< ItemClass, ContainerType >::s_resetChange
staticprotected

Definition at line 59 of file TContainer.h.


The documentation for this class was generated from the following file:

© 2007-2017 Witold Gantzke and Kirill Lepskiy