FeeServer::MessageChannel Class Reference
[Core Feeserver channels.]

#include <feeserver/fee_msg.hh>

Collaboration diagram for FeeServer::MessageChannel:

Collaboration graph
[legend]

List of all members.


Detailed Description

Message channel interface.
Examples:

test_msg.cc.


Public Types

typedef Message::Event Event

Public Member Functions

 MessageChannel (const std::string &server, const std::string &detector, unsigned long mask=(Message::Info|Message::Warning|Message::Error|Message::AuditFailure|Message::AuditSuccess|Message::Debug|Message::Alarm))
virtual ~MessageChannel ()
void Clear ()
void Send (Event event, const std::string &where, const char *format,...)
void HandleRepeats ()
void SetLogMask (unsigned int mask)
unsigned int LogMask () const
bool CheckEvent (Event event) const

Protected Member Functions

 MessageChannel (const MessageChannel &)
MessageChanneloperator= (const MessageChannel &)
void UnlockedSend (Event event, const std::string &where, const char *format,...)
void DoSend (Event event, const std::string &where, const std::string &msg)

Protected Attributes

Message _msg
DimService * _service
Mutex _mutex
std::string _last
const std::string _server
unsigned int _repeats
unsigned int _log_mask
std::vector< unsigned char > _buf

Friends

class MessageWatchdog

Member Typedef Documentation


Constructor & Destructor Documentation

FeeServer::MessageChannel::MessageChannel ( const std::string &  server,
const std::string &  detector,
unsigned long  mask = (Message::Info |         Message::Warning |         Message::Error |         Message::AuditFailure |         Message::AuditSuccess |        Message::Debug |         Message::Alarm) 
)

Constructor

Parameters:
server Server name
detector Detector name
mask The log mask

FeeServer::MessageChannel::~MessageChannel (  )  [virtual]

Destructor

FeeServer::MessageChannel::MessageChannel ( const MessageChannel  )  [protected]

Not implemented


Member Function Documentation

void FeeServer::MessageChannel::Clear (  ) 

Clear the message structure.

void FeeServer::MessageChannel::Send ( Event  event,
const std::string &  where,
const char *  format,
  ... 
)

Send a message

Parameters:
event The event type
where Where the event happened.
format printf-like format

void FeeServer::MessageChannel::HandleRepeats (  ) 

Handle repeated messages

void FeeServer::MessageChannel::SetLogMask ( unsigned int  mask  )  [inline]

Set the log-level

unsigned int FeeServer::MessageChannel::LogMask (  )  const [inline]

Get the log mask

bool FeeServer::MessageChannel::CheckEvent ( Event  event  )  const [inline]

Check that we want log messages for a type of events

MessageChannel& FeeServer::MessageChannel::operator= ( const MessageChannel  )  [protected]

Not implemented

void FeeServer::MessageChannel::UnlockedSend ( Event  event,
const std::string &  where,
const char *  format,
  ... 
) [protected]

As Send, except it doesn't lock the mutex

void FeeServer::MessageChannel::DoSend ( Event  event,
const std::string &  where,
const std::string &  msg 
) [protected]

Core of the send methods

std::cout << _msg << std::endl;


Friends And Related Function Documentation

friend class MessageWatchdog [friend]

Watch dog is a friend


Member Data Documentation

Messagge

DimService* FeeServer::MessageChannel::_service [protected]

The service

std::string FeeServer::MessageChannel::_last [protected]

Last description

const std::string FeeServer::MessageChannel::_server [protected]

Server name

unsigned int FeeServer::MessageChannel::_repeats [protected]

Number of repeats

unsigned int FeeServer::MessageChannel::_log_mask [protected]

Stores the current log level for this FeeServer. In case the environmental variable FEE_LOG_LEVEL is set, this value will be used.

std::vector<unsigned char> FeeServer::MessageChannel::_buf [protected]

Buffer


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

Generated on Thu Jun 26 17:02:31 2008 for FeeServer++ 0.9 by  doxygen 1.5.6