Ceylan::Log::ObjectChannel Class Reference

ObjectChannels correspond to log channels dedicated to a Ceylan object. More...

#include <CeylanObjectChannel.h>

Inheritance diagram for Ceylan::Log::ObjectChannel:

Inheritance graph
[legend]
Collaboration diagram for Ceylan::Log::ObjectChannel:

Collaboration graph
[legend]

List of all members.

Public Types

enum  TextOutputFormat { rawText, html }
 Defines what text output formats for TextDisplayable instances are available. More...

Public Member Functions

 ObjectChannel (const std::string &channelName)
 Creates a named Log channel.
virtual ~ObjectChannel () throw ()
 Basic virtual destructor.
virtual void addMessage (LogMessage &message, bool check=true)
 Add a new Log message to this channel.
virtual ObjectIdentifiergetObjectIdentifier () const
 Returns this ObjectChannel's Object identifier.
virtual const std::string toString (Ceylan::VerbosityLevels level=Ceylan::high) const
 Returns a user-friendly description of the state of this object.
virtual const std::string getName () const
 Returns this channel's name.
virtual MessageCount getMessageCount () const
 Returns the number of messages this channel currently gathered.

Static Public Member Functions

static const std::string ToString (std::list< TextDisplayable * > displayables, Ceylan::VerbosityLevels level=Ceylan::high)
 Returns a user-friendly description of this list of pointers to text displayable instances.
static TextOutputFormat GetOutputFormat ()
 Returns the current overall text format to be used by TextDisplayable instances.
static void SetOutputFormat (TextOutputFormat newOutputFormat)
 Sets the current overall text format to be used by TextDisplayable instances.

Protected Attributes

ObjectIdentifier_linkedObjectID
 This is the identifier of the Ceylan object this ObjectChannel corresponds to.
std::string _name
 This channel's name.
std::list< LogMessage * > _messages
 Chronologically-ordered set of messages for this Log channel.

Static Protected Attributes

static TextOutputFormat _OutputFormat = rawText
 The text format to be used currently by TextDisplayable instances.

Private Member Functions

 ObjectChannel (const ObjectChannel &source)
 Copy constructor made private to ensure that it will be never called.
ObjectChanneloperator= (const ObjectChannel &source)
 Assignment operator made private to ensure that it will be never called.


Detailed Description

ObjectChannels correspond to log channels dedicated to a Ceylan object.

Each ObjectChannel owns an ObjectIdentifier that matches the one of its corresponding Ceylan object.

See also:
Object

Definition at line 63 of file CeylanObjectChannel.h.


Member Enumeration Documentation

Defines what text output formats for TextDisplayable instances are available.

Enumerator:
rawText 
html 

Definition at line 124 of file CeylanTextDisplayable.h.


Constructor & Destructor Documentation

ObjectChannel::ObjectChannel ( const std::string &  channelName  )  [explicit]

Creates a named Log channel.

Parameters:
channelName is the name of the channel carried by the log message from which this ObjectChannel is spawned.
Exceptions:
LogException if the creation failed.

Definition at line 50 of file CeylanObjectChannel.cc.

References _linkedObjectID, Ceylan::Log::LogChannel::_name, CEYLAN_LOG, dataUtils::e, Ceylan::Log::ObjectIdentifier::generateFromChannelName(), Ceylan::Log::ObjectIdentifier::toString(), Ceylan::Exception::toString(), and Ceylan::toString().

ObjectChannel::~ObjectChannel (  )  throw () [virtual]

Ceylan::Log::ObjectChannel::ObjectChannel ( const ObjectChannel source  )  [private]

Copy constructor made private to ensure that it will be never called.

The compiler should complain whenever this undefined constructor is called, implicitly or not.


Member Function Documentation

void ObjectChannel::addMessage ( LogMessage message,
bool  check = true 
) [virtual]

Add a new Log message to this channel.

Parameters:
message the log message to record.
check if true, raises a LogException if this added message's channel does not match this channel.
Note:
This method takes ownership of the specified log message.

