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 SocketName &socket_name)
 
 clan::NetGameConnection::NetGameConnection (NetGameConnectionSite *site, const TCPConnection &connection)
 Constructs a NetGameConnection. More...
 
 clan::NetGameEvent::NetGameEvent (const std::string &name, std::vector< NetGameEventValue > arg={})
 Constructs a NetGameEvent. More...
 
 clan::NetGameEventValue::NetGameEventValue ()
 
 clan::NetGameEventValue::NetGameEventValue (bool value)
 Constructs a NetGameEventValue. More...
 
 clan::NetGameEventValue::NetGameEventValue (char value)
 Constructs a NetGameEventValue. More...
 
 clan::NetGameEventValue::NetGameEventValue (const char *str)
 Constructs a NetGameEventValue. More...
 
 clan::NetGameEventValue::NetGameEventValue (const DataBuffer &value)
 Constructs a NetGameEventValue. More...
 
 clan::NetGameEventValue::NetGameEventValue (const std::string &value)
 Constructs a NetGameEventValue. More...
 
 clan::NetGameEventValue::NetGameEventValue (const wchar_t *str)
 Constructs a NetGameEventValue. More...
 
 clan::NetGameEventValue::NetGameEventValue (float value)
 Constructs a NetGameEventValue. More...
 
 clan::NetGameEventValue::NetGameEventValue (int value)
 Constructs a NetGameEventValue. More...
 
 clan::NetGameEventValue::NetGameEventValue (Type type)
 Constructs a NetGameEventValue. More...
 
 clan::NetGameEventValue::NetGameEventValue (unsigned char value)
 Constructs a NetGameEventValue. More...
 
 clan::NetGameEventValue::NetGameEventValue (unsigned int value)
 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 NetGameEventValueclan::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 &address, const std::string &port)
 Start. More...
 
void clan::NetGameServer::start (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

◆ Type

Enumerator
null 
integer 
uinteger 
character 
ucharacter 
string 
boolean 
number 
complex 
binary 

Function Documentation

◆ NetGameClient()

clan::NetGameClient::NetGameClient ( )

◆ NetGameConnection() [1/2]

clan::NetGameConnection::NetGameConnection ( NetGameConnectionSite site,
const SocketName socket_name 
)

◆ NetGameConnection() [2/2]

clan::NetGameConnection::NetGameConnection ( NetGameConnectionSite site,
const TCPConnection connection 
)

Constructs a NetGameConnection.

Parameters
site= Net Game Connection Site
connection= TCPConnection

◆ NetGameEvent()

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

Constructs a NetGameEvent.

◆ NetGameEventValue() [1/12]

clan::NetGameEventValue::NetGameEventValue ( )

◆ NetGameEventValue() [2/12]

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

Constructs a NetGameEventValue.

Parameters
value= bool

◆ NetGameEventValue() [3/12]

clan::NetGameEventValue::NetGameEventValue ( char  value)

Constructs a NetGameEventValue.

Parameters
value= value

◆ NetGameEventValue() [4/12]

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

Constructs a NetGameEventValue.

Parameters
str= char

◆ NetGameEventValue() [5/12]

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

Constructs a NetGameEventValue.

Parameters
value= DataBuffer

◆ NetGameEventValue() [6/12]

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

Constructs a NetGameEventValue.

Parameters
value= String

◆ NetGameEventValue() [7/12]

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

Constructs a NetGameEventValue.

Parameters
str= wchar_t

◆ NetGameEventValue() [8/12]

clan::NetGameEventValue::NetGameEventValue ( float  value)

Constructs a NetGameEventValue.

Parameters
value= value

◆ NetGameEventValue() [9/12]

clan::NetGameEventValue::NetGameEventValue ( int  value)

Constructs a NetGameEventValue.

Parameters
value= value

◆ NetGameEventValue() [10/12]

clan::NetGameEventValue::NetGameEventValue ( Type  type)

Constructs a NetGameEventValue.

Parameters
type= Type

◆ NetGameEventValue() [11/12]

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

Constructs a NetGameEventValue.

Parameters
value= value

◆ NetGameEventValue() [12/12]

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

Constructs a NetGameEventValue.

Parameters
value= value

◆ NetGameServer()

clan::NetGameServer::NetGameServer ( )

◆ ~NetGameClient()

clan::NetGameClient::~NetGameClient ( )

◆ ~NetGameConnection()

clan::NetGameConnection::~NetGameConnection ( )

◆ ~NetGameServer()

clan::NetGameServer::~NetGameServer ( )

◆ add_argument()

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

Adds an argument into this event.

Parameters
valueThe argument to store inside this event.

◆ add_member()

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

Add member.

Parameters
value= Net Game Event Value

◆ add_network_event()

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

Add network event.

Parameters
e= Net Game Network Event

◆ connect()

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

Connect.

Parameters
server= String
port= String

◆ disconnect() [1/2]

void clan::NetGameClient::disconnect ( )

Disconnect.

◆ disconnect() [2/2]

void clan::NetGameConnection::disconnect ( )

Disconnects a client.

◆ get_argument()

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

Retrieves an argument in this event.

Parameters
indexIndex number of the argument to retrieve.
Returns
A NetGameEventValue object containing the argument value.

◆ get_argument_count()

unsigned int clan::NetGameEvent::get_argument_count ( ) const
Returns
The number of arguments stored in this event.

◆ get_binary()

DataBuffer clan::NetGameEventValue::get_binary ( ) const

To binary.

Returns
binary

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

◆ get_boolean()

bool clan::NetGameEventValue::get_boolean ( ) const

To boolean.

Returns
bool

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

◆ get_character()

int clan::NetGameEventValue::get_character ( ) const

To character.

Returns
char

◆ get_data()

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

Get data.

Parameters
name= String Ref
Returns
void

◆ get_integer()

int clan::NetGameEventValue::get_integer ( ) const

To integer.

Returns
int

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

◆ get_member()

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

◆ get_member_count()

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

◆ get_name()

std::string clan::NetGameEvent::get_name ( ) const
inline
Returns
The name of this event.

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

◆ get_number()

float clan::NetGameEventValue::get_number ( ) const

To number.

Returns
float

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

◆ get_remote_name()

SocketName clan::NetGameConnection::get_remote_name ( ) const

Get Remote name.

Returns
remote_name

◆ get_string()

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

To string.

Returns
String

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

◆ get_type()

Type clan::NetGameEventValue::get_type ( ) const

Get Type.

Returns
type

◆ get_ucharacter()

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

To unsigned character.

Returns
unsigned char

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

◆ get_uinteger()

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

To unsigned integer.

Returns
unsigned int

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

◆ is_binary()

bool clan::NetGameEventValue::is_binary ( ) const

Is Binary.

Returns
true = binary

◆ is_boolean()

bool clan::NetGameEventValue::is_boolean ( ) const

Is Boolean.

Returns
true = boolean

◆ is_character()

bool clan::NetGameEventValue::is_character ( ) const

Is Character.

Returns
true = character

◆ is_complex()

bool clan::NetGameEventValue::is_complex ( ) const

Is Complex.

Returns
true = complex

◆ is_integer()

bool clan::NetGameEventValue::is_integer ( ) const

Is Integer.

Returns
true = integer

◆ is_null()

bool clan::NetGameEventValue::is_null ( ) const

Is Null.

Returns
true = null

◆ is_number()

bool clan::NetGameEventValue::is_number ( ) const

Is Number.

Returns
true = number

◆ is_string()

bool clan::NetGameEventValue::is_string ( ) const

Is String.

Returns
true = string

◆ is_ucharacter()

bool clan::NetGameEventValue::is_ucharacter ( ) const

Is Ucharacter.

Returns
true = ucharacter

◆ is_uinteger()

bool clan::NetGameEventValue::is_uinteger ( ) const

Is Uinteger.

Returns
true = uinteger

◆ operator bool()

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

◆ operator DataBuffer()

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

◆ operator float()

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

◆ operator int()

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

◆ operator std::string()

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

◆ operator unsigned char()

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

◆ operator unsigned int()

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

◆ process_events() [1/2]

void clan::NetGameClient::process_events ( )

Process events.

◆ process_events() [2/2]

void clan::NetGameServer::process_events ( )

Process events.

◆ send_event() [1/3]

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

Send event.

Parameters
game_event= Net Game Event

◆ send_event() [2/3]

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

Send event.

Parameters
game_event= Net Game Event

◆ send_event() [3/3]

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

Send event.

Parameters
game_event= Net Game Event

◆ set_data()

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

Set data.

Parameters
name= String Ref
data= void

◆ set_member()

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

Set member.

Parameters
index= value
value= Net Game Event Value

◆ sig_client_connected()

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

◆ sig_client_disconnected()

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

◆ sig_connected()

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

Sig connected.

Returns
Signal<void()>

◆ sig_disconnected()

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

Sig disconnected.

Returns
Signal<void()>

◆ sig_event_received() [1/2]

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

◆ sig_event_received() [2/2]

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

◆ start() [1/2]

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

Start.

Parameters
address= String
port= String

◆ start() [2/2]

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

Start.

Parameters
port= String

◆ stop()

void clan::NetGameServer::stop ( )

Stop.

◆ to_string() [1/2]

std::string clan::NetGameEvent::to_string ( ) const
Returns
A string representation of this event, including all of its arguments.

◆ to_string() [2/2]

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

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

Variable Documentation

◆ value_bool [1/2]

bool clan::NetGameEventValue::value_bool

◆ value_bool [2/2]

bool { ... } ::value_bool

◆ value_char [1/2]

char { ... } ::value_char

◆ value_char [2/2]

char clan::NetGameEventValue::value_char

◆ value_float [1/2]

float clan::NetGameEventValue::value_float

◆ value_float [2/2]

float { ... } ::value_float

◆ value_int [1/2]

int { ... } ::value_int

◆ value_int [2/2]

int clan::NetGameEventValue::value_int

◆ value_uchar [1/2]

unsigned { ... } ::value_uchar

◆ value_uchar [2/2]

unsigned char clan::NetGameEventValue::value_uchar

◆ value_uint [1/2]

unsigned { ... } ::value_uint

◆ value_uint [2/2]

unsigned int clan::NetGameEventValue::value_uint