SNMP++  3.3.4
LogEntryImpl Class Reference

The LogEntryImpl class implements a log entry using a dynamically allocated, but fixed-size buffer. More...

#include <log.h>

Inheritance diagram for LogEntryImpl:
Collaboration diagram for LogEntryImpl:

Public Member Functions

 LogEntryImpl (const char *const n, unsigned char t)
 Constructor with log class and severity level. More...
 
virtual ~LogEntryImpl ()
 Destructor. More...
 
virtual const char * get_value (void) const
 Get the contents of this log entry. More...
 
- Public Member Functions inherited from LogEntry
 LogEntry (const char *const n, unsigned char t)
 Constructor with log class and severity level. More...
 
virtual ~LogEntry ()
 Virtual destructor. More...
 
virtual void init (void)
 Initialize a new log entry, showing timestamp, class, and level. More...
 
virtual LogEntryoperator+= (const long)
 Add a numeric value to the log entry. More...
 
virtual LogEntryoperator+= (const char *)
 Add a string value to the log entry. More...
 
unsigned char get_type () const
 Get the type of this log entry. More...
 
unsigned char get_class () const
 Get the class of this log entry. More...
 
unsigned char get_level () const
 Get the level of this log entry. More...
 
const char * get_name () const
 Get the logger name of this log entry. More...
 

Protected Member Functions

unsigned int bytes_left ()
 Count the bytes left for additional values. More...
 
bool add_string (const char *)
 Add a string to the log. More...
 
- Protected Member Functions inherited from LogEntry
virtual bool add_integer (long)
 Add an integer to the log. More...
 
virtual bool add_timestamp (void)
 Add the current time to the log. More...
 

Private Attributes

char * value
 
char * ptr
 
bool output_stopped
 

Additional Inherited Members

- Protected Attributes inherited from LogEntry
const char *const name
 
unsigned char type
 
int count
 

Detailed Description

The LogEntryImpl class implements a log entry using a dynamically allocated, but fixed-size buffer.

See Also
Log
Author
Marty Janzen
Version
3.6

Definition at line 228 of file log.h.

Constructor & Destructor Documentation

LogEntryImpl::LogEntryImpl ( const char *const  n,
unsigned char  t 
)
inline

Constructor with log class and severity level.

Parameters
n- The name of the logging module
t- The type of the log entry. The type is composed by logical or the log entry class with a level of 0 up to 15.
Note
A error log of level 0 will stop program execution!

Definition at line 239 of file log.h.

References MAX_LOG_SIZE.

virtual LogEntryImpl::~LogEntryImpl ( )
inlinevirtual

Destructor.

Definition at line 251 of file log.h.

Member Function Documentation

bool LogEntryImpl::add_string ( const char *  )
protectedvirtual

Add a string to the log.

Parameters
s- A string value.
Returns
TRUE if the value has been added and FALSE if the log entry is full.

Implements LogEntry.

unsigned int LogEntryImpl::bytes_left ( )
inlineprotected

Count the bytes left for additional values.

Returns
The number of bytes left in this log entry.

Definition at line 269 of file log.h.

References MAX_LOG_SIZE.

virtual const char* LogEntryImpl::get_value ( void  ) const
inlinevirtual

Get the contents of this log entry.

Returns
Current contents of this log entry.

Reimplemented from LogEntry.

Definition at line 261 of file log.h.

Member Data Documentation

bool LogEntryImpl::output_stopped
private

Definition at line 284 of file log.h.

char* LogEntryImpl::ptr
private

Definition at line 283 of file log.h.

char* LogEntryImpl::value
private

Definition at line 282 of file log.h.


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