gramods
Public Member Functions | Static Public Attributes | List of all members
gramods::gmCore::OStreamMessageSink Class Reference
Inheritance diagram for gramods::gmCore::OStreamMessageSink:
Inheritance graph
[legend]
Collaboration diagram for gramods::gmCore::OStreamMessageSink:
Collaboration graph
[legend]

Public Member Functions

void setStream (std::ostream *s)
 Set the stream to use as output. More...
 
void setStream (std::shared_ptr< std::ostream > s)
 Set the stream to use as output. More...
 
void setStream (std::string name)
 Set the stream to use as output, as string. More...
 
void setUseAnsiColor (bool on)
 Activate or deactivate the use of ANSI color escape characters to emphasize error and warning messages. More...
 
void output (Message msg)
 Outputs the provided message to the implementation specific channel. More...
 
void setLevel (int l)
 Set the level of messages to output. More...
 
- Public Member Functions inherited from gramods::gmCore::MessageSink
virtual void initialize () override
 Called to initialize the MessageSink. More...
 
void setShowTime (bool on)
 Activate or deactivate the output of the time of each message. More...
 
- Public Member Functions inherited from gramods::gmCore::Object
 Object ()
 Initializes internal data. More...
 
virtual ~Object ()
 Cleaning up internal data. More...
 
virtual void accept (Visitor *visitor)
 Calls the visitors apply method with this as argument. More...
 
virtual void traverse (Visitor *visitor)
 Calls the child Object's accept method, if such exist. More...
 
virtual std::string getDefaultKey ()
 Returns the default key for the Object when automatically instantiated in a Configuration, i.e. More...
 
bool isInitialized ()
 Returns true if the Object is initialized. More...
 

Static Public Attributes

static gramods::gmCore::OFactory::OFactoryInformation _gm_ofi
 
- Static Public Attributes inherited from gramods::gmCore::MessageSink
static gramods::gmCore::OFactory::OFactoryInformation _gm_ofi
 

Additional Inherited Members

- Protected Member Functions inherited from gramods::gmCore::MessageSink
void outputMetadata (std::ostream &out, Message msg)
 Write metadata from the specified message to the specified stream. More...
 

Member Function Documentation

◆ output()

void gramods::gmCore::OStreamMessageSink::output ( Message  msg)
virtual

Outputs the provided message to the implementation specific channel.

This method may be called concurrently from multiple thread and must therefore be thread safe.

Implements gramods::gmCore::MessageSink.

◆ setLevel()

gramods::gmCore::OFactory::ParamSetterInsert gm_ofi_OStreamMessageSink_param_level &OStreamMessageSink::_gm_ofi(& gramods::gmCore::OStreamMessageSink::setLevel ( int  l)
inline

Set the level of messages to output.

This is an integer typically following the level of importance in ConsoleLevel, inclusive.

XML-attribute: level

◆ setStream() [1/3]

void gramods::gmCore::OStreamMessageSink::setStream ( std::ostream *  s)
inline

Set the stream to use as output.

Use this if you do not want smart memory management, for example if your output stream is std::cout.

◆ setStream() [2/3]

void gramods::gmCore::OStreamMessageSink::setStream ( std::shared_ptr< std::ostream >  s)
inline

Set the stream to use as output.

Use this if you do want smart memory management, for example if the output stream is shared between objects and is not memory managed by the operating system.

◆ setStream() [3/3]

void gramods::gmCore::OStreamMessageSink::setStream ( std::string  name)

Set the stream to use as output, as string.

Valid values are "out" and "err".

XML-attribute: stream

◆ setUseAnsiColor()

void gramods::gmCore::OStreamMessageSink::setUseAnsiColor ( bool  on)

Activate or deactivate the use of ANSI color escape characters to emphasize error and warning messages.

XML-attribute: useAnsiColor


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