ChirpSim
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | Static Private Attributes | List of all members
RobotRepository Class Reference

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...
 
RobotgetRobotFromId (unsigned id)
 Gets the robot with the unique ID supplied. More...
 

Static Public Member Functions

static RobotRepositoryinstance ()
 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
 

Detailed Description

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.

Constructor & Destructor Documentation

RobotRepository::RobotRepository ( )
explicitprotected

Referenced by instance().

Here is the caller graph for this function:

Member Function Documentation

void RobotRepository::addRobot ( Robot robot)

Stores a robot in the repository.

Parameters
robotThe robot to store.

References _map, and Robot::id().

Referenced by chirpFactory().

Here is the call graph for this function:

Here is the caller graph for this function:

Robot * RobotRepository::getRobotFromId ( unsigned  id)

Gets the robot with the unique ID supplied.

Parameters
idUnique ID for the robot.
Returns
Robot instance with the ID supplied.

References _map.

Referenced by ControllerServer::incomingConnection().

Here is the caller graph for this function:

RobotRepository * RobotRepository::instance ( )
static

Static getter method to get the singleton instance of the class.

Returns
Singleton instance of RobotRepository.

References _instance, and RobotRepository().

Referenced by chirpFactory(), and ControllerServer::incomingConnection().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

RobotRepository * RobotRepository::_instance = NULL
staticprivate

Referenced by instance().

QMap<quint32, Robot*> RobotRepository::_map
private

Referenced by addRobot(), and getRobotFromId().


The documentation for this class was generated from the following files: