pion::plugins::MonitorWriter Class Reference

#include <MonitorService.hpp>

List of all members.


Detailed Description

MonitorWriter: helper class, capturing packets, storing them into an array, streaming into XML

Definition at line 48 of file MonitorService.hpp.

Public Types

typedef boost::unordered_map<
pion::platform::Vocabulary::TermRef,
unsigned > 
TermCol

Public Member Functions

 ~MonitorWriter ()
 destructor
 MonitorWriter (pion::platform::ReactionEngine &reaction_engine, platform::VocabularyPtr &vptr, const std::string &reactor_id, unsigned size, bool scroll, PionLogger logger)
void writeEvent (pion::platform::EventPtr &e)
void setQP (const pion::net::HTTPTypes::QueryParams &qp)
 "set method" for MonitorWriters parameters from query parameters
void start (const pion::net::HTTPTypes::QueryParams &qp)
 starts the MonitorWriter
void stop (bool Stop=true, bool Flush=false)
void SerializeXML (pion::platform::Vocabulary::TermRef tref, const pion::platform::Event::ParameterValue &value, std::ostream &xml, TermCol &cols)
const std::string & getConnectionId (void) const
 returns the unique identifier for this particular connection
const std::string & getReactorId (void) const
 returns the unique identifier for the Reactor that this handler interacts with
std::string getStatus (const pion::net::HTTPTypes::QueryParams &qp)
 parse all (possible,optional) query parameters and set flags appropriately
boost::posix_time::ptime getAge (void) const
 getAge/setAge
void setAge (void)


Constructor & Destructor Documentation

pion::plugins::MonitorWriter::MonitorWriter ( pion::platform::ReactionEngine reaction_engine,
platform::VocabularyPtr vptr,
const std::string &  reactor_id,
unsigned  size,
bool  scroll,
PionLogger  logger 
) [inline]

constructs a new MonitorWriter object

Parameters:
reaction_engine reference to reaction engine
vptr pointer to vocabulary
reactor_id unique identifier for the Reactor that this handler interacts with
size size of circular buffer to use for capture
scroll boolean, whether to use scroll or capture&stop
logger PionLogger to use for logging messages

Definition at line 139 of file MonitorService.hpp.


Member Function Documentation

void pion::plugins::MonitorWriter::SerializeXML ( pion::platform::Vocabulary::TermRef  tref,
const pion::platform::Event::ParameterValue value,
std::ostream &  xml,
TermCol cols 
)

serializes event Terms to an XML output stream (for use by Event::for_each)

Parameters:
tref ParameterNode TermRef
value ParameterNode ParameterValue
xml output stream

Definition at line 98 of file MonitorService.cpp.

References pion::platform::Vocabulary::Term::term_id, pion::platform::Vocabulary::Term::term_type, and pion::plugins::URN_VOCAB.

void pion::plugins::MonitorWriter::stop ( bool  Stop = true,
bool  Flush = false 
) [inline]

stop MonitorWriter from collecting more data

Parameters:
Stop (default true) -- stop from collecting; don't use if reactor died
Flush (default false) -- flush events; if aged out

Definition at line 166 of file MonitorService.hpp.

References getConnectionId(), and pion::platform::ReactionEngine::removeTempConnection().

Referenced by writeEvent(), and ~MonitorWriter().

void pion::plugins::MonitorWriter::writeEvent ( pion::platform::EventPtr e  ) 

sends an Event over the TCP connection and cleans up if the connection has closed since we last sent data

Parameters:
e the Event to possibly (filter) add to the circular buffer

Definition at line 46 of file MonitorService.cpp.

References pion::platform::EventPtr::get(), getConnectionId(), and stop().


The documentation for this class was generated from the following files:
Generated on Wed Apr 13 16:38:37 2011 for pion-platform by  doxygen 1.4.7