Classes | Enumerations | Enumerator | Functions | Variables
clanNetwork NetGame

## Classes
class | clan::NetGameClient
| NetGameClient. More...
class | clan::NetGameConnection
| NetGameConnection. More...
class | clan::NetGameConnectionSite
| NetGameConnectionSite. More...
class | clan::NetGameEvent
| NetGameEvent. More...
class | clan::NetGameEventValue
| NetGameEventValue. More...
class | clan::NetGameServer
| NetGameServer. More...

## Enumerations
enum | clan::NetGameEventValue::Type { clan::NetGameEventValue::null, clan::NetGameEventValue::integer, clan::NetGameEventValue::uinteger, clan::NetGameEventValue::character, clan::NetGameEventValue::ucharacter, clan::NetGameEventValue::string, clan::NetGameEventValue::boolean, clan::NetGameEventValue::number, clan::NetGameEventValue::complex, clan::NetGameEventValue::binary }

## Functions
| clan::NetGameClient::NetGameClient ()
| clan::NetGameConnection::NetGameConnection (NetGameConnectionSite *site, const TCPConnection &connection)
| Constructs a NetGameConnection. More...
| clan::NetGameConnection::NetGameConnection (NetGameConnectionSite *site, const SocketName &socket_name)
| clan::NetGameEvent::NetGameEvent (const std::string &name, std::vector< NetGameEventValue > arg={})
| Constructs a NetGameEvent. More...
| clan::NetGameEventValue::NetGameEventValue ()
| clan::NetGameEventValue::NetGameEventValue (int value)
| Constructs a NetGameEventValue. More...
| clan::NetGameEventValue::NetGameEventValue (unsigned int value)
| Constructs a NetGameEventValue. More...
| clan::NetGameEventValue::NetGameEventValue (char value)
| Constructs a NetGameEventValue. More...
| clan::NetGameEventValue::NetGameEventValue (unsigned char value)
| Constructs a NetGameEventValue. More...
| clan::NetGameEventValue::NetGameEventValue (float value)
| Constructs a NetGameEventValue. More...
| clan::NetGameEventValue::NetGameEventValue (const std::string &value)
| Constructs a NetGameEventValue. More...
| clan::NetGameEventValue::NetGameEventValue (const char *str)
| Constructs a NetGameEventValue. More...
| clan::NetGameEventValue::NetGameEventValue (const wchar_t *str)
| Constructs a NetGameEventValue. More...
| clan::NetGameEventValue::NetGameEventValue (bool value)
| Constructs a NetGameEventValue. More...
| clan::NetGameEventValue::NetGameEventValue (const DataBuffer &value)
| Constructs a NetGameEventValue. More...
| clan::NetGameEventValue::NetGameEventValue (Type type)
| Constructs a NetGameEventValue. More...
| clan::NetGameServer::NetGameServer ()
| clan::NetGameClient::~NetGameClient ()
| clan::NetGameConnection::~NetGameConnection ()
| clan::NetGameServer::~NetGameServer ()
void | clan::NetGameEvent::add_argument (const NetGameEventValue &value)
void | clan::NetGameEventValue::add_member (const NetGameEventValue &value)
| Add member. More...
virtual void | clan::NetGameConnectionSite::add_network_event (const NetGameNetworkEvent &e)=0
| Add network event. More...
void | clan::NetGameClient::connect (const std::string &server, const std::string &port)
| Connect. More...
void | clan::NetGameClient::disconnect ()
| Disconnect. More...
void | clan::NetGameConnection::disconnect ()
| Disconnects a client. More...
NetGameEventValue | clan::NetGameEvent::get_argument (unsigned int index) const
unsigned int | clan::NetGameEvent::get_argument_count () const
DataBuffer | clan::NetGameEventValue::get_binary () const
| To binary. More...
bool | clan::NetGameEventValue::get_boolean () const
| To boolean. More...
int | clan::NetGameEventValue::get_character () const
| To character. More...
void * | clan::NetGameConnection::get_data (const std::string &name) const
| Get data. More...
int | clan::NetGameEventValue::get_integer () const
| To integer. More...
const NetGameEventValue & | clan::NetGameEventValue::get_member (unsigned int index) const
unsigned int | clan::NetGameEventValue::get_member_count () const
std::string | clan::NetGameEvent::get_name () const
float | clan::NetGameEventValue::get_number () const
| To number. More...
SocketName | clan::NetGameConnection::get_remote_name () const
| Get Remote name. More...
std::string | clan::NetGameEventValue::get_string () const
| To string. More...
Type | clan::NetGameEventValue::get_type () const
| Get Type. More...
unsigned int | clan::NetGameEventValue::get_ucharacter () const
| To unsigned character. More...
unsigned int | clan::NetGameEventValue::get_uinteger () const
| To unsigned integer. More...
bool | clan::NetGameEventValue::is_binary () const
| Is Binary. More...
bool | clan::NetGameEventValue::is_boolean () const
| Is Boolean. More...
bool | clan::NetGameEventValue::is_character () const
| Is Character. More...
bool | clan::NetGameEventValue::is_complex () const
| Is Complex. More...
bool | clan::NetGameEventValue::is_integer () const
| Is Integer. More...
bool | clan::NetGameEventValue::is_null () const
| Is Null. More...
bool | clan::NetGameEventValue::is_number () const
| Is Number. More...
bool | clan::NetGameEventValue::is_string () const
| Is String. More...
bool | clan::NetGameEventValue::is_ucharacter () const
| Is Ucharacter. More...
bool | clan::NetGameEventValue::is_uinteger () const
| Is Uinteger. More...
| clan::NetGameEventValue::operator bool () const
| clan::NetGameEventValue::operator DataBuffer () const
| clan::NetGameEventValue::operator float () const
| clan::NetGameEventValue::operator int () const
| clan::NetGameEventValue::operator std::string () const
| clan::NetGameEventValue::operator unsigned char () const
| clan::NetGameEventValue::operator unsigned int () const
void | clan::NetGameClient::process_events ()
| Process events. More...
void | clan::NetGameServer::process_events ()
| Process events. More...
void | clan::NetGameClient::send_event (const NetGameEvent &game_event)
| Send event. More...
void | clan::NetGameServer::send_event (const NetGameEvent &game_event)
| Send event. More...
void | clan::NetGameConnection::send_event (const NetGameEvent &game_event)
| Send event. More...
void | clan::NetGameConnection::set_data (const std::string &name, void *data)
| Set data. More...
void | clan::NetGameEventValue::set_member (unsigned int index, const NetGameEventValue &value)
| Set member. More...
Signal< void(NetGameConnection *)> & | clan::NetGameServer::sig_client_connected ()
Signal< void(NetGameConnection *, const std::string &)> & | clan::NetGameServer::sig_client_disconnected ()
Signal< void()> & | clan::NetGameClient::sig_connected ()
| Sig connected. More...
Signal< void()> & | clan::NetGameClient::sig_disconnected ()
| Sig disconnected. More...
Signal< void(const NetGameEvent &)> & | clan::NetGameClient::sig_event_received ()
Signal< void(NetGameConnection *, const NetGameEvent &)> & | clan::NetGameServer::sig_event_received ()
void | clan::NetGameServer::start (const std::string &port)
| Start. More...
void | clan::NetGameServer::start (const std::string &address, const std::string &port)
| Start. More...
void | clan::NetGameServer::stop ()
| Stop. More...
std::string | clan::NetGameEvent::to_string () const
static std::string | clan::NetGameEventValue::to_string (const NetGameEventValue &)
| Helper function to obtain a string representation of an EventValue object. More...

