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

A destination where log messages go to be written to a file or other ostream. Attempts to prevent duplicate messages from being written to the same output even if logged through mutliple taps. More...

#include <Destination.hpp>

Inheritance diagram for sparta::log::DestinationInstance< DestType >:
Collaboration diagram for sparta::log::DestinationInstance< DestType >:

Additional Inherited Members

- 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.
 
virtual bool compareOstreams (const std::ostream &) const
 Returns true if the destination behind this interface was constructed with the ostream o.
 
virtual std::string stringize (bool pretty=false) const =0
 Create a string representation of this Destination.
 
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

template<typename DestType>
class sparta::log::DestinationInstance< DestType >

A destination where log messages go to be written to a file or other ostream. Attempts to prevent duplicate messages from being written to the same output even if logged through mutliple taps.

A destination is opened for write and file content cleared where applicable. Because these destinations are persistent, it is opened only once for a process. The output stream will never be cleared by another reference to this destination, even if there are 0 references to it at some point.

Definition at line 385 of file Destination.hpp.


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