9 #ifndef __IPJOURNALIST_HPP__
10 #define __IPJOURNALIST_HPP__
153 const char* format, ...)
const;
164 const std::string& line)
const;
170 const char* format, ...)
const;
232 const std::string& location_name,
233 const std::string& fname,
283 virtual std::string
Name();
319 const char* pformat, va_list ap)
342 const char* pformat, va_list ap)=0;
395 virtual bool Open(
const char* fname);
408 const char* pformat, va_list ap);
464 const char* pformat, va_list ap);
This can be used by the user's application.
Journal()
Default Constructor.
virtual void FlushBuffer()
Flush output buffer.
This can be used by the user's application.
void SetOutputStream(std::ostream *os)
Setting the output stream pointer.
This can be used by the user's application.
virtual void PrintImpl(EJournalCategory category, EJournalLevel level, const char *str)
Print to the designated output location.
virtual void FlushBufferImpl()=0
Flush output buffer.
virtual bool Open(const char *fname)
Open a new file for the output location.
virtual void PrintfImpl(EJournalCategory category, EJournalLevel level, const char *pformat, va_list ap)=0
Printf to the designated output location.
virtual ~FileJournal()
Destructor.
Index print_levels_[J_LAST_CATEGORY]
vector of integers indicating the level for each category
virtual void PrintfIndented(EJournalLevel level, EJournalCategory category, Index indent_level, const char *format,...) const
Method to print a formatted string with indentation.
virtual void PrintImpl(EJournalCategory category, EJournalLevel level, const char *str)
Print to the designated output location.
void operator=(const Journalist &)
Overloaded Equals Operator.
std::ostream * os_
pointer to output stream for the output destination
virtual void SetAllPrintLevels(EJournalLevel level)
Set the print level for all category.
This can be used by the user's application.
virtual SmartPtr< Journal > AddFileJournal(const std::string &location_name, const std::string &fname, EJournalLevel default_level=J_WARNING)
Add a new FileJournal.
std::string name_
Name of the output location.
void operator=(const FileJournal &)
Overloaded Equals Operator.
virtual void PrintfImpl(EJournalCategory category, EJournalLevel level, const char *pformat, va_list ap)
Printf to the designated output location.
virtual void FlushBufferImpl()
Flush output buffer.
FILE * file_
FILE pointer for the output destination.
This can be used by the user's application.
void operator=(const Journal &)
Overloaded Equals Operator.
EJournalLevel
Print Level Enum.
This can be used by the user's application.
This can be used by the user's application.
virtual void FlushBufferImpl()
Flush output buffer.
char buffer_[32768]
buffer for sprintf.
Template class for Smart Pointers.
virtual ~StreamJournal()
Destructor.
This can be used by the user's application.
virtual void PrintImpl(EJournalCategory category, EJournalLevel level, const char *str)=0
Print to the designated output location.
StreamJournal()
Default Constructor.
This can be used by the user's application.
virtual void VPrintf(EJournalLevel level, EJournalCategory category, const char *pformat, va_list ap) const
Method to print a formatted string using the va_list argument.
virtual void Printf(EJournalLevel level, EJournalCategory category, const char *format,...) const
Method to print a formatted string.
This can be used by the user's application.
virtual bool AddJournal(const SmartPtr< Journal > jrnl)
Add a new journal.
This can be used by the user's application.
int Index
Type of all indices of vectors, matrices etc.
This can be used by the user's application.
virtual ~Journalist()
Destructor...
This can be used by the user's application.
virtual void PrintStringOverLines(EJournalLevel level, EJournalCategory category, Index indent_spaces, Index max_length, const std::string &line) const
Method to print a long string including indentation.
void operator=(const StreamJournal &)
Overloaded Equals Operator.
Class responsible for all message output.
This can be used by the user's application.
virtual void Printf(EJournalCategory category, EJournalLevel level, const char *pformat, va_list ap)
Printf to the designated output location.
virtual void DeleteAllJournals()
Delete all journals curently known by the journalist.
virtual bool ProduceOutput(EJournalLevel level, EJournalCategory category) const
Method that returns true if there is a Journal that would write output for the given JournalLevel and...
This can be used by the user's application.
virtual void VPrintfIndented(EJournalLevel level, EJournalCategory category, Index indent_level, const char *pformat, va_list ap) const
Method to print a formatted string with indentation, using the va_list argument.
std::vector< SmartPtr< Journal > > journals_
virtual void FlushBuffer() const
Method that flushes the current buffer for all Journalists.
FileJournal()
Default Constructor.
This can be used by the user's application.
Journal class (part of the Journalist implementation.).
virtual void SetPrintLevel(EJournalCategory category, EJournalLevel level)
Set the print level for a particular category.
This can be used by the user's application.
This can be used by the user's application.
EJournalCategory
Category Selection Enum.
virtual bool IsAccepted(EJournalCategory category, EJournalLevel level) const
Ask if a particular print level/category is accepted by the journal.
virtual void PrintfImpl(EJournalCategory category, EJournalLevel level, const char *pformat, va_list ap)
Printf to the designated output location.
virtual SmartPtr< Journal > GetJournal(const std::string &location_name)
Get an existing journal.
virtual ~Journal()
Destructor.
virtual void Print(EJournalCategory category, EJournalLevel level, const char *str)
Print to the designated output location.
virtual std::string Name()
Get the name of the Journal.