EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
filter_msg_buffer Class Reference

#include <online_distribution/blob/master/newbasic/filter_msg_buffer.h>

+ Inheritance diagram for filter_msg_buffer:
+ Collaboration diagram for filter_msg_buffer:

Public Member Functions

 filter_msg_buffer (const int msglen=256)
 
 filter_msg_buffer (const int type_max, const int source_max, const int sev_max, const int msglen=256)
 
virtual ~filter_msg_buffer ()
 the virtual destructor
 
virtual int sync ()
 the sync function overrides the streambuf's sync function
 
virtual int set (const int msg_type, const int msg_source, const int msg_severity, const int value=OFF)
 
virtual int set_severity_below_threshold (const int threshold, const int value=OFF)
 Globally set all messages below a certain severity threshold to ON or OFF.
 
virtual int set_type (const int type, const int value=OFF)
 Globally switch ON or OFF all messages of a certain type.
 
virtual int set_source (const int source, const int value=OFF)
 Globally switch ON or OFF all messages from a certain source.
 
virtual int all_off ()
 Globally switch all messages off.
 
virtual int all_on ()
 Globally switch all messages on.
 
- Public Member Functions inherited from msg_buffer
 msg_buffer (const int msglen=256)
 
virtual ~msg_buffer ()
 
virtual int overflow (int ch)
 

Protected Attributes

STREAMBUForiginal_streambuf
 
int *** state
 
int msg_type_max
 
int msg_source_max
 
int msg_sev_max
 
- Protected Attributes inherited from msg_buffer
char * oBuffer
 
int pos
 
int maximum_position
 
msg_controlm
 

Additional Inherited Members

- Protected Member Functions inherited from msg_buffer
virtual char * format (int *length, msgProfile *mp)
 

Detailed Description

This is the "filter" msg\_buffer class which allows you to filter

messages based on their profile. Its default behavior is to let all messages pass. You can use the member functions to tailor the kind of messages filtered and passed on.

Definition at line 17 of file filter_msg_buffer.h.

View newest version in sPHENIX GitHub at line 17 of file filter_msg_buffer.h

Constructor & Destructor Documentation

filter_msg_buffer::filter_msg_buffer ( const int  msglen = 256)

The msglen parameter specifies the initial length of the message string which is kept internally. If you exceed the length, it is automautically extended.

Definition at line 7 of file filter_msg_buffer.cc.

View newest version in sPHENIX GitHub at line 7 of file filter_msg_buffer.cc

References COUT, k, msg_sev_max, MSG_SEV_MAX, MSG_SOURCE_MAX, msg_source_max, MSG_TYPE_MAX, msg_type_max, ON, original_streambuf, state, and STREAMBUF.

filter_msg_buffer::filter_msg_buffer ( const int  type_max,
const int  source_max,
const int  sev_max,
const int  msglen = 256 
)

This constructor defines a custom-sized matrix of type/source/severities.

Definition at line 39 of file filter_msg_buffer.cc.

View newest version in sPHENIX GitHub at line 39 of file filter_msg_buffer.cc

References COUT, k, msg_sev_max, msg_source_max, msg_type_max, ON, original_streambuf, state, and STREAMBUF.

filter_msg_buffer::~filter_msg_buffer ( )
virtual

the virtual destructor

Definition at line 74 of file filter_msg_buffer.cc.

View newest version in sPHENIX GitHub at line 74 of file filter_msg_buffer.cc

References COUT, msg_source_max, msg_type_max, original_streambuf, and state.

Member Function Documentation

int filter_msg_buffer::all_off ( )
virtual

Globally switch all messages off.

Definition at line 180 of file filter_msg_buffer.cc.

View newest version in sPHENIX GitHub at line 180 of file filter_msg_buffer.cc

References k, msg_sev_max, msg_source_max, msg_type_max, OFF, and state.

int filter_msg_buffer::all_on ( )
virtual

