Public Member Functions | Static Public Member Functions | Protected Types | Protected Attributes | List of all members
ilog::CMessageContainer Class Reference

Basic implementation of a message container. More...

#include <CMessageContainer.h>

Inheritance diagram for ilog::CMessageContainer:
istd::THierarchicalBase< IHierarchicalMessageContainer > ilog::IMessageConsumer istd::TChangeDelegator< IHierarchicalMessageContainer > istd::IPolymorphic istd::CChangeDelegator istd::IChangeDelegator istd::IChangeable istd::IPolymorphic ilog::CLogComp iloggui::CLogGuiComp

Public Member Functions

 CMessageContainer ()
 
 CMessageContainer (const CMessageContainer &container)
 
int GetMessagesCount () const
 Get the number of messages in the container. More...
 
virtual void AddChildContainer (IHierarchicalMessageContainer *childContainerPtr)
 Add a child message container to this object. More...
 
void SetSlaveConsumer (ilog::IMessageConsumer *consumerPtr)
 Set slave message consumer. More...
 
void SetMaxMessageCount (int maxMessageCount=-1)
 Set maximal number of messages in the container. More...
 
virtual bool Serialize (iser::IArchive &archive)
 
virtual int GetWorstCategory () const
 
virtual Messages GetMessages () const
 
virtual void ClearMessages ()
 
virtual bool IsMessageSupported (int messageCategory=-1, int messageId=-1, const istd::IInformationProvider *messagePtr=NULL) const
 Check if some messge is supported. More...
 
virtual void AddMessage (const IMessageConsumer::MessagePtr &messagePtr)
 Adds a message item to the container. More...
 
virtual int GetChildsCount () const
 
virtual
IHierarchicalMessageContainer
GetChild (int index) const
 
virtual int GetSupportedOperations () const
 Get set of flags for supported operations. More...
 
virtual bool CopyFrom (const istd::IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS)
 Copy this object from another one. More...
 
virtual bool IsEqual (const istd::IChangeable &object) const
 Compare this object with another object. More...
 
virtual istd::IChangeableCloneMe (CompatibilityMode mode=CM_WITHOUT_REFS) const
 Make a copy of this object. More...
 
virtual bool ResetData (CompatibilityMode mode)
 Reset data to its default state. More...
 
- Public Member Functions inherited from istd::THierarchicalBase< IHierarchicalMessageContainer >
 THierarchicalBase ()
 
virtual void SetParentPtr (typename IHierarchicalMessageContainer::InterfaceType *parentPtr)
 
virtual int GetHierarchicalFlags () const
 
virtual typename
IHierarchicalMessageContainer::InterfaceType * 
GetParent () const
 
- Public Member Functions inherited from istd::TChangeDelegator< IHierarchicalMessageContainer >
 TChangeDelegator ()
 
 TChangeDelegator (istd::IChangeable *slavePtr)
 
virtual void OnBeginChanges ()
 Callback function for begin change event. More...
 
virtual void OnEndChanges (const istd::IChangeable::ChangeSet &changeSet)
 Callback function for end change event. More...
 
- Public Member Functions inherited from istd::CChangeDelegator
 CChangeDelegator ()
 
 CChangeDelegator (istd::IChangeable *slavePtr)
 
virtual void SetSlavePtr (istd::IChangeable *slavePtr)
 Gets the slave object pointer. More...
 
virtual istd::IChangeableGetSlavePtr () const
 Sets the slave object pointer. More...
 
- Public Member Functions inherited from istd::IChangeable
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 ()
 

Static Public Member Functions

template<typename MessageType >
static bool RegisterMessageType (const QByteArray &messageTypeId=QByteArray())
 Register a new message type. More...
 
- 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 Types

typedef QVector
< IHierarchicalMessageContainer * > 
Childs
 

Protected Attributes

Messages m_messages
 
Childs m_childContainers
 
ilog::IMessageConsumerm_slaveConsumerPtr
 
int m_maxMessagesCount
 
int m_worstCategory
 
- Protected Attributes inherited from istd::THierarchicalBase< IHierarchicalMessageContainer >
typename
IHierarchicalMessageContainer::InterfaceType * 
m_parentPtr
 

Additional Inherited Members

- Public Types inherited from istd::THierarchicalBase< IHierarchicalMessageContainer >
typedef istd::TChangeDelegator
< IHierarchicalMessageContainer > 
BaseClass
 
- Public Types inherited from istd::TChangeDelegator< IHierarchicalMessageContainer >
typedef
IHierarchicalMessageContainer 
BaseClass
 
typedef CChangeDelegator BaseClass2
 
- Public Types inherited from istd::CChangeDelegator
typedef istd::IChangeable BaseClass
 
- 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 Types inherited from ilog::IMessageConsumer
typedef istd::TSmartPtr< const
istd::IInformationProvider
MessagePtr
 

Detailed Description

Basic implementation of a message container.

Definition at line 29 of file CMessageContainer.h.

Member Typedef Documentation