## Variables
bool clan::NetGameEventValue::value_bool
char clan::NetGameEventValue::value_char
float clan::NetGameEventValue::value_float
int clan::NetGameEventValue::value_int
unsigned char clan::NetGameEventValue::value_uchar
unsigned int clan::NetGameEventValue::value_uint

## Detailed Description

## Enumeration Type Documentation

enum clan::NetGameEventValue::Type

Enumerator
null |
integer |
uinteger |
character |
ucharacter |
string |
boolean |
number |
complex |
binary |

## Function Documentation

clan::NetGameClient::NetGameClient | ( |  | ) |

clan::NetGameConnection::NetGameConnection | ( | NetGameConnectionSite * | site,
|  | const TCPConnection & | connection
| ) |  |

Constructs a NetGameConnection.

Parameters

  site | = Net Game Connection Site
  connection | = TCPConnection

clan::NetGameConnection::NetGameConnection | ( | NetGameConnectionSite * | site,
|  | const SocketName & | socket_name
| ) |  |

clan::NetGameEvent::NetGameEvent | ( | const std::string & | name,
|  | std::vector< NetGameEventValue > | arg = `{}`
| ) |  |

Constructs a NetGameEvent.

clan::NetGameEventValue::NetGameEventValue | ( |  | ) |

clan::NetGameEventValue::NetGameEventValue | ( | int | value | ) |

Constructs a NetGameEventValue.

Parameters

  value | = value

clan::NetGameEventValue::NetGameEventValue | ( | unsigned int | value | ) |

Constructs a NetGameEventValue.

Parameters

  value | = value

clan::NetGameEventValue::NetGameEventValue | ( | char | value | ) |

Constructs a NetGameEventValue.

Parameters

  value | = value

clan::NetGameEventValue::NetGameEventValue | ( | unsigned char | value | ) |

Constructs a NetGameEventValue.

Parameters

  value | = value

