Public Member Functions

wosh::Request Class Reference

Requests are the way Methods are called remotely within WOSH system. More...

#include <H:/WOSH/win32_vc2010/src/core/Request.h>

List of all members.

Public Member Functions

 Request ()
 Empty constructor.
 Request (const std::string &method)
 Constructor with initializer(s), provided for convenience.
 Request (const std::string &method, ISerializable *data)
 Constructor with initializer(s), provided for convenience.
 Request (const Request &m)
 Copy constructor.
virtual ~Request ()
 Empty destructor.
ResponsereplyResponse (WRESULT ReturnValue, ISerializable *data) const
 Create a new Response object from current Request, initialized with arguments.
ResponsereplyResponse (WRESULT ReturnValue, const char *message) const
 Create a new Response object from current Request, initialized with arguments.
ResponsereplyResponse (WRESULT ReturnValue) const
 Create a new Response object from current Request, initialized with arguments.
Getters
const std::string & getMethod () const
 Get the method (name) associated with the request.
const VariantgetArgument () const
 Get the data object converted as wosh::Variant object.
int extractArguments (Variant &arg0) const
 Extract first argument from the request-content. Supports Variant and List content.
int extractArguments (Variant &arg0, Variant &arg1) const
 Extract first and second argument from the request-content. Supports Variant and List content.
int extractArguments (Variant &arg0, Variant &arg1, Variant &arg2) const
 Extract first, second and third argument from the request-content. Supports Variant and List content.
virtual long getOptions () const
virtual long getReasons () const
bool getOmitResponse () const
 Get the 'Omit-Response' flag.
bool getOmitContent () const
bool getIncludeRequest () const
virtual MessageContent::TYPE getType () const
 Get MessageContent::TYPE of this implementation: a ACTION.
Setters
void setMethod (const std::string &value)
 Set the method (name) associated with the request.
virtual void setOptions (long value)
virtual void setReasons (long value)
void setOmitResponse (bool value=true)
 Set the 'Omit-Response' flag.
void setOmitContent (bool value=true)
void setIncludeRequest (bool value=true)
Operators Overloading
virtual Requestoperator= (const Request &m)
virtual bool operator== (const Request &other) const
virtual bool operator!= (const Request &other) const
Serialization interface
virtual long compare (const wosh::IComparable *filter, long options) const
 Compare object against another of same type.

Protected Attributes

Internal vars
long options
long reasons

Detailed Description

Requests are the way Methods are called remotely within WOSH system.

Conceptually, a request is a triple consisting of an object reference, the name of an operation and a list of actual parameters. An object request is similar to a method invocation in an object-oriented programming language

Version:
0.8.499
Id:
Request.h 3775 2011-01-01 16:38:17Z alex
Author:
Alessandro Polo

Definition at line 53 of file Request.h.


Constructor & Destructor Documentation

wosh::Request::Request (  )

Empty constructor.

Definition at line 50 of file Request.cpp.

wosh::Request::Request ( const std::string &  method ) [explicit]

Constructor with initializer(s), provided for convenience.

Parameters:
[in]methodthe method name to be executed

Definition at line 54 of file Request.cpp.

wosh::Request::Request ( const std::string &  method,
ISerializable data 
) [explicit]

Constructor with initializer(s), provided for convenience.

Parameters:
[in]methodthe method name to be executed
[in]datathe data object (ISerializable abstraction) associated with the request. May be NULL.

Definition at line 58 of file Request.cpp.

wosh::Request::Request ( const Request m )

Copy constructor.

Parameters:
m[in] the source object to be copied

Definition at line 62 of file Request.cpp.

virtual wosh::Request::~Request (  ) [inline, virtual]

Empty destructor.

Definition at line 95 of file Request.h.


Member Function Documentation

long wosh::Request::compare ( const wosh::IComparable filter,
long  option_mask 
) const [virtual]

Compare object against another of same type.

Parameters:
filter[in] the object to be compared
option_mask[in] flags of the comparison, OR of enum COMPARISON_OPTIONS
Returns:
when object are identical return 0; return -1 when object are of different types
See also:
WOSH_COMPARE_RTTI

Implements wosh::IComparable.

Definition at line 91 of file Request.cpp.

int wosh::Request::extractArguments ( Variant arg0,
Variant arg1,
Variant arg2 
) const

Extract first, second and third argument from the request-content. Supports Variant and List content.

Parameters:
arg0[out] the output first-argument value, updated only on success. using extractArguments(arg0) call, supports Variant content
arg1[out] the output second-argument value, updated only on success (of both etractions). content must be a List to extract second argument
arg2[out] the output third-argument value, see second-argument strategy
Returns:
number of successfully extracteed arguments [0,1,2,3]

Definition at line 194 of file Request.cpp.

References extractArguments().

int wosh::Request::extractArguments ( Variant arg0 ) const

Extract first argument from the request-content. Supports Variant and List content.

Parameters:
arg0[out] the output argument value, updated only on success
Returns:
number of successfully extracteed arguments [0,1]

Definition at line 153 of file Request.cpp.

Referenced by wosh::SharedMemoryEpidemic::busMessage(), extractArguments(), wosh::BundleManager::mmDoLoadBundle(), wosh::MPC_mmDoChMod(), wosh::MPC_mmDoChOwn(), and wosh::MPC_mmDoPropertySet().

int wosh::Request::extractArguments ( Variant arg0,
Variant arg1 
) const

Extract first and second argument from the request-content. Supports Variant and List content.

Parameters:
arg0[out] the output first-argument value, updated only on success. using extractArguments(arg0) call, supports Variant content
arg1[out] the output second-argument value, updated only on success (of both etractions). content must be a List to extract second argument
Returns:
number of successfully extracteed arguments [0,1,2]

Definition at line 177 of file Request.cpp.

References extractArguments().

const Variant & wosh::Request::getArgument (  ) const

Get the data object converted as wosh::Variant object.

Returns:
constant reference to request argument (converted).
Warning:
Casting assumes it is a valid wosh::Variant object, else an empty wosh::Variant object will be returned.

Definition at line 142 of file Request.cpp.

References wosh::Variant::EmptyVariant.

Referenced by wosh::bundles::ModemDslBundle::mmDoCheckConnected(), wosh::BundleManager::mmDoLoadBundle(), wosh::MPC_mmDoChMod(), and wosh::MPC_mmDoChOwn().

const std::string& wosh::Request::getMethod (  ) const [inline]

Get the method (name) associated with the request.

Returns:
constant STL string reference (to internal field)

Definition at line 130 of file Request.h.

Referenced by wosh::SharedMemoryEpidemic::busMessage(), wosh::SharedMemoryDsm::busMessage(), wosh::SharedMemory::busMessage(), wosh::PersistenceManager::busMessage(), and wosh::NetworkManager::busMessage().

bool wosh::Request::getOmitResponse (  ) const [inline]

Get the 'Omit-Response' flag.

Returns:
true when executer shouldn't reply with a wosh::Response message

Definition at line 168 of file Request.h.

Referenced by replyResponse().

virtual MessageContent::TYPE wosh::Request::getType (  ) const [inline, virtual]

Get MessageContent::TYPE of this implementation: a ACTION.

Returns:
MessageContent::ACTION

Implements wosh::MessageContent.

Definition at line 176 of file Request.h.

Response * wosh::Request::replyResponse ( WRESULT  ReturnValue,
const char *  message 
) const

Create a new Response object from current Request, initialized with arguments.

Parameters:
ReturnValue[in] the returned value of the call
message[in] c-string message (NULL terminated) describing the error. NULL value acts as replyResponse(ReturnValue)
Returns:
pointer to a new Response object (ownership is acquired by caller)

Definition at line 134 of file Request.cpp.

References replyResponse().

Response* wosh::Request::replyResponse ( WRESULT  ReturnValue ) const [inline]

Create a new Response object from current Request, initialized with arguments.

Parameters:
ReturnValue[in] the returned value of the call
Returns:
pointer to a new Response object (ownership is acquired by caller)

Definition at line 118 of file Request.h.

References replyResponse().

Response * wosh::Request::replyResponse ( WRESULT  ReturnValue,
ISerializable data 
) const
void wosh::Request::setMethod ( const std::string &  value ) [inline]

Set the method (name) associated with the request.

Parameters:
[in]valuethe method string to be assigned
See also:
setContentContext()

Definition at line 188 of file Request.h.

void wosh::Request::setOmitResponse ( bool  value = true )

Set the 'Omit-Response' flag.

Parameters:
[in]valueboolean value, when true, executer will omit to reply with a wosh::Response message

Definition at line 75 of file Request.cpp.


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

Generated on Tue Feb 8 2011 09:33:31 for WOSH system 0.8.888 [wolf] by Alessandro Polo, using DoxyGen 1.7.2 hosted by WOSH Framework