ocra-recipes
Doxygen documentation for the ocra-recipes repository
Classes | Public Member Functions | Protected Member Functions | List of all members
ocra_recipes::ClientManager Class Reference

The controller module which launches the controller thread. More...

#include <ClientManager.h>

Inheritance diagram for ocra_recipes::ClientManager:
[legend]
Collaboration diagram for ocra_recipes::ClientManager:
[legend]

Classes

class  moduleCallback
 A callback function which binds the rpc server port opened in the contoller server module to the controller thread's parsing function. More...
 

Public Member Functions

 ClientManager (std::shared_ptr< ControllerClient > customClient, bool suppressPerformanceWarnings=false)
 
 ~ClientManager ()
 
bool configure (yarp::os::ResourceFinder &rf)
 
int launchClient ()
 
bool interruptModule ()
 
bool close ()
 
bool updateModule ()
 
void printHelp ()
 
virtual std::string getManagerName ()
 

Protected Member Functions

virtual void customCallbackParser (yarp::os::Bottle &message, yarp::os::Bottle &reply)
 
virtual bool customUpdateModule ()
 

Detailed Description

The controller module which launches the controller thread.

Basically all this does is parse the command line arguments and look for the various config and task set files. It then instantiates a WBI instance (yarpWBI specifically) and a IcubControllerClient instance. It launches these threads and then basically just waits till it gets a kill (ctrl+c) command to close them down. Does a little keeping track of time as well.

Definition at line 48 of file ClientManager.h.

Constructor & Destructor Documentation

ClientManager::ClientManager ( std::shared_ptr< ControllerClient customClient,
bool  suppressPerformanceWarnings = false 
)

Constructor which essentially does nothing.

Definition at line 33 of file ClientManager.cpp.

ClientManager::~ClientManager ( )

Destructor which essentially does nothing.

Definition at line 44 of file ClientManager.cpp.

Member Function Documentation

bool ClientManager::close ( )

Closes the module. First shuts down the threads.

Definition at line 73 of file ClientManager.cpp.

bool ClientManager::configure ( yarp::os::ResourceFinder &  rf)

Configures the module by parsing the RF contents. Passes to client when done.

Parameters
rfA resource finder instance which is initialized from the command line args.
Returns
True or false if the configuration was successful.

Definition at line 54 of file ClientManager.cpp.

void ClientManager::customCallbackParser ( yarp::os::Bottle &  message,
yarp::os::Bottle &  reply 
)
protectedvirtual

Definition at line 127 of file ClientManager.cpp.

bool ClientManager::customUpdateModule ( )
protectedvirtual

Definition at line 131 of file ClientManager.cpp.

std::string ClientManager::getManagerName ( )
virtual

Gets the name of the module. Override this function to set a different name.

Returns
A string with the module name.

Definition at line 49 of file ClientManager.cpp.

bool ClientManager::interruptModule ( )

Interrupts the module execution and stops the control and wbi threads.

Definition at line 65 of file ClientManager.cpp.

int ClientManager::launchClient ( )

Simply calls client->start() then runModule()

Definition at line 59 of file ClientManager.cpp.

void ClientManager::printHelp ( )

Prints all the command line args one could use.

Definition at line 113 of file ClientManager.cpp.

bool ClientManager::updateModule ( )

Updates the ClientManager. Basically just clocks the thread run() method.

Returns
Whether or not the clocking functions worked.

Definition at line 93 of file ClientManager.cpp.


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