clan::NetGameEventValue::NetGameEventValue | ( | float | value | ) |

Constructs a NetGameEventValue.

Parameters

  value | = value

clan::NetGameEventValue::NetGameEventValue | ( | const std::string & | value | ) |

Constructs a NetGameEventValue.

Parameters

  value | = String

clan::NetGameEventValue::NetGameEventValue | ( | const char * | str | ) |

Constructs a NetGameEventValue.

Parameters

  str | = char

clan::NetGameEventValue::NetGameEventValue | ( | const wchar_t * | str | ) |

Constructs a NetGameEventValue.

Parameters

  str | = wchar_t

clan::NetGameEventValue::NetGameEventValue | ( | bool | value | ) |
| explicit

Constructs a NetGameEventValue.

Parameters

  value | = bool

clan::NetGameEventValue::NetGameEventValue | ( | const DataBuffer & | value | ) |

Constructs a NetGameEventValue.

Parameters

  value | = DataBuffer

clan::NetGameEventValue::NetGameEventValue | ( | Type | type | ) |

Constructs a NetGameEventValue.

Parameters

  type | = Type

clan::NetGameServer::NetGameServer | ( |  | ) |

clan::NetGameClient::~NetGameClient | ( |  | ) |

clan::NetGameConnection::~NetGameConnection | ( |  | ) |

clan::NetGameServer::~NetGameServer | ( |  | ) |

void clan::NetGameEvent::add_argument | ( | const NetGameEventValue & | value | ) |

Adds an argument into this event.

Parameters

  value | The argument to store inside this event.

void clan::NetGameEventValue::add_member | ( | const NetGameEventValue & | value | ) |

Add member.

Parameters

  value | = Net Game Event Value

virtual void clan::NetGameConnectionSite::add_network_event | ( | const NetGameNetworkEvent & | e | ) |
| pure virtual

Add network event.

Parameters

  e | = Net Game Network Event

void clan::NetGameClient::connect | ( | const std::string & | server,
|  | const std::string & | port
| ) |  |

Connect.

Parameters

  server | = String
  port | = String

void clan::NetGameClient::disconnect | ( |  | ) |

Disconnect.

void clan::NetGameConnection::disconnect | ( |  | ) |

Disconnects a client.

NetGameEventValue clan::NetGameEvent::get_argument | ( | unsigned int | index | ) | const

Retrieves an argument in this event.

Parameters

  index | Index number of the argument to retrieve.

Returns
  A NetGameEventValue object containing the argument value.

unsigned int clan::NetGameEvent::get_argument_count | ( |  | ) | const

Returns
  The number of arguments stored in this event.

DataBuffer clan::NetGameEventValue::get_binary | ( |  | ) | const

To binary.

Returns
  binary

Referenced by clan::NetGameEventValue::operator DataBuffer().

bool clan::NetGameEventValue::get_boolean | ( |  | ) | const

To boolean.

Returns
  bool

Referenced by clan::NetGameEventValue::operator bool().

int clan::NetGameEventValue::get_character | ( |  | ) | const

To character.

Returns
  char

void* clan::NetGameConnection::get_data | ( | const std::string & | name | ) | const

Get data.

Parameters

  name | = String Ref

Returns
  void

int clan::NetGameEventValue::get_integer | ( |  | ) | const

To integer.

Returns
  int

Referenced by clan::NetGameEventValue::operator int().

const NetGameEventValue& clan::NetGameEventValue::get_member | ( | unsigned int | index | ) | const

unsigned int clan::NetGameEventValue::get_member_count | ( |  | ) | const

std::string clan::NetGameEvent::get_name | ( |  | ) | const
| inline

Returns
  The name of this event.

Referenced by clan::NetGameEventDispatcher< Params >::dispatch().

float clan::NetGameEventValue::get_number | ( |  | ) | const

To number.

Returns
  float

Referenced by clan::NetGameEventValue::operator float().

SocketName clan::NetGameConnection::get_remote_name | ( |  | ) | const

Get Remote name.

Returns
  remote_name

std::string clan::NetGameEventValue::get_string | ( |  | ) | const

To string.

Returns
  String

Referenced by clan::NetGameEventValue::operator std::string().

Type clan::NetGameEventValue::get_type | ( |  | ) | const

Get Type.

Returns
  type

unsigned int clan::NetGameEventValue::get_ucharacter | ( |  | ) | const

To unsigned character.

Returns
  unsigned char

Referenced by clan::NetGameEventValue::operator unsigned char().

unsigned int clan::NetGameEventValue::get_uinteger | ( |  | ) | const

To unsigned integer.

Returns
  unsigned int

Referenced by clan::NetGameEventValue::operator unsigned int().

bool clan::NetGameEventValue::is_binary | ( |  | ) | const

Is Binary.

Returns
  true = binary

bool clan::NetGameEventValue::is_boolean | ( |  | ) | const

Is Boolean.

Returns
  true = boolean

bool clan::NetGameEventValue::is_character | ( |  | ) | const

Is Character.

Returns
  true = character

bool clan::NetGameEventValue::is_complex | ( |  | ) | const

Is Complex.

Returns
  true = complex

bool clan::NetGameEventValue::is_integer | ( |  | ) | const

Is Integer.

Returns
  true = integer

bool clan::NetGameEventValue::is_null | ( |  | ) | const

Is Null.

Returns
  true = null

bool clan::NetGameEventValue::is_number | ( |  | ) | const

Is Number.

Returns
  true = number

bool clan::NetGameEventValue::is_string | ( |  | ) | const

Is String.

Returns
  true = string

bool clan::NetGameEventValue::is_ucharacter | ( |  | ) | const

Is Ucharacter.

Returns
  true = ucharacter

bool clan::NetGameEventValue::is_uinteger | ( |  | ) | const

Is Uinteger.

Returns
  true = uinteger

clan::NetGameEventValue::operator bool | ( |  | ) | const
| inline

References clan::NetGameEventValue::get_boolean().

clan::NetGameEventValue::operator DataBuffer | ( |  | ) | const
| inline

References clan::NetGameEventValue::get_binary().

clan::NetGameEventValue::operator float | ( |  | ) | const
| inline

References clan::NetGameEventValue::get_number().

clan::NetGameEventValue::operator int | ( |  | ) | const
| inline

References clan::NetGameEventValue::get_integer().

clan::NetGameEventValue::operator std::string | ( |  | ) | const
| inline

References clan::NetGameEventValue::get_string().

clan::NetGameEventValue::operator unsigned char | ( |  | ) | const
| inline

References clan::NetGameEventValue::get_ucharacter().

clan::NetGameEventValue::operator unsigned int | ( |  | ) | const
| inline

References clan::NetGameEventValue::get_uinteger().

void clan::NetGameClient::process_events | ( |  | ) |

Process events.

void clan::NetGameServer::process_events | ( |  | ) |

Process events.

void clan::NetGameClient::send_event | ( | const NetGameEvent & | game_event | ) |

Send event.

Parameters

  game_event | = Net Game Event

void clan::NetGameServer::send_event | ( | const NetGameEvent & | game_event | ) |

Send event.

Parameters

  game_event | = Net Game Event

void clan::NetGameConnection::send_event | ( | const NetGameEvent & | game_event | ) |

Send event.

Parameters

  game_event | = Net Game Event

void clan::NetGameConnection::set_data | ( | const std::string & | name,
|  | void * | data
| ) |  |

Set data.

Parameters

  name | = String Ref
  data | = void

void clan::NetGameEventValue::set_member | ( | unsigned int | index,
|  | const NetGameEventValue & | value
| ) |  |

Set member.

Parameters

  index | = value
  value | = Net Game Event Value

Signal<void(NetGameConnection *)>& clan::NetGameServer::sig_client_connected | ( |  | ) |

Signal<void(NetGameConnection *, const std::string &)>& clan::NetGameServer::sig_client_disconnected | ( |  | ) |

Signal<void()>& clan::NetGameClient::sig_connected | ( |  | ) |

Sig connected.

Returns
  Signal<void()>

Signal<void()>& clan::NetGameClient::sig_disconnected | ( |  | ) |

Sig disconnected.

Returns
  Signal<void()>

Signal<void(const NetGameEvent &)>& clan::NetGameClient::sig_event_received | ( |  | ) |

Signal<void(NetGameConnection *, const NetGameEvent &)>& clan::NetGameServer::sig_event_received | ( |  | ) |

void clan::NetGameServer::start | ( | const std::string & | port | ) |

Start.

Parameters

  port | = String

void clan::NetGameServer::start | ( | const std::string & | address,
|  | const std::string & | port
| ) |  |

Start.

Parameters

  address | = String
  port | = String

void clan::NetGameServer::stop | ( |  | ) |

Stop.

std::string clan::NetGameEvent::to_string | ( |  | ) | const

Returns
  A string representation of this event, including all of its arguments.

static std::string clan::NetGameEventValue::to_string | ( | const NetGameEventValue & |  | ) |
| static

Helper function to obtain a string representation of an EventValue object.

## Variable Documentation

bool clan::NetGameEventValue::value_bool

bool { ... } ::value_bool

char { ... } ::value_char

char clan::NetGameEventValue::value_char

float clan::NetGameEventValue::value_float

float { ... } ::value_float

int { ... } ::value_int

int clan::NetGameEventValue::value_int

unsigned { ... } ::value_uchar

unsigned char clan::NetGameEventValue::value_uchar

unsigned { ... } ::value_uint

unsigned int clan::NetGameEventValue::value_uint