Savarese Software Research Corporation
ServiceProtocolProcessor< PackingTraits > Class Template Reference

#include <service.h>

Public Types

enum   State { Starting, Started, Stopping, Stopped }
 
typedef PackingTraits  packing_traits
 
typedef protocol::ContinuationCaller< packing_traits caller_type
 

Public Member Functions

  ServiceProtocolProcessor (caller_type &caller)
 
virtual  ~ServiceProtocolProcessor ()=default
 
std::string  name () const
 
State  state () const
 
void  start ()
 
void  stop ()
 
void  membership (const MessageInfo &msginfo, const MembershipInfo &meminfo)
 
void  request (MessageInfo &msginfo)
 
void  response (MessageInfo &msginfo)
 
timeout_ptr  schedule_timeout (const timeout_handler &handler, const TimeValue &timeout, const bool once=EventLoop::Persist)
 
void  cancel_timeout (const timeout_ptr &timeout)
 
void  clear_timeouts ()
 
ServiceContext::timeout_map::size_type  count_timeouts () const
 

Static Public Attributes

static const bool  GroupMembership = GroupMembershipDisable
  Subclasses should redefine this variable to override behavior. More...
 

Protected Member Functions

ServiceContext context ()
 
virtual void  process_membership_message (const MessageInfo &msginfo, const MembershipInfo &meminfo)
 
