OpenJPH
Open-source implementation of JPEG2000 Part-15
Loading...
Searching...
No Matches
ojph::message_base Class Referenceabstract

This is the base class from which all messaging levels are derived. More...

#include <ojph_message.h>

Inheritance diagram for ojph::message_base:
ojph::message_error ojph::message_info ojph::message_warning

Public Member Functions

virtual void operator() (int warn_code, const char *file_name, int line_num, const char *fmt,...)=0
 Prints a message and for errors throws an exception. All derived classes must override this virtual function.
 

Detailed Description

This is the base class from which all messaging levels are derived.

Remarks
There are 3 levels of messaging; they are in order of level of severity: INFO, WARNING, and ERROR. ERROR is the most severe and code execution must be terminated.

The library provides two way to customize the reporting associated with each messaging level:
  1. Calling set_XXXX_stream; this sets the library's output file stream to a user defined stream, such as std_err or a log file; it can also be set to NULL to prevent reporting.
  2. Calling configure_XXXX to pass a pointer to an object from a class derived from the corresponding message_XXXX class. The derived class must override the virtual operator() to perform the desired behaviour. Remember for message_error, the user must throw an exception at the end of the implementation of operator().

The customization is global, and cannot be separately tailored for each decoder's instantiation.

Importantly it defined the base virtual operator() that must be defined in all derived classes.

Definition at line 91 of file ojph_message.h.

Member Function Documentation

◆ operator()()

virtual void ojph::message_base::operator() ( int  warn_code,
const char *  file_name,
int  line_num,
const char *  fmt,
  ... 
)
pure virtual

Prints a message and for errors throws an exception. All derived classes must override this virtual function.

Parameters
warn_codeMessage code (integer) for identifications.
file_nameThe file name where the message originates.
line_numThe line number where the message originates.
fmtThe format of the message; this is printf format.
...A variable number of parameters to print. This is the parameters you would pass to printf.

Implemented in ojph::message_info, ojph::message_warning, and ojph::message_error.


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