Wrath of Zeus
Made by Torchlight Games for CSE 125 SP24
Loading...
Searching...
No Matches
Data Structures | Functions | Variables
debugger.hpp File Reference
#include "server/game/servergamestate.hpp"
#include "server/game/constants.hpp"

Go to the source code of this file.

Data Structures

class  Command
 This is the Command class from which all debugger commands derive. Each debugger command has a name and a shorthand name. The run() method is overloaded by each particular command to implement its particular behavior. More...
 
class  QuitCommand
 
class  StepCommand
 
class  StateCommand
 
class  PrintCommand
 
class  HelpCommand
 
class  CreateCommand
 
class  DeleteCommand
 
class  SetCommand
 

Functions

void initialize_commands (std::vector< Command * > &commands)
 Allocate all Command objects recognized by the debugger. More...
 
void free_commands (const std::vector< Command * > &commands)
 Deallocate all Command objects allocated by initialize_commands(). More...
 
std::vector< std::stringget_string_tokens (std::string input, char delimeter)
 Reads an input string and splits it into a vector of strings by a character delimeter. More...
 
void initialize_command_map (std::unordered_map< std::string, Command & > &command_map, const std::vector< Command * > &commands)
 Initialize string (name) -> Command * hashmap maintained by the debugger to all known commands. More...
 

Variables

const std::string NO_SHORTHAND = "NO_SHORTHAND"
 
std::vector< Command * > commands
 
std::unordered_map< std::string, Command & > command_map
 

Function Documentation

◆ free_commands()

void free_commands ( const std::vector< Command * > &  commands)

Deallocate all Command objects allocated by initialize_commands().

Parameters
commands

◆ get_string_tokens()

std::vector< std::string > get_string_tokens ( std::string  input,
char  delimeter 
)

Reads an input string and splits it into a vector of strings by a character delimeter.

Parameters
inputString to split into tokens
delimeterDelimiter by which to split string into tokens (no token will contain the delimeter character)
Returns
vector<string> of string tokens

◆ initialize_command_map()

void initialize_command_map ( std::unordered_map< std::string, Command & > &  command_map,
const std::vector< Command * > &  commands 
)

Initialize string (name) -> Command * hashmap maintained by the debugger to all known commands.

Parameters
command_mapReference to the debugger's command map (assumed empty).

◆ initialize_commands()

void initialize_commands ( std::vector< Command * > &  commands)

Allocate all Command objects recognized by the debugger.

Parameters
commands

Variable Documentation

◆ command_map

std::unordered_map<std::string, Command&> command_map
extern

◆ commands

std::vector<Command*> commands
extern

◆ NO_SHORTHAND

const std::string NO_SHORTHAND = "NO_SHORTHAND"