S3FC project page S3FC home page

Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

s3_rpc_caller_m Class Template Reference

Abstract Base Class representing a caller that invokes a member function (method) of an object of type T_obj. More...

#include <s3_rpc.h>

Inheritance diagram for s3_rpc_caller_m:

Inheritance graph
[legend]
List of all members.

Public Methods

virtual void call (T_obj *obj, const std::vector< std::string > &args)=0
 Invoke the bound method of the T_obj instance obj. More...

virtual unsigned int get_num_params ()=0
 Return the number of parameters that the method that is invoked by call requires. More...


Static Protected Methods

s3_rpc_exception err_invalid_args (const std::string &where, const std::vector< std::string > &args)
 Instantiate and return an exception indicating that an invalid argument was passed to the remotely invoked method. More...


Detailed Description

template<typename T_obj>
class s3_rpc_caller_m< T_obj >

Abstract Base Class representing a caller that invokes a member function (method) of an object of type T_obj.

The caller is passed a string containing packed representations of the arguments that should be passed to the method. This allows a s3_rpc_caller_m to invoke any method of a non-static T_obj. A particular s3_rpc_caller_m instance is never bound to a T_obj instance and a reference to a T_obj is passed during each call invocation. It is, however, bound to a particular method (requiring an instance for each method that is called). As the type of the method depends on the derived class, it is not specified in the this interface.

In order to call a method using this interface (i.e. via the call() method), s3_rpc_caller_m should be subclassed to create a new class capable of being bound to a particular method. This derived class is then responsible for converting the string arguments to their real types and forwarding to the method.

The current interface only supports the calling of non-const methods (i.e. mutators).

A number of generic (templated) classes, derived from s3_rpc_caller_m, supporting different method types are available.

Definition at line 113 of file s3_rpc.h.


Member Function Documentation

template<typename T_obj>
virtual void s3_rpc_caller_m< T_obj >::call T_obj *    obj,
const std::vector< std::string > &    args
[pure virtual]
 

Invoke the bound method of the T_obj instance obj.

Implemented in s3_rpc_caller_m_v_v.

template<typename T_obj>
s3_rpc_exception s3_rpc_caller_m< T_obj >::err_invalid_args const std::string &    where,
const std::vector< std::string > &    args
[static, protected]
 

Instantiate and return an exception indicating that an invalid argument was passed to the remotely invoked method.

The error string contains the name s3_rpc_caller_m function that detected the error as well as the argument string.

Parameters:
where  String indicating where the error occured.
args  The arguments passed to the caller function.
Returns:
s3_rpc_caller_exception containing details about the error.

Definition at line 27 of file s3_rpc.tcc.

Referenced by s3_rpc_caller_m_v_t2::call, s3_rpc_caller_m_v_t1::call, and s3_rpc_caller_m_v_v::call.

template<typename T_obj>
virtual unsigned int s3_rpc_caller_m< T_obj >::get_num_params   [pure virtual]
 

Return the number of parameters that the method that is invoked by call requires.

Implemented in s3_rpc_caller_m_v_v.


The documentation for this class was generated from the following files:
Send comments to: s3fc@stonethree.com SourceForge Logo