The Jetpack.hpp.
More...
Go to the source code of this file.
|
|
#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 |
| |
|
| 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
} |
| |
|
| 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.
|
| |
The Jetpack.hpp.
- Author
- Christophe VANDEVOIR, Guillaume LECOCQ and Nicolas TORO
◆ closeJetpack()
| void closeJetpack |
( |
int | signal | ) |
|
Closes the jetpack client.
- Note
- This function is a signal handler for SIGINT
- Parameters
-
| signal | The signal to handle |
- Exceptions
-
| JetpackStop | if 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
-
| str | The string to convert |
| delimiters | The delimiters to use |
- Returns
- A vector of strings
- Parameters
-
| str | The string to convert |
| delimiters | The delimiters to use for splitting the string |
- Returns
- A vector of strings
◆ CMD_ID_STR
| const std::array<std::string, 7> CMD_ID_STR |
Initial value:= {
"ID",
"MAP",
"PSEUDO",
"MOVE",
"CLIENTS_NB",
"CLIENTS_STATS",
"CLIENTS_POSITIONS"
}