Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

sim Class Reference

#include <sim.h>


Detailed Description

Definition at line 16 of file sim.h.

List of all members.

Classes

class  ConfigErrorCheck
 provides warning regarding configuration settings More...

Public Types

typedef MessageQueue< 500 > EventQueue_t
typedef MessageQueue< 50 > MotionCommandQueue_t
typedef MessageQueue< 50 > SoundPlayQueue_t
typedef MessageQueue< 1 > CameraQueue_t
typedef MessageQueue< 1 > SensorQueue_t
typedef MessageQueue< 1 > TimerWakeup_t
typedef MessageQueue< 1 > MotionWakeup_t
typedef MessageQueue
< ProcessID::NumProcesses+1 > 
StatusRequest_t
typedef MessageQueue< 1 > MotionOutput_t
typedef MessageQueue< 50 > MotionOutputPIDs_t

Public Member Functions

 sim ()
bool processCommandLine (int argc, const char *argv[])
bool run ()
 ~sim ()

Static Public Attributes

static SimConfig config
static IPCEventTranslatoretrans
static std::vector< std::string > cmdlineArgs

Protected Member Functions

void wait_child ()

Static Protected Member Functions

static unsigned int measure_usleep_cost ()
static void wait_runlevel (SharedGlobals::runlevel_t level)
template<class T >
static void manage_process ()
template<class T >
static bool fork_process ()
static ProcessID::ProcessID_t getProcessID ()
 ProcessID hook to use the thread group as the process ID.
static void setProcessID (ProcessID::ProcessID_t id)
 ProcessID hook to set the thread group as the process ID.
static unsigned int sim_get_time ()
static float sim_getTimeScale ()
static int getTermFD ()
static void handle_signal (int sig)
static void handle_exit ()
static void badExitCleanup ()

Protected Attributes

SharedObject< SemaphoreManagermutexSemMgr
SharedObject< SharedGlobalsglob
SharedObject< ipc_setup_tsubj
unsigned int srandSeed
int zigSeed1
int zigSeed2

Static Protected Attributes

static std::vector< Thread * > primaries
static ConfigErrorCheck cfgCheck
static bool original = true
static const char *const usage
static pid_t child = static_cast<pid_t>(-1)
static bool showRunlevels = false
static termios ttyMode

Friends

struct PrimaryThread
int main (int argc, const char *argv[])

Member Typedef Documentation

Definition at line 28 of file sim.h.

typedef MessageQueue<500> EventQueue_t

Definition at line 25 of file sim.h.

Definition at line 26 of file sim.h.

Definition at line 33 of file sim.h.

Definition at line 34 of file sim.h.

Definition at line 31 of file sim.h.

Definition at line 29 of file sim.h.

Definition at line 27 of file sim.h.

Definition at line 32 of file sim.h.

Definition at line 30 of file sim.h.


Constructor & Destructor Documentation

sim (  ) 

Definition at line 144 of file sim.cc.

~sim (  ) 

Definition at line 409 of file sim.cc.


Member Function Documentation

void badExitCleanup (  )  [static, protected]

Definition at line 620 of file sim.cc.

Referenced by handle_exit(), and handle_signal().

bool fork_process (  )  [static, protected]

Definition at line 483 of file sim.cc.

ProcessID::ProcessID_t getProcessID (  )  [static, protected]

ProcessID hook to use the thread group as the process ID.

Definition at line 508 of file sim.cc.

Referenced by run().

int getTermFD (  )  [static, protected]

Definition at line 520 of file sim.cc.

Referenced by handle_exit(), handle_signal(), and sim().

void handle_exit (  )  [static, protected]

Definition at line 594 of file sim.cc.

Referenced by sim().

void handle_signal ( int  sig  )  [static, protected]

Definition at line 529 of file sim.cc.

Referenced by sim().

void manage_process (  )  [static, protected]

Definition at line 458 of file sim.cc.

unsigned int measure_usleep_cost (  )  [static, protected]

Definition at line 666 of file sim.cc.

Referenced by sim().

bool processCommandLine ( int  argc,
const char *  argv[] 
)

Definition at line 233 of file sim.cc.

Referenced by main().

bool run (  ) 

Definition at line 334 of file sim.cc.

Referenced by main().

void setProcessID ( ProcessID::ProcessID_t  id  )  [static, protected]

ProcessID hook to set the thread group as the process ID.

Definition at line 514 of file sim.cc.

Referenced by run().

static unsigned int sim_get_time (  )  [static, protected]

Definition at line 64 of file sim.h.

Referenced by sim().

static float sim_getTimeScale (  )  [static, protected]

Definition at line 65 of file sim.h.

Referenced by sim().

void wait_child (  )  [protected]

Definition at line 429 of file sim.cc.

Referenced by ~sim().

void wait_runlevel ( SharedGlobals::runlevel_t  level  )  [static, protected]

Definition at line 437 of file sim.cc.

Referenced by manage_process().


Friends And Related Function Documentation

int main ( int  argc,
const char *  argv[] 
) [friend]

Definition at line 106 of file sim.cc.

friend struct PrimaryThread [friend]

Definition at line 17 of file sim.h.


Member Data Documentation

sim::ConfigErrorCheck cfgCheck [static, protected]

Definition at line 62 of file sim.h.

Referenced by run().

pid_t child = static_cast<pid_t>(-1) [static, protected]

Definition at line 77 of file sim.h.

Referenced by fork_process(), wait_child(), and ~sim().

vector< string > cmdlineArgs [static]

Definition at line 38 of file sim.h.

Referenced by processCommandLine(), and Simulator::Simulator().

Definition at line 37 of file sim.h.

Definition at line 73 of file sim.h.

Definition at line 72 of file sim.h.

Referenced by sim().

bool original = true [static, protected]

Definition at line 75 of file sim.h.

Referenced by fork_process().

vector< Thread * > primaries [static, protected]

Definition at line 50 of file sim.h.

Referenced by fork_process(), and run().

bool showRunlevels = false [static, protected]

Definition at line 78 of file sim.h.

Referenced by run(), and wait_runlevel().

unsigned int srandSeed [protected]

Definition at line 80 of file sim.h.

Referenced by processCommandLine(), run(), and sim().

Definition at line 74 of file sim.h.

termios ttyMode [static, protected]

Definition at line 79 of file sim.h.

Referenced by handle_exit(), handle_signal(), and sim().

const char *const usage [static, protected]
Initial value:
"[-h|--help] [-c|--config config-file] [-s|--seed s1,s2,s3] [cmd1 cmd2 ...]\n"
"\n"
"Commands passed as arguments are commonly of the form var=val, but can\n"
"also be any valid simulator command, such as 'freeze'.  If you wish to\n"
"pass a multi-word command, encase the command in quotes.\n"
"\n"
"The first --seed argument is passed to srand and srandom, the second\n"
"and third are passed to the zignor library for normally distributed"
"random numbers."

Definition at line 76 of file sim.h.

Referenced by processCommandLine().

int zigSeed1 [protected]

Definition at line 81 of file sim.h.

Referenced by processCommandLine(), run(), and sim().

int zigSeed2 [protected]

Definition at line 82 of file sim.h.

Referenced by processCommandLine(), run(), and sim().


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

Tekkotsu Hardware Abstraction Layer 5.1CVS
Generated Mon May 9 05:01:42 2016 by Doxygen 1.6.3