Globally switch all messages on.

Definition at line 190 of file filter_msg_buffer.cc.

View newest version in sPHENIX GitHub at line 190 of file filter_msg_buffer.cc

References k, msg_sev_max, msg_source_max, msg_type_max, ON, and state.

int filter_msg_buffer::set ( const int  msg_type,
const int  msg_source,
const int  msg_severity,
const int  value = OFF 
)
virtual

the set function defines (ON or OFF) which messages are passed and which ones are filtered. This gives very fine-grained control. There are other functions which give you more global control.

Definition at line 124 of file filter_msg_buffer.cc.

View newest version in sPHENIX GitHub at line 124 of file filter_msg_buffer.cc

References msg_sev_max, msg_source_max, msg_type_max, state, and value.

int filter_msg_buffer::set_severity_below_threshold ( const int  threshold,
const int  value = OFF 
)
virtual

Globally set all messages below a certain severity threshold to ON or OFF.

Definition at line 140 of file filter_msg_buffer.cc.

View newest version in sPHENIX GitHub at line 140 of file filter_msg_buffer.cc

References k, msg_sev_max, msg_source_max, msg_type_max, and state.

int filter_msg_buffer::set_source ( const int  source,
const int  value = OFF 
)
virtual

Globally switch ON or OFF all messages from a certain source.

Definition at line 167 of file filter_msg_buffer.cc.

View newest version in sPHENIX GitHub at line 167 of file filter_msg_buffer.cc

References k, msg_sev_max, msg_type_max, and state.

int filter_msg_buffer::set_type ( const int  type,
const int  value = OFF 
)
virtual

Globally switch ON or OFF all messages of a certain type.

Definition at line 155 of file filter_msg_buffer.cc.

View newest version in sPHENIX GitHub at line 155 of file filter_msg_buffer.cc

References k, msg_sev_max, msg_source_max, msg_type_max, and state.

int filter_msg_buffer::sync ( )
virtual

the sync function overrides the streambuf's sync function

Reimplemented from msg_buffer.

Reimplemented in date_filter_msg_buffer.

Definition at line 95 of file filter_msg_buffer.cc.

View newest version in sPHENIX GitHub at line 95 of file filter_msg_buffer.cc

References msg_buffer::format(), G4BARRELHCAL::length, original_streambuf, msg_buffer::pos, msgProfile::severity, msgProfile::source, state, msgProfile::type, and x.

+ Here is the call graph for this function:

Member Data Documentation

int filter_msg_buffer::msg_sev_max
protected

Definition at line 25 of file filter_msg_buffer.h.

View newest version in sPHENIX GitHub at line 25 of file filter_msg_buffer.h

Referenced by all_off(), all_on(), filter_msg_buffer(), set(), set_severity_below_threshold(), set_source(), and set_type().

int filter_msg_buffer::msg_source_max
protected

Definition at line 24 of file filter_msg_buffer.h.

View newest version in sPHENIX GitHub at line 24 of file filter_msg_buffer.h

Referenced by all_off(), all_on(), filter_msg_buffer(), set(), set_severity_below_threshold(), set_type(), and ~filter_msg_buffer().

int filter_msg_buffer::msg_type_max
protected

Definition at line 23 of file filter_msg_buffer.h.

View newest version in sPHENIX GitHub at line 23 of file filter_msg_buffer.h

Referenced by all_off(), all_on(), filter_msg_buffer(), set(), set_severity_below_threshold(), set_source(), set_type(), and ~filter_msg_buffer().

STREAMBUF* filter_msg_buffer::original_streambuf
protected

Definition at line 21 of file filter_msg_buffer.h.

View newest version in sPHENIX GitHub at line 21 of file filter_msg_buffer.h

Referenced by filter_msg_buffer(), date_filter_msg_buffer::sync(), sync(), and ~filter_msg_buffer().

int*** filter_msg_buffer::state
protected

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