pion::plugins::FeedHandler Class Reference

#include <FeedService.hpp>

Inherited by pion::plugins::FeedReader, and pion::plugins::FeedWriter.

List of all members.


Detailed Description

FeedHandler: base helper class for sending and receiving Events

Definition at line 43 of file FeedService.hpp.

Public Member Functions

virtual ~FeedHandler ()
 virtual destructor
 FeedHandler (pion::platform::ReactionEngine &reaction_engine, const std::string &reactor_id, pion::platform::CodecPtr &codec_ptr, pion::net::TCPConnectionPtr &tcp_conn)
virtual void start (void)=0
 starts the FeedHandler
bool sendResponse (void)
const std::string & getConnectionId (void) const
 returns the unique identifier for this particular connection
const std::string & getConnectionInfo (void) const
 returns information describing this particular connection
const std::string & getReactorId (void) const
 returns the unique identifier for the Reactor that this handler interacts with
const std::string & getCodecId (void) const
 returns the unique identifier for the Codec that this handler uses

Static Public Member Functions

static std::string createConnectionInfo (pion::net::TCPConnectionPtr &tcp_conn)

Protected Attributes

pion::platform::ReactionEnginem_reaction_engine
 reference to ReactionEngine used to send Events to Reactors
PionLogger m_logger
 primary logging interface used by this class
const std::string m_connection_id
 unique identifier for this particular connection (generated when constructed)
const std::string m_connection_info
 information describing this particular connection (generated when constructed)
const std::string m_reactor_id
 unique identifier for the Reactor that this handler interacts with
pion::platform::CodecPtr m_codec_ptr
 pointer to the Codec used to write outgoing Event streams
pion::net::TCPConnectionPtr m_tcp_conn
 TCP connection for sending outgoing Event streams.
pion::net::TCPStream m_tcp_stream
 Wrapper on top of the TCP connection for synchronous stream operations.
boost::mutex m_mutex
 mutex used to protect the FeedHandler's data


Constructor & Destructor Documentation

pion::plugins::FeedHandler::FeedHandler ( pion::platform::ReactionEngine reaction_engine,
const std::string &  reactor_id,
pion::platform::CodecPtr codec_ptr,
pion::net::TCPConnectionPtr tcp_conn 
)

constructs a new FeedHandler object

Parameters:
reaction_engine reference to the ReactionEngine
reactor_id unique identifier for the Reactor that this handler interacts with
codec_ptr pointer to the Codec that this handler will use
tcp_conn TCP connection that will be used to send/receive Events

Definition at line 39 of file FeedService.cpp.


Member Function Documentation

std::string pion::plugins::FeedHandler::createConnectionInfo ( pion::net::TCPConnectionPtr tcp_conn  )  [static]

generates a string describing information for a TCP connection

Parameters:
tcp_conn TCP connection that will be used to send/receive Events
Returns:
std::string contains information describing this connection

Definition at line 78 of file FeedService.cpp.

bool pion::plugins::FeedHandler::sendResponse ( void   ) 

sends an HTTP response over the TCP connection

Returns:
true if the response was sent successfully, or false if not

Definition at line 50 of file FeedService.cpp.

References pion::net::HTTPMessage::createContentBuffer(), getConnectionId(), m_reaction_engine, m_tcp_conn, pion::net::HTTPMessage::send(), pion::net::HTTPMessage::setContentLength(), pion::net::HTTPMessage::setContentType(), pion::net::HTTPResponse::setStatusCode(), pion::net::HTTPResponse::setStatusMessage(), and pion::platform::ReactionEngine::writeConnectionsXML().

Referenced by pion::plugins::FeedReader::start(), and pion::plugins::FeedWriter::start().


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