cprover
ui_message_handlert Class Reference

#include <ui_message.h>

Inheritance diagram for ui_message_handlert:
[legend]
Collaboration diagram for ui_message_handlert:
[legend]

Public Types

enum  uit { uit::PLAIN, uit::XML_UI, uit::JSON_UI }
 

Public Member Functions

 ui_message_handlert (uit, const std::string &program, const bool always_flush, timestampert::clockt clock_type)
 
 ui_message_handlert (const class cmdlinet &, const std::string &program)
 
 ui_message_handlert ()
 Default constructor; implementation is in .cpp file. More...
 
virtual ~ui_message_handlert ()
 
uit get_ui () const
 
void set_ui (uit __ui)
 
virtual void flush (unsigned level) override
 
json_stream_arraytget_json_stream () override
 Return the underlying JSON stream. More...
 
- Public Member Functions inherited from message_handlert
 message_handlert ()
 
virtual ~message_handlert ()
 
void set_verbosity (unsigned _verbosity)
 
unsigned get_verbosity () const
 
unsigned get_message_count (unsigned level) const
 

Protected Member Functions

virtual void print (unsigned level, const std::string &message) override
 
virtual void print (unsigned level, const std::string &message, int sequence_number, const source_locationt &location) override
 
virtual void print (unsigned level, const xmlt &data) override
 
virtual void print (unsigned level, const jsont &data) override
 
virtual void xml_ui_msg (const std::string &type, const std::string &msg1, const std::string &msg2, const source_locationt &location)
 
virtual void json_ui_msg (const std::string &type, const std::string &msg1, const std::string &msg2, const source_locationt &location)
 
virtual void ui_msg (const std::string &type, const std::string &msg1, const std::string &msg2, const source_locationt &location)
 
const char * level_string (unsigned level)
 

Protected Attributes

uit _ui
 
const bool always_flush
 
std::unique_ptr< const timestamperttime
 
std::ostream & out
 
std::unique_ptr< json_stream_arraytjson_stream
 
- Protected Attributes inherited from message_handlert
unsigned verbosity
 
std::vector< unsigned > message_count
 

Detailed Description

Definition at line 19 of file ui_message.h.

Member Enumeration Documentation

◆ uit

Enumerator
PLAIN 
XML_UI 
JSON_UI 

Definition at line 22 of file ui_message.h.

Constructor & Destructor Documentation

◆ ui_message_handlert() [1/3]

ui_message_handlert::ui_message_handlert ( uit  __ui,
const std::string &  program,
const bool  always_flush,
timestampert::clockt  clock_type 
)

Definition at line 31 of file ui_message.cpp.

References _ui, xmlt::data, INVARIANT, json_stream, JSON_UI, xmlt::name, out, PLAIN, and XML_UI.

◆ ui_message_handlert() [2/3]

ui_message_handlert::ui_message_handlert ( const class cmdlinet cmdline,
const std::string &  program 
)

Definition at line 77 of file ui_message.cpp.

◆ ui_message_handlert() [3/3]

ui_message_handlert::ui_message_handlert ( )

Default constructor; implementation is in .cpp file.

Definition at line 22 of file ui_message.cpp.

◆ ~ui_message_handlert()

ui_message_handlert::~ui_message_handlert ( )
virtual

Definition at line 96 of file ui_message.cpp.

References get_ui(), INVARIANT, json_stream, JSON_UI, out, PLAIN, and XML_UI.

Member Function Documentation

◆ flush()

void ui_message_handlert::flush ( unsigned  level)
overridevirtual

Reimplemented from message_handlert.

Reimplemented in console_message_handlert.

Definition at line 307 of file ui_message.cpp.

References always_flush, console_message_handlert::flush(), get_ui(), JSON_UI, out, PLAIN, and XML_UI.

Referenced by print().

◆ get_json_stream()

json_stream_arrayt& ui_message_handlert::get_json_stream ( )
inlineoverridevirtual

Return the underlying JSON stream.

Reimplemented from message_handlert.

Definition at line 54 of file ui_message.h.

References json_stream, and PRECONDITION.

◆ get_ui()

◆ json_ui_msg()

void ui_message_handlert::json_ui_msg ( const std::string &  type,
const std::string &  msg1,
const std::string &  msg2,
const source_locationt location 
)
protectedvirtual

◆ level_string()

const char * ui_message_handlert::level_string ( unsigned  level)
protected

Definition at line 117 of file ui_message.cpp.

Referenced by print().

◆ print() [1/4]

void ui_message_handlert::print ( unsigned  level,
const std::string &  message 
)
overrideprotectedvirtual

◆ print() [2/4]

void ui_message_handlert::print ( unsigned  level,
const std::string &  message,
int  sequence_number,
const source_locationt location 
)
overrideprotectedvirtual

◆ print() [3/4]

void ui_message_handlert::print ( unsigned  level,
const xmlt data 
)
overrideprotectedvirtual

Reimplemented from message_handlert.

Definition at line 161 of file ui_message.cpp.

References flush(), get_ui(), INVARIANT, JSON_UI, out, PLAIN, message_handlert::verbosity, and XML_UI.

◆ print() [4/4]

void ui_message_handlert::print ( unsigned  level,
const jsont data 
)
overrideprotectedvirtual

Reimplemented from message_handlert.

Definition at line 183 of file ui_message.cpp.

References flush(), get_ui(), INVARIANT, json_stream, JSON_UI, PLAIN, message_handlert::verbosity, and XML_UI.

◆ set_ui()

void ui_message_handlert::set_ui ( uit  __ui)
inline

Definition at line 42 of file ui_message.h.

References _ui, json_stream, JSON_UI, and out.

◆ ui_msg()

void ui_message_handlert::ui_msg ( const std::string &  type,
const std::string &  msg1,
const std::string &  msg2,
const source_locationt location 
)
protectedvirtual

Definition at line 243 of file ui_message.cpp.

References get_ui(), JSON_UI, json_ui_msg(), PLAIN, XML_UI, and xml_ui_msg().

Referenced by print().

◆ xml_ui_msg()

void ui_message_handlert::xml_ui_msg ( const std::string &  type,
const std::string &  msg1,
const std::string &  msg2,
const source_locationt location 
)
protectedvirtual

Member Data Documentation

◆ _ui

uit ui_message_handlert::_ui
protected

Definition at line 61 of file ui_message.h.

Referenced by get_ui(), set_ui(), and ui_message_handlert().

◆ always_flush

const bool ui_message_handlert::always_flush
protected

Definition at line 62 of file ui_message.h.

Referenced by flush(), and print().

◆ json_stream

std::unique_ptr<json_stream_arrayt> ui_message_handlert::json_stream
protected

◆ out

std::ostream& ui_message_handlert::out
protected

Definition at line 64 of file ui_message.h.

Referenced by flush(), print(), set_ui(), ui_message_handlert(), xml_ui_msg(), and ~ui_message_handlert().

◆ time

std::unique_ptr<const timestampert> ui_message_handlert::time
protected

Definition at line 63 of file ui_message.h.

Referenced by json_ui_msg(), print(), and xml_ui_msg().


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