#include <ariaInternal.h>
Public Types | |
enum | SigHandleMethod { SIGHANDLE_SINGLE, SIGHANDLE_THREAD, SIGHANDLE_NONE } |
Static Public Methods | |
void | init (SigHandleMethod method=SIGHANDLE_SINGLE, bool initSockets=true) |
Performs OS-specific initialization. More... | |
void | uninit () |
Performs OS-specific deinitialization. More... | |
void | addInitCallBack (ArFunctor *cb, ArListPos::Pos position) |
Adds a callback to call when Aria is inited. More... | |
void | addUninitCallBack (ArFunctor *cb, ArListPos::Pos position) |
Adds a callback to call when Aria is uninited. More... | |
void | shutdown () |
Shutdown all Aria processes/threads. More... | |
void | exit () |
Force an exit of all Aria processes/threads. More... | |
void | addRobot (ArRobot *robot) |
Add a robot to the global list of robots. | |
void | delRobot (ArRobot *robot) |
Remove a robot from the global list of robots. | |
ArRobot * | findRobot (char *name) |
Finds a robot in the global list of robots, by name. More... | |
std::list< ArRobot *> * | getRobotList () |
Get a copy of the global robot list. | |
void | setDirectory (const char *directory) |
Sets the directory that ARIA resides in. More... | |
std::string | getDirectory (void) |
Gets the directory that ARIA resides in. More... | |
void | setKeyHandler (ArKeyHandler *keyHandler) |
Sets the key handler, so that other classes can find it. | |
ArKeyHandler * | getKeyHandler (void) |
Gets the key handler if one has been set. | |
void | signalHandlerCB (int sig) |
Internal, the callback for the signal handling. |
|
|
|
Adds a callback to call when Aria is inited. This will add a callback to the list of callbacks to call when Aria has been initialized. It can be called before anything else. |
|
Adds a callback to call when Aria is uninited. This will add a callback to the list of callbacks to call right before Aria is un-initialized. It can be called before anything else. This facilitates code that in operating system signal handlers simply calls Aria::uninit() and packages that are based on Aria are unitited as well. It simplifies the entire uninit process. |
|
Force an exit of all Aria processes/threads. This calls cancel() on all AtThread's and ArASyncTask's. It forces each thread to exit and should only be used in the case of a thread hanging or getting stuck in an infinite loop. This works fine in Linux. In Windows it is not recommended at all that this function be called. Windows can not handle cleanly killing off a thread. See the help in the VC++ compiler on the WIN32 function TerminateThread. The biggest problem is that the state of DLL's can be destroyed. |
|
Finds a robot in the global list of robots, by name.
|
|
Gets the directory that ARIA resides in. This gets the directory that ARIA is located in, this is so ARIA can find param files and the like.
|
|
Performs OS-specific initialization. This must be called first before any other Aria functions. It initializes the thread layer and the signal handling method. For Windows it iniatializes the socket layer as well. This also sets the directory Aria is located in from the ARIA environmental variable, for a description of this see getDirectory and setDirectory. For Linux the default signal handling method is to cleanly close down the program, cause all the instances of ArRobot to stop their run loop and disconnect from their robot. The program will exit on the following signals: SigHUP, SigINT, SigQUIT, and SigTERM. For Windows, there is no signal handling.
|
|
Sets the directory that ARIA resides in. This sets the directory that ARIA is located in, so ARIA can find param files and the like. This can also be controlled by the environment variable ARIA, which this is set to (if it exists) when Aria::init is done. So for setDirectory to be effective, it must be done after the Aria::init.
|
|
Shutdown all Aria processes/threads. This calls stop() on all ArThread's and ArASyncTask's. It will block until all ArThread's and ArASyncTask's exit. It is expected that all the tasks will obey the ArThread::myRunning variable and exit when it is false. |
|
Performs OS-specific deinitialization. This must be called last, after all other Aria functions. For both Linux and Windows, it closes all the open ArModules. For Windows it deinitializes the socket layer as well. |