EDoc::StdErrNotifier Class Reference

#include <include/EDoc/StdErrNotifier.h>

Inheritance diagram for EDoc::StdErrNotifier:

EDoc::NotificationIFace

Detailed Description

Standard implementation of NotificationIFace that notifies users of events through the stderr stream.

This will display events in a format that should be simple for automated parsers to extract infromation from.

Note: This does not display events as they occur, but queues them in a list that can be displayed at a later time. This is to avoid events being intermixed with progress bar indication data. All events will be displayed by calling PrintAll()

Definition at line 39 of file StdErrNotifier.h.

Public Types

typedef bool(*) AllowEventFP (void *filter_data, EventCode code, std::string ev_name, EventType ev_type, const Function *function, const File *file, uint32_t line, const File *rfile, uint32_t rline, const Type *type, const PropogatingException *prop_exc, const FunctionType *function_type, const char *extra)
 Function pointer type for the filter callback function.

Public Member Functions

 StdErrNotifier (bool show_details_in)
 Constructor.
virtual ~StdErrNotifier ()
 Destructor.
void RegisterEvent (EventType type, EventCode code, std::string name, std::string summary)
 Registers a new event type.
void PrintEvent (EventCode code, const std::string &message)
 Prints an event.
virtual void Event (EventCode code, const char *source_file, unsigned int source_line, std::string message, const Function *function, const File *file, uint32_t line, const File *rfile, uint32_t rline, const Type *type, const PropogatingException *prop_exc, const FunctionType *function_type, const char *extra)
 See NotificationIFace::Event().
std::ostream & Print (std::ostream &out) const
 Displays current configuration.
void PrintAll ()
 Prints all currently queued events to stderr.
uint32_t GetTotalErrorCount () const
 Returns the total number of error type events encountered.
virtual void RegisterFilter (AllowEventFP fp, void *data)
 Set the filter callback function.

Static Public Member Functions

static bool AllowEverythingFilter (void *, EventCode, std::string, EventType, const Function *, const File *, uint32_t, const File *, uint32_t, const Type *, const PropogatingException *, const FunctionType *, const char *)
 The default filter that filters out no events at all.

Protected Attributes

AllowEventFP filter
 The currently registered function pointer.
void * filter_data
 Data associated function pointer.

Private Attributes

std::map< EventCode, Detailsevent_types
 Lists all possible event types that may occur.
std::list< std::string > messages
 A list of enqueued events that have yet to be displayed.
bool show_details
 If true display details about notification events.
uint32_t error_count
 Stores statistics for the number of the events were errors.

Data Structures

struct  Details
 Temporary structure for storing events for display at alater date. More...


Member Typedef Documentation

typedef bool(*) EDoc::NotificationIFace::AllowEventFP(void *filter_data, EventCode code, std::string ev_name, EventType ev_type, const Function *function, const File *file, uint32_t line, const File *rfile, uint32_t rline, const Type *type, const PropogatingException *prop_exc, const FunctionType *function_type, const char *extra) [inherited]

Function pointer type for the filter callback function.

See also:
RegisterFilter()

Definition at line 117 of file NotificationIFace.h.


Constructor & Destructor Documentation

EDoc::StdErrNotifier::StdErrNotifier ( bool  show_details_in  ) 

Constructor.

Adds all the standard notification events found in events.inc upon construction.

Definition at line 26 of file StdErrNotifier.cpp.

EDoc::StdErrNotifier::~StdErrNotifier (  )  [virtual]

Destructor.

Note:
EDoc++ data included.

Definition at line 41 of file StdErrNotifier.cpp.

References EDOC_ASSERT, and event_types.


Member Function Documentation

EDoc::StdErrNotifier::RegisterEvent ( EDoc::EventType  type,
EDoc::EventCode  code,
std::string  name,
std::string  summary 
)

Registers a new event type.

Note:
EDoc++ data included.

Definition at line 45 of file StdErrNotifier.cpp.

EDoc::StdErrNotifier::PrintEvent ( EDoc::EventCode  code,
const std::string &  message 
)