Definition at line 103 of file CMessageContainer.h.

Constructor & Destructor Documentation

ilog::CMessageContainer::CMessageContainer ( )
ilog::CMessageContainer::CMessageContainer ( const CMessageContainer container)

Member Function Documentation

virtual void ilog::CMessageContainer::AddChildContainer ( IHierarchicalMessageContainer childContainerPtr)
virtual

Add a child message container to this object.

GetMessages returns messages from this container and all its children.

virtual void ilog::CMessageContainer::AddMessage ( const IMessageConsumer::MessagePtr messagePtr)
virtual

Adds a message item to the container.

Implements ilog::IMessageConsumer.

Reimplemented in iloggui::CLogGuiComp, and ilog::CLogComp.

virtual void ilog::CMessageContainer::ClearMessages ( )
virtual

Reimplemented in iloggui::CLogGuiComp.

virtual istd::IChangeable* ilog::CMessageContainer::CloneMe ( CompatibilityMode  mode = CM_WITHOUT_REFS) const
virtual

Make a copy of this object.

Returns
new instance or NULL, if this operation is not supported.

Reimplemented from istd::IChangeable.

virtual bool ilog::CMessageContainer::CopyFrom ( const istd::IChangeable object,
CompatibilityMode  mode = CM_WITHOUT_REFS 
)
virtual

Copy this object from another one.

Default implementation in istd::IChangeable does nothing.

Reimplemented from istd::IChangeable.

virtual IHierarchicalMessageContainer* ilog::CMessageContainer::GetChild ( int  index) const
virtual
virtual int ilog::CMessageContainer::GetChildsCount ( ) const
virtual
virtual Messages ilog::CMessageContainer::GetMessages ( ) const
virtual
int ilog::CMessageContainer::GetMessagesCount ( ) const

Get the number of messages in the container.

Note
Messages in the child containers are not involved in the calculation.
virtual int ilog::CMessageContainer::GetSupportedOperations ( ) const
virtual

Get set of flags for supported operations.

See Also
SupportedOperations

Reimplemented from istd::IChangeable.

virtual int ilog::CMessageContainer::GetWorstCategory ( ) const
virtual
virtual bool ilog::CMessageContainer::IsEqual ( const istd::IChangeable object) const
virtual

Compare this object with another object.

Parameters
objectObject to be compared
Returns
true if the objects are identical and false otherwise.

Reimplemented from istd::IChangeable.

virtual bool ilog::CMessageContainer::IsMessageSupported ( int  messageCategory = -1,
int  messageId = -1,
const istd::IInformationProvider messagePtr = NULL 
) const
virtual

Check if some messge is supported.

Parameters
messageCategorycategory of message or -1 if undefined,
See Also
istd::IInformationProvider::InformationCategory.
Parameters
messageIdID of message as defined in istd::IInformationProvider or -1 if undefined.
messagePtroptional message object, or NULL if undefined. Please note, this object will not be stored by receiver.

Implements ilog::IMessageConsumer.

Reimplemented in iloggui::CLogGuiComp, and ilog::CLogComp.

template<typename MessageType >
bool ilog::CMessageContainer::RegisterMessageType ( const QByteArray &  messageTypeId = QByteArray())
static

Register a new message type.

Only messages of known (registered) types can be serialized.

Definition at line 115 of file CMessageContainer.h.

References istd::TComposedFactory< InterfaceType >::RegisterFactory().

virtual bool ilog::CMessageContainer::ResetData ( CompatibilityMode  mode)
virtual

Reset data to its default state.

Default implementation in istd::IChangeable does nothing.

Returns
true if the operation was successful, and false otherwise.

Reimplemented from istd::IChangeable.

virtual bool ilog::CMessageContainer::Serialize ( iser::IArchive archive)
virtual
void ilog::CMessageContainer::SetMaxMessageCount ( int  maxMessageCount = -1)

Set maximal number of messages in the container.

If the container is full and a new message is added, the oldest message will be removed.

Parameters
maxMessageCountmaximal number of messages in the container. If the value equals -1, no limit is set for.
void ilog::CMessageContainer::SetSlaveConsumer ( ilog::IMessageConsumer consumerPtr)

Set slave message consumer.

All incoming messages will be delegated to this object.

Member Data Documentation

Childs ilog::CMessageContainer::m_childContainers
protected

Definition at line 104 of file CMessageContainer.h.

int ilog::CMessageContainer::m_maxMessagesCount
protected

Definition at line 107 of file CMessageContainer.h.

Messages ilog::CMessageContainer::m_messages
protected

Definition at line 101 of file CMessageContainer.h.

ilog::IMessageConsumer* ilog::CMessageContainer::m_slaveConsumerPtr
protected

Definition at line 106 of file CMessageContainer.h.

int ilog::CMessageContainer::m_worstCategory
mutableprotected

Definition at line 108 of file CMessageContainer.h.


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

© 2007-2017 Witold Gantzke and Kirill Lepskiy