The RobotRepository class is a singleton class storing each Robot in the simulation. More...
#include <robotrepository.h>
Public Member Functions | |
void | addRobot (Robot *robot) |
Stores a robot in the repository. More... | |
Robot * | getRobotFromId (unsigned id) |
Gets the robot with the unique ID supplied. More... | |
Static Public Member Functions | |
static RobotRepository * | instance () |
Static getter method to get the singleton instance of the class. More... | |
Protected Member Functions | |
RobotRepository () | |
Private Attributes | |
QMap< quint32, Robot * > | _map |
Static Private Attributes | |
static RobotRepository * | _instance = NULL |
The RobotRepository class is a singleton class storing each Robot in the simulation.
The class allows others to store a robot into the repository, then get it by supplying the unique ID of the robot.
|
explicitprotected |
void RobotRepository::addRobot | ( | Robot * | robot) |
Stores a robot in the repository.
robot | The robot to store. |
References _map, and Robot::id().
Referenced by chirpFactory().
Robot * RobotRepository::getRobotFromId | ( | unsigned | id) |
Gets the robot with the unique ID supplied.
id | Unique ID for the robot. |
References _map.
Referenced by ControllerServer::incomingConnection().
|
static |
Static getter method to get the singleton instance of the class.
References _instance, and RobotRepository().
Referenced by chirpFactory(), and ControllerServer::incomingConnection().
|
staticprivate |
Referenced by instance().
|
private |
Referenced by addRobot(), and getRobotFromId().