Prints an event.

Note:
EDoc++ data included.

Definition at line 52 of file StdErrNotifier.cpp.

Referenced by Event().

EDoc::StdErrNotifier::Event ( EDoc::EventCode  code,
const char *  source_file,
unsigned int  source_line,
std::string  message,
const Function function,
const File file,
uint32_t  line,
const File rfile,
uint32_t  rline,
const Type type,
const PropogatingException prop_exc,
const FunctionType function_type,
const char *  extra 
) [virtual]

See NotificationIFace::Event().

Note:
EDoc++ data included.

Implements EDoc::NotificationIFace.

Definition at line 78 of file StdErrNotifier.cpp.

References error_count, EDoc::EVENT_ERROR, event_types, EDoc::NotificationIFace::filter, EDoc::NotificationIFace::filter_data, and PrintEvent().

EDoc::StdErrNotifier::Print ( std::ostream &  out  )  const

Displays current configuration.

Note:
EDoc++ data included.

Definition at line 105 of file StdErrNotifier.cpp.

EDoc::StdErrNotifier::PrintAll (  ) 

Prints all currently queued events to stderr.

Note:
EDoc++ data included.

Definition at line 119 of file StdErrNotifier.cpp.

EDoc::StdErrNotifier::GetTotalErrorCount (  )  const [inline]

Returns the total number of error type events encountered.

Note:
EDoc++ data included.

Definition at line 97 of file StdErrNotifier.h.

References error_count.

EDoc::NotificationIFace::AllowEverythingFilter ( void *  ,
EDoc::EventCode  ,
std::string  ,
EDoc::EventType  ,
const Function ,
const File ,
uint32_t  ,
const File ,
uint32_t  ,
const Type ,
const PropogatingException ,
const FunctionType ,
const char *   
) [inline, static, inherited]

The default filter that filters out no events at all.

See also:
RegisterFilter()

Definition at line 136 of file NotificationIFace.h.

Referenced by EDoc::NotificationIFace::NotificationIFace().

virtual void EDoc::NotificationIFace::RegisterFilter ( AllowEventFP  fp,
void *  data 
) [inline, virtual, inherited]

Set the filter callback function.

The callback function should return true if the event is to be processed and false if the event is to be suppressed.

Parameters:
fp The function pointer that is to be called whenever an event is being generated by the Event() function being called.
data This is some optional additional data that is passed to the function pointer when it is called. This can store anything. It was primarily added because additional data is required for the callback that executes a python function in the suppressions file.

Definition at line 167 of file NotificationIFace.h.

References EDoc::NotificationIFace::filter.


Field Documentation

std::map<EventCode, Details> EDoc::StdErrNotifier::event_types [private]

Lists all possible event types that may occur.

Definition at line 150 of file StdErrNotifier.h.

Referenced by Event(), and ~StdErrNotifier().

std::list<std::string> EDoc::StdErrNotifier::messages [private]

A list of enqueued events that have yet to be displayed.

Definition at line 155 of file StdErrNotifier.h.

bool EDoc::StdErrNotifier::show_details [private]

If true display details about notification events.

Definition at line 160 of file StdErrNotifier.h.

uint32_t EDoc::StdErrNotifier::error_count [private]

Stores statistics for the number of the events were errors.

Definition at line 165 of file StdErrNotifier.h.

Referenced by Event(), and GetTotalErrorCount().

AllowEventFP EDoc::NotificationIFace::filter [protected, inherited]

The currently registered function pointer.

Definition at line 180 of file NotificationIFace.h.

Referenced by Event(), EDoc::NotificationIFace::NotificationIFace(), and EDoc::NotificationIFace::RegisterFilter().

void* EDoc::NotificationIFace::filter_data [protected, inherited]

Data associated function pointer.

Definition at line 185 of file NotificationIFace.h.

Referenced by Event(), and EDoc::NotificationIFace::NotificationIFace().


The documentation for this class was generated from the following files:
Generated on Tue Jan 20 18:26:09 2009 for EDoc-0.2.1 by  doxygen 1.5.1