template<typename MessageType , typename Impl >
void  request (Impl &impl, MessageType &msg, MessageInfo &msginfo) SSRC_DECL_THROW(boost
 
template<typename MessageType , typename Impl >
void  request (Impl &impl, MessageInfo &msginfo) SSRC_DECL_THROW(boost
 
template<typename MessageType , typename Impl >
void  respond (Impl &impl, MessageType &msg, MessageInfo &msginfo) SSRC_DECL_THROW(boost
 
template<typename MessageType , typename Impl >
void  respond (Impl &impl, MessageInfo &msginfo) SSRC_DECL_THROW(boost
 
bool  set_request_handler (const message_handler_entry &handler)
 
message_handler_map::size_type  remove_request_handler (const message_handler_entry &handler)
 
void  clear_request_handlers ()
 
template<typename MessageType , typename Impl >
bool  set_request_handler (Impl &impl)
 
template<typename MessageType , typename Impl >
bool  set_request_handler (Impl &impl, MessageType &buffer)
 
bool  set_response_handler (const message_handler_entry &handler)
 
message_handler_map::size_type  remove_response_handler (const message_handler_entry &handler)
 
void  clear_response_handlers ()
 
template<typename MessageType , typename Impl >
bool  set_response_handler (Impl &impl)
 
template<typename MessageType , typename Impl >
bool  set_response_handler (Impl &impl, MessageType &buffer)
 
virtual void  transition (State state)
 

Protected Attributes

caller_type _caller
 

Friends

template<typename PP >
class  ServiceEventHandler
 

Detailed Description

template<typename PackingTraits = BinaryPackingTraits>
class ServiceProtocolProcessor< PackingTraits >

Definition at line 191 of file service/service.h.

Member Typedef Documentation

template<typename PackingTraits = BinaryPackingTraits>
typedef protocol::ContinuationCaller<packing_traits> ServiceProtocolProcessor< PackingTraits >::caller_type

Definition at line 194 of file service/service.h.

template<typename PackingTraits = BinaryPackingTraits>
typedef PackingTraits ServiceProtocolProcessor< PackingTraits >::packing_traits

Definition at line 193 of file service/service.h.

Member Enumeration Documentation

template<typename PackingTraits = BinaryPackingTraits>
enum ServiceProtocolProcessor::State
Enumerator
Starting 
Started 
Stopping 
Stopped 

Definition at line 196 of file service/service.h.

Constructor & Destructor Documentation

template<typename PackingTraits = BinaryPackingTraits>
ServiceProtocolProcessor< PackingTraits >::ServiceProtocolProcessor ( caller_type caller )
inlineexplicit

Definition at line 337 of file service/service.h.

template<typename PackingTraits = BinaryPackingTraits>
virtual ServiceProtocolProcessor< PackingTraits >::~ServiceProtocolProcessor ( )
virtualdefault

Member Function Documentation

template<typename PackingTraits = BinaryPackingTraits>
void ServiceProtocolProcessor< PackingTraits >::cancel_timeout ( const timeout_ptr timeout )
inline

Definition at line 403 of file service/service.h.

References ServiceContext::remove_timeout().

template<typename PackingTraits = BinaryPackingTraits>
void ServiceProtocolProcessor< PackingTraits >::clear_request_handlers ( )
inlineprotected

Definition at line 276 of file service/service.h.

template<typename PackingTraits = BinaryPackingTraits>
void ServiceProtocolProcessor< PackingTraits >::clear_response_handlers ( )
inlineprotected

Definition at line 309 of file service/service.h.

template<typename PackingTraits = BinaryPackingTraits>
void ServiceProtocolProcessor< PackingTraits >::clear_timeouts ( )
inline

Definition at line 407 of file service/service.h.

References ServiceContext::clear_timeouts().

template<typename PackingTraits = BinaryPackingTraits>
ServiceContext& ServiceProtocolProcessor< PackingTraits >::context ( )
inlineprotected

Definition at line 223 of file service/service.h.

template<typename PackingTraits = BinaryPackingTraits>
ServiceContext::timeout_map::size_type ServiceProtocolProcessor< PackingTraits >::count_timeouts ( ) const
inline

Definition at line 411 of file service/service.h.

References ServiceContext::count_timeouts().

template<typename PackingTraits = BinaryPackingTraits>
void ServiceProtocolProcessor< PackingTraits >::membership ( const MessageInfo &  msginfo,
const MembershipInfo &  meminfo 
)
inline
template<typename PackingTraits = BinaryPackingTraits>
std::string ServiceProtocolProcessor< PackingTraits >::name ( ) const
inline

Definition at line 344 of file service/service.h.

template<typename PackingTraits = BinaryPackingTraits>
virtual void ServiceProtocolProcessor< PackingTraits >::process_membership_message ( const MessageInfo &  msginfo,
const MembershipInfo &  meminfo 
)
inlineprotectedvirtual
template<typename PackingTraits = BinaryPackingTraits>
message_handler_map::size_type ServiceProtocolProcessor< PackingTraits >::remove_request_handler ( const message_handler_entry handler )
inlineprotected

Definition at line 271 of file service/service.h.

template<typename PackingTraits = BinaryPackingTraits>
message_handler_map::size_type ServiceProtocolProcessor< PackingTraits >::remove_response_handler ( const message_handler_entry handler )
inlineprotected

Definition at line 304 of file service/service.h.

template<typename PackingTraits = BinaryPackingTraits>
template<typename MessageType , typename Impl >
void ServiceProtocolProcessor< PackingTraits >::request ( Impl &  impl,
MessageType &  msg,
MessageInfo &  msginfo 
)
inlineprotected
template<typename PackingTraits = BinaryPackingTraits>
template<typename MessageType , typename Impl >
void ServiceProtocolProcessor< PackingTraits >::request ( Impl &  impl,
MessageInfo &  msginfo 
)
inlineprotected
template<typename PackingTraits = BinaryPackingTraits>
void ServiceProtocolProcessor< PackingTraits >::request ( MessageInfo &  msginfo )
inline

Definition at line 368 of file service/service.h.

template<typename PackingTraits = BinaryPackingTraits>
template<typename MessageType , typename Impl >
void ServiceProtocolProcessor< PackingTraits >::respond ( Impl &  impl,
MessageType &  msg,
MessageInfo &  msginfo 
)
inlineprotected
template<typename PackingTraits = BinaryPackingTraits>
template<typename MessageType , typename Impl >
void ServiceProtocolProcessor< PackingTraits >::respond ( Impl &  impl,
MessageInfo &  msginfo 
)
inlineprotected
template<typename PackingTraits = BinaryPackingTraits>
void ServiceProtocolProcessor< PackingTraits >::response ( MessageInfo &  msginfo )
inline

Definition at line 380 of file service/service.h.

template<typename PackingTraits = BinaryPackingTraits>
timeout_ptr ServiceProtocolProcessor< PackingTraits >::schedule_timeout ( const timeout_handler handler,
const TimeValue timeout,
const bool  once = EventLoop::Persist 
)
inline

Definition at line 396 of file service/service.h.

References ServiceContext::add_timeout().

template<typename PackingTraits = BinaryPackingTraits>
bool ServiceProtocolProcessor< PackingTraits >::set_request_handler ( const message_handler_entry handler )
inlineprotected
template<typename PackingTraits = BinaryPackingTraits>
template<typename MessageType , typename Impl >
bool ServiceProtocolProcessor< PackingTraits >::set_request_handler ( Impl &  impl )
inlineprotected
template<typename PackingTraits = BinaryPackingTraits>
template<typename MessageType , typename Impl >
bool ServiceProtocolProcessor< PackingTraits >::set_request_handler ( Impl &  impl,
MessageType &  buffer 
)
inlineprotected
template<typename PackingTraits = BinaryPackingTraits>
bool ServiceProtocolProcessor< PackingTraits >::set_response_handler ( const message_handler_entry handler )
inlineprotected
template<typename PackingTraits = BinaryPackingTraits>
template<typename MessageType , typename Impl >
bool ServiceProtocolProcessor< PackingTraits >::set_response_handler ( Impl &  impl )
inlineprotected
template<typename PackingTraits = BinaryPackingTraits>
template<typename MessageType , typename Impl >
bool ServiceProtocolProcessor< PackingTraits >::set_response_handler ( Impl &  impl,
MessageType &  buffer 
)
inlineprotected
template<typename PackingTraits = BinaryPackingTraits>
void ServiceProtocolProcessor< PackingTraits >::start ( )
inline
template<typename PackingTraits = BinaryPackingTraits>
State ServiceProtocolProcessor< PackingTraits >::state ( ) const
inline
template<typename PackingTraits = BinaryPackingTraits>
void ServiceProtocolProcessor< PackingTraits >::stop ( )
inline
template<typename PackingTraits = BinaryPackingTraits>
virtual void ServiceProtocolProcessor< PackingTraits >::transition ( State  state )
inlineprotectedvirtual

Friends And Related Function Documentation

template<typename PackingTraits = BinaryPackingTraits>
template<typename PP >
friend class ServiceEventHandler
friend

Definition at line 416 of file service/service.h.

Member Data Documentation

template<typename PackingTraits = BinaryPackingTraits>
caller_type& ServiceProtocolProcessor< PackingTraits >::_caller
protected

Definition at line 217 of file service/service.h.

template<typename PackingTraits = BinaryPackingTraits>
const bool ServiceProtocolProcessor< PackingTraits >::GroupMembership = GroupMembershipDisable
static

Subclasses should redefine this variable to override behavior.

We don't reference the template parameter so that you can subclass a protocol processor that is a concrete class that disables group membership and enable it in the subclass. Otherwise, every protocol processor would have to be a template class. The variable is used only by the Service template to initialize _caller.

Definition at line 206 of file service/service.h.


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

Savarese Software Research Corporation
Copyright © 2006-2012 Savarese Software Research Corporation. All rights reserved.