Jetpack documentation 1.0.0
Loading...
Searching...
No Matches
Jetpack.hpp File Reference

The Jetpack.hpp. More...

#include "utils/Socket.hpp"
#include "utils/Cwd.hpp"

Go to the source code of this file.

Macros

#define UNUSED   __attribute__((unused))
 
#define ENDL   "\n"
 
#define MAX_CLIENTS   100
 
#define MAX_RESPONSE_SIZE   1024
 
#define TRAP_LIST   "elm"
 
#define CODE_OK   200
 
#define CODE_ERROR   500
 

Enumerations

enum  CmdCode { CODE_GAME = 1 , CODE_CLIENTS = 2 , CODE_PERSONNAL = 3 }
 
enum  CmdID {
  CMD_ID_NOT_FOUND = -1 , CMD_ID_ID = 0 , CMD_MAP_ID = 1 , CMD_PSEUDO_ID = 2 ,
  CMD_MOVE_ID = 3 , CMD_CLIENTS_NB_ID = 4 , CMD_CLIENTS_STATS_ID = 5 , CMD_CLIENTS_POSITIONS_ID = 6
}
 

Functions

void closeJetpack (int signal)
 Closes the jetpack client.
 
std::vector< std::string > stringToVector (std::string str, std::string delimiters)
 Converts a string to a vector of strings.
 

Variables

const std::array< std::string, 7 > CMD_ID_STR
 

Detailed Description

The Jetpack.hpp.

Author
Christophe VANDEVOIR, Guillaume LECOCQ and Nicolas TORO

Function Documentation

◆ closeJetpack()

void closeJetpack ( int signal)

Closes the jetpack client.

Note
This function is a signal handler for SIGINT
Parameters
signalThe signal to handle
Exceptions
JetpackStopif the jetpack is closed

◆ stringToVector()

std::vector< std::string > stringToVector ( std::string str,
std::string delimiters )

Converts a string to a vector of strings.

Converts a string to a vector of strings using the specified delimiters.

Parameters
strThe string to convert
delimitersThe delimiters to use
Returns
A vector of strings
Parameters
strThe string to convert
delimitersThe delimiters to use for splitting the string
Returns
A vector of strings

Variable Documentation

◆ CMD_ID_STR

const std::array<std::string, 7> CMD_ID_STR
Initial value:
= {
"ID",
"MAP",
"PSEUDO",
"MOVE",
"CLIENTS_NB",
"CLIENTS_STATS",
"CLIENTS_POSITIONS"
}