MACE  1.0.0
 All Classes Namespaces Files Functions Variables Enumerations Defines
Classes | Public Types | Public Member Functions | Public Attributes | Protected Member Functions
mace::rpc::connection< IODelegate > Class Template Reference

#include <connection.hpp>

Inheritance diagram for mace::rpc::connection< IODelegate >:
mace::rpc::connection_base mace::rpc::tcp::connection< IODelegate > mace::rpc::http::connection< IODelegate >

List of all members.

Classes

struct  add_interface_visitor
struct  rpc_recv_functor

Public Types

typedef boost::shared_ptr
< connection
ptr
typedef IODelegate io_delegate_type

Public Member Functions

template<typename R , typename ParamSeq >
cmt::future< R > call_fused (const std::string &id, ParamSeq &&params)
template<typename ParamSeq >
void notice_fused (const std::string &id, ParamSeq &&params)
template<typename R , typename ParamSeq >
cmt::future< R > call_fused (std::string &&id, ParamSeq &&params)
template<typename ParamSeq >
void notice_fused (std::string &&id, ParamSeq &&params)
template<typename Signature >
std::string add_method (const boost::function< Signature > &m)
template<typename Signature >
boost::function< Signature > create_callback (const std::string &name)

Public Attributes

boost::signal< void()> closed

Protected Member Functions

 connection (detail::connection_base *b)

Detailed Description

template<typename IODelegate>
class mace::rpc::connection< IODelegate >

Template Parameters:
IODelegatemust implement the following expressions

datavec IODelegate::pack<T> ( Filter&, const T& ) size_t IODelegate::packsize<T>( Filter&, const T& ) R IODelegate::unpack<R> ( Filter&, const datavec& )

Template Parameters:
Filtermust implement the following expressions template<typename T,typename R> R operator()( const T& v ) -> returns the data to pack in place of v

template<typename T, typename R> void operator()( R& r, T& v ) -> given r, assign to v.

template<typename T> const bool is_filtered(const T*)const { return false; }

template<typename Signature> const bool is_filtered(const boost::function<Signature>*)const { return true; }

unpack( Filter& f, Stream& s, T& v ) { if( f.is_filtered(&v) ) { // optimizing compiler should reduce this to 1 use case. boost::remove_reference<decltype(f(T()))>::type r; unpack(f,s,r) f( r, v ); } else { // do your thing... } }

Definition at line 48 of file connection.hpp.


Member Function Documentation

template<typename IODelegate >
template<typename Signature >
std::string mace::rpc::connection< IODelegate >::add_method ( const boost::function< Signature > &  m) [inline]

Adds a new 'anonymous' method and returns the name generated for it.

Definition at line 88 of file connection.hpp.

template<typename IODelegate >
template<typename Signature >
boost::function<Signature> mace::rpc::connection< IODelegate >::create_callback ( const std::string &  name) [inline]
Returns:
a functor that will call this->call(name, params)

Definition at line 97 of file connection.hpp.


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