Kyoto Tycoon
Classes | Public Member Functions | Friends

kyototycoon::HTTPServer::Session Class Reference

Interface to access each session data. More...

#include <kthttp.h>

List of all members.

Classes

class  Data
 Interface of session local data. More...

Public Member Functions

uint64_t id ()
 Get the ID number of the session.
uint32_t thread_id ()
 Get the ID number of the worker thread.
void set_data (Data *data)
 Set the session local data.
Datadata ()
 Get the session local data.
const std::string expression ()
 Get the expression of the socket.

Friends

class HTTPServer

Detailed Description

Interface to access each session data.


Member Function Documentation

uint64_t kyototycoon::HTTPServer::Session::id ( )

Get the ID number of the session.

Returns:
the ID number of the session.
uint32_t kyototycoon::HTTPServer::Session::thread_id ( )

Get the ID number of the worker thread.

Returns:
the ID number of the worker thread. It is from 0 to less than the number of worker threads.
void kyototycoon::HTTPServer::Session::set_data ( Data data)

Set the session local data.

Parameters:
datathe session local data. If it is NULL, no data is registered.
Note:
The registered data is destroyed implicitly when the session object is destroyed or this method is called again.
Data* kyototycoon::HTTPServer::Session::data ( )

Get the session local data.

Returns:
the session local data, or NULL if no data is registered.
const std::string kyototycoon::HTTPServer::Session::expression ( )

Get the expression of the socket.

Returns:
the expression of the socket or an empty string on failure.