Kyoto Tycoon

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Classes | Public Member Functions | Friends
kyototycoon::ThreadedServer::Session Class Reference

Interface to access each session data. More...

`#include <ktthserv.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.
Data * | data ()
| Get the session local data.
## Friends
class | ThreadedServer

## Detailed Description

Interface to access each session data.

## Member Function Documentation

uint64_t kyototycoon::ThreadedServer::Session::id | ( |  | ) |

Get the ID number of the session.

Returns:
  the ID number of the session.

uint32_t kyototycoon::ThreadedServer::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::ThreadedServer::Session::set_data | ( | Data * | data | ) |

Set the session local data.

Parameters:

  data | the 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::ThreadedServer::Session::data | ( |  | ) |

Get the session local data.

Returns:
  the session local data, or NULL if no data is registered.