this method overrides the LogChannel one, so that the protocol prefix is taken into account when matching the message's channel name and this channel name.

Exceptions:
LogException if the operation failed.

Reimplemented from Ceylan::Log::LogChannel.

Definition at line 116 of file CeylanObjectChannel.cc.

References Ceylan::Log::LogChannel::_messages, Ceylan::Log::LogChannel::_name, Ceylan::Log::LogMessage::getChannelName(), and Ceylan::Log::Loggable::GetEmbeddedChannelName().

Referenced by Ceylan::Log::LogAggregator::createLoggableChannelFrom(), and Ceylan::Log::LogAggregator::storeObjectMessage().

LogChannel::MessageCount LogChannel::getMessageCount (  )  const [virtual, inherited]

Returns the number of messages this channel currently gathered.

Definition at line 129 of file CeylanLogChannel.cc.

References Ceylan::Log::LogChannel::_messages.

const string LogChannel::getName (  )  const [virtual, inherited]

ObjectIdentifier & ObjectChannel::getObjectIdentifier (  )  const [virtual]

Returns this ObjectChannel's Object identifier.

Exceptions:
LogException if the operation failed.

Definition at line 137 of file CeylanObjectChannel.cc.

References _linkedObjectID.

TextDisplayable::TextOutputFormat TextDisplayable::GetOutputFormat (  )  [static, inherited]

ObjectChannel& Ceylan::Log::ObjectChannel::operator= ( const ObjectChannel source  )  [private]

Assignment operator made private to ensure that it will be never called.

The compiler should complain whenever this undefined operator is called, implicitly or not.

void TextDisplayable::SetOutputFormat ( TextOutputFormat  newOutputFormat  )  [static, inherited]

Sets the current overall text format to be used by TextDisplayable instances.

Parameters:
newOutputFormat the new output format.

Definition at line 72 of file CeylanTextDisplayable.cc.

References Ceylan::TextDisplayable::_OutputFormat.

Referenced by Ceylan::Log::LogHolder::LogHolder().

const std::string TextDisplayable::ToString ( std::list< TextDisplayable * >  displayables,
Ceylan::VerbosityLevels  level = Ceylan::high 
) [static, inherited]

Returns a user-friendly description of this list of pointers to text displayable instances.

Parameters:
displayables a list of pointers to TextDisplayable instances/
level the requested verbosity level.
Note:
Text output format is determined from overall settings.
See also:
toString, Ceylan::VerbosityLevels

Definition at line 45 of file CeylanTextDisplayable.cc.

References Ceylan::formatStringList().

const string ObjectChannel::toString ( Ceylan::VerbosityLevels  level = Ceylan::high  )  const [virtual]

Returns a user-friendly description of the state of this object.

Parameters:
level the requested verbosity level.
Note:
Text output format is determined from overall settings.
See also:
TextDisplayable

Reimplemented from Ceylan::Log::LogChannel.

Definition at line 150 of file CeylanObjectChannel.cc.

References Ceylan::Log::LogChannel::_messages, Ceylan::Log::LogChannel::_name, CEYLAN_LOG, Ceylan::formatStringList(), Ceylan::low, and Ceylan::toString().


Member Data Documentation

This is the identifier of the Ceylan object this ObjectChannel corresponds to.

Definition at line 146 of file CeylanObjectChannel.h.

Referenced by getObjectIdentifier(), ObjectChannel(), and ~ObjectChannel().

std::list<LogMessage *> Ceylan::Log::LogChannel::_messages [protected, inherited]

std::string Ceylan::Log::LogChannel::_name [protected, inherited]

TextDisplayable::TextOutputFormat TextDisplayable::_OutputFormat = rawText [static, protected, inherited]

The text format to be used currently by TextDisplayable instances.

Note:
Defaults to raw text.

Definition at line 158 of file CeylanTextDisplayable.h.

Referenced by Ceylan::TextDisplayable::GetOutputFormat(), and Ceylan::TextDisplayable::SetOutputFormat().


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

Generated on Thu Jun 4 20:40:23 2009 for Ceylan by  doxygen 1.5.8