The Sparta Modeling Framework
Loading...
Searching...
No Matches
sparta::log::DestinationInstance< std::ostream > Class Reference

Logging Destination for an already-open ostream. More...

#include <Destination.hpp>

Inheritance diagram for sparta::log::DestinationInstance< std::ostream >:
Collaboration diagram for sparta::log::DestinationInstance< std::ostream >:

Public Member Functions

 DestinationInstance (std::ostream &stream)
 
virtual bool compareOstreams (const std::ostream &o) const override
 Returns true if the destination behind this interface was constructed with the ostream o.
 
virtual std::string stringize (bool pretty=false) const override
 Create a string representation of this Destination.
 
- Public Member Functions inherited from sparta::log::Destination
 Destination (const Destination &)=delete
 
Destinationoperator= (const Destination &)=delete
 
 Destination (const Destination &&rhp)
 
 Destination ()
 Default constructor.
 
template<std::size_t N>
bool compare (const char(&arg)[N]) const
 Comparison of destination for const char[]. Uses std::string comparison.
 
bool compare (const char *&arg) const
 Comparison of destination for const char[]. Uses std::string comparison.
 
bool compare (const std::string &arg) const
 Comparison of destination for std::string.
 
bool compare (const std::ostream &arg) const
 Handle Destination::operator== on ostreams.
 
template<typename T >
bool compare (const T &) const
 Operator= for for other unknown types.
 
virtual bool compareStrings (const std::string &) const
 Returns true if the destination behind this interface was constructed with the string s.
 
void write (const sparta::log::Message &msg)
 
uint64_t getNumMessagesReceived () const
 Get the total number of messages logged through this destination.
 
uint64_t getNumMessagesWritten () const
 Gets the total number of messages received by this destination and then written to the actual output stream.
 
uint64_t getNumMessageDuplicates () const
 Gets the total number of times that a message has arrived at this destination after already having been written to the output stream.
 

Detailed Description

Logging Destination for an already-open ostream.

This is used for logging to cout and cerr

Definition at line 395 of file Destination.hpp.

Constructor & Destructor Documentation

◆ DestinationInstance()

sparta::log::DestinationInstance< std::ostream >::DestinationInstance ( std::ostream &  stream)
inline

Definition at line 402 of file Destination.hpp.

Member Function Documentation

◆ compareOstreams()

virtual bool sparta::log::DestinationInstance< std::ostream >::compareOstreams ( const std::ostream &  ) const
inlineoverridevirtual

Returns true if the destination behind this interface was constructed with the ostream o.

Reimplemented from sparta::log::Destination.

Definition at line 411 of file Destination.hpp.

◆ stringize()

virtual std::string sparta::log::DestinationInstance< std::ostream >::stringize ( bool  pretty = false) const
inlineoverridevirtual

Create a string representation of this Destination.

Parameters
prettyPrint a more verbose, multi-line representaiton (if available).
Returns
string representation of this node "<" <location> ">"

Subclasses should override this with representations appropriate for their type.

Implements sparta::log::Destination.

Definition at line 416 of file Destination.hpp.

Here is the call graph for this function:

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