Open Lighting Architecture  0.9.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
ola::rpc::RpcSession Class Reference

Detailed Description

Represents the RPC session between a client and server.

The RPCSession object contains information about the session an RPC is part of. For each RPC method on the server side, the RPCSession can be accessed via the RpcController::Session() method.

Sessions can have arbitary user data associated with them, similar to a cookie in an HTTP request. The user data is usually set in the call to RpcSessionHandlerInterface::NewClient() but can be set or modified in any of the RPC calls themselves.

Since the RPCSession object doesn't take ownership of the user data, its should be deleted in the call to RpcSessionHandlerInterface::ClientRemoved().

Public Member Functions

 RpcSession (RpcChannel *channel)
 Create a new session object.
RpcChannelChannel ()
 Returns the underlying RPCChannel.
void SetData (void *ptr)
 Associate user data with this session.
void * GetData () const
 Retrieve the user data associated with this session.

Constructor & Destructor Documentation

ola::rpc::RpcSession::RpcSession ( RpcChannel channel)
inlineexplicit

Create a new session object.

Parameters
channelthe RpcChannel that the session is using. Ownership is not transferred.

Member Function Documentation

RpcChannel* ola::rpc::RpcSession::Channel ( )
inline

Returns the underlying RPCChannel.

Returns
The RPCChannel that corresponds to this session.
void* ola::rpc::RpcSession::GetData ( ) const
inline

Retrieve the user data associated with this session.

Returns
The user data associated with the session.
void ola::rpc::RpcSession::SetData ( void *  ptr)
inline

Associate user data with this session.

Parameters
ptrOpaque user data to associate with this session. Ownership is not transferred.

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