User manual

old releases - latest release - trunk

Result Class Template Reference

Inheritance diagram for Result:
Collaboration diagram for Result:

List of all members.


Detailed Description

template<class T>
class peekabot::client::Result< T >

Encapsulates a result from an operation, such as getting an object's color, executed remotely on the server.

It is built on top of Status -- which provide a mean to know whether the result is available for reading. The actual result cannot be gotten from the Result object until get_outcome() signals success.

Public Member Functions

 Result () throw ()
 Create an unused result object, not associated with the result from an operation.
 Result (boost::shared_ptr< OperationResult > result) throw ()
 Create a result object from an OperationResult.
const T get_result () const throw (std::runtime_error, std::logic_error)
 Return a copy of the result stored in the Result object.

Private Attributes

boost::shared_ptr
< OperationResult
m_result
 The object internally storing the data pertaining to the operation's result.


Member Function Documentation

const T get_result (  )  const throw (std::runtime_error, std::logic_error) [inline]

Return a copy of the result stored in the Result object.

Exceptions:
std::logic_error Thrown if 1) the operation failed or 2) the outcome operation is still pending.
std::runtime_error Thrown if the actual type of the result and the requested type T doesn't match (this implies a bug is lurking elsewhere).


Member Data Documentation

boost::shared_ptr<OperationResult> m_result [private]

The object internally storing the data pertaining to the operation's result.

Defined only when the object is constructed from a non-default constructor or has been assigned from another object with a valid m_result member.


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