User Manual, Developers Guide and API Documentation

wns::simulator::Application Class Reference

Run-time environment of openWNS. More...

#include <simulator/Application.hpp>

Inheritance diagram for wns::simulator::Application:

Inheritance graph
[legend]
Collaboration diagram for wns::simulator::Application:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Application ()
 Default Constructor.
virtual ~Application ()
 Default Destructor.

Protected Member Functions

virtual void doInit ()
 Configure stuff that belongs to WNS.
virtual void doReadCommandLine (int argc, char *argv[])
 Reads the command line parameters.
virtual void doRun ()
 Run the simulation.
virtual void doShutdown ()
 Shutdown everything.
virtual int doStatus () const
 Return status code.
pyconfig::View getWNSView () const
 Returns the view to root configuration.
void loadModules ()
 Retrieve an instance of Module from each library.
void stopProbes ()
 Stop Probes.
void writeFingerprint ()
 Write a fingerprint file to the output directory.

Static Protected Member Functions

static void disableX87ExtendedFloatingPointPrecision ()
 Disable usage of 80 bit extensions in x87.
static std::string getPathToPyConfig ()
 Returns the path to pyconfig.
static void unexpectedHandler ()
 Handle unexpected exceptions.

Protected Attributes

bool absolutePath_
boost::program_options::variables_map arguments_
bool attachDebugger_
 Are we expected to launch a debugger on segfault?
bool compilerTestingOutput_
 Is the output in testing mode compatible to that of a compiler?
std::string configFile_
 Name of the configuration file.
pyconfig::Parser configuration_
 Configuration as parsed from configFile_.
wns::probe::bus::ContextCollectorPtr cpuCyclesProbe_
 Probe CPU cycles spent in main event loop.
std::string debuggerName_
 In case we should launch a debugger, this is the name of it.
std::auto_ptr
< wns::events::scheduler::Monitor
eventSchedulerMonitor_
 A monitor for the event scheduler.
bool extendedPrecision_
 If true use 80 bit extensions of x87 (false by default).
bool interactiveConfig_
 Interactive config.
bool lazyBinding_
bool listLoadedModules_
 If true, a list of loaded modules will be shown (set by "-m").
std::list< wns::module::Base * > loadedModules_
 List with all loaded modules.
wns::logger::Logger logger_
 The logger of the Application.
std::list< pyconfig::ViewmoduleViews_
 List with the configuration of all modules.
boost::program_options::options_description options_
 Defines the valid options for the command line.
std::auto_ptr
< wns::probe::bus::ProbeBusRegistry
probeBusRegistry
 Anchor for all probe busses.
ProbeWriter probeWriter
std::string programName_
 Our own name (as from argv[0]).
PyConfigPatchContainer pyConfigPatches_
 Holds all PyConfig patches.
std::auto_ptr
< wns::simulator::ISimulationModel
simulationModel_
 Keeps the SimulationModel which is constructed by a StaticFactory.
int status_
 The status code of openWNS.
StatusReport statusReport
bool testing_
 Is wns in testing mode?
TestNameContainer testNames_
 If special tests have been defined they are stored here.
bool verbose_
 Be chatty.

Private Types

typedef std::vector< std::string > PyConfigPatchContainer
typedef std::vector< std::string > TestNameContainer


Detailed Description

Author:
Marc Schinnenburg <marc@schinnenburg.com>
The following mehtods are called in this order:

Definition at line 81 of file Application.hpp.


Member Typedef Documentation

typedef std::vector<std::string> wns::simulator::Application::PyConfigPatchContainer [private]

Definition at line 86 of file Application.hpp.

typedef std::vector<std::string> wns::simulator::Application::TestNameContainer [private]

Definition at line 85 of file Application.hpp.


Constructor & Destructor Documentation

Application::Application (  ) 

Definition at line 89 of file Application.cpp.

Application::~Application (  )  [virtual]

Definition at line 172 of file Application.cpp.


Member Function Documentation

void Application::disableX87ExtendedFloatingPointPrecision (  )  [static, protected]

From: http://www.network-theory.co.uk/docs/gccintro/gccintro_70.html

The IEEE-754 standard defines the bit-level behavior of floating-point arithmetic operations on all modern processors. This allows numerical programs to be ported between different platforms with identical results, in principle. In practice, there are often minor variations caused by differences in the order of operations (depending on the compiler and optimization level) but these are generally not significant.

However, more noticeable discrepancies can be seen when porting numerical programs between x86 systems and other platforms, because the the x87 floating point unit (FPU) on x86 processors computes results using extended precision internally (the values being converted to double precision only when they are stored to memory). In contrast, processors such as SPARC, PA-RISC, Alpha, MIPS and POWER/PowerPC work with native double-precision values throughout. The differences between these implementations lead to changes in rounding and underflow/overflow behavior, because intermediate values have a greater relative precision and exponent range when computed in extended precision. In particular, comparisons involving extended precision values may fail where the equivalent double precision values would compare equal.

To avoid these incompatibilities, the x87 FPU also offers a hardware double-precision rounding mode. In this mode the results of each extended-precision floating-point operation are rounded to double precision in the floating-point registers by the FPU. It is important to note that the rounding only affects the precision, not the exponent range, so the result is a hybrid double-precision format with an extended range of exponents.

On BSD systems such as FreeBSD, NetBSD and OpenBSD, the hardware double-precision rounding mode is the default, giving the greatest compatibility with native double precision platforms. On x86 GNU/Linux systems the default mode is extended precision (with the aim of providing increased accuracy). To enable the double-precision rounding mode it is necessary to override the default setting on per-process basis using the FLDCW "floating-point load control-word" machine instruction, which will be performed by this method.

Definition at line 643 of file Application.cpp.

void Application::doInit (  )  [protected, virtual]

Implements wns::simulator::IApplication.

Definition at line 189 of file Application.cpp.

void Application::doReadCommandLine ( int  argc,
char *  argv[] 
) [protected, virtual]

Implements wns::simulator::IApplication.

Definition at line 178 of file Application.cpp.

void Application::doRun (  )  [protected, virtual]

Implements wns::simulator::IApplication.

Definition at line 358 of file Application.cpp.

void Application::doShutdown (  )  [protected, virtual]

Implements wns::simulator::IApplication.

Definition at line 523 of file Application.cpp.

int Application::doStatus (  )  const [protected, virtual]

Implements wns::simulator::IApplication.

Definition at line 629 of file Application.cpp.

std::string Application::getPathToPyConfig (  )  [static, protected]

Definition at line 591 of file Application.cpp.

wns::pyconfig::View Application::getWNSView (  )  const [protected]

Definition at line 623 of file Application.cpp.

void Application::loadModules (  )  [protected]

Definition at line 651 of file Application.cpp.

void Application::stopProbes (  )  [protected]

Definition at line 756 of file Application.cpp.

void Application::unexpectedHandler (  )  [static, protected]

Definition at line 635 of file Application.cpp.

void Application::writeFingerprint (  )  [protected]

Definition at line 777 of file Application.cpp.


Member Data Documentation

Definition at line 331 of file Application.hpp.

boost::program_options::variables_map wns::simulator::Application::arguments_ [protected]

brief Holds the command line parameters

Definition at line 270 of file Application.hpp.

Definition at line 285 of file Application.hpp.

Definition at line 250 of file Application.hpp.

Definition at line 230 of file Application.hpp.

Definition at line 235 of file Application.hpp.

Definition at line 345 of file Application.hpp.

Definition at line 280 of file Application.hpp.

Definition at line 302 of file Application.hpp.

Definition at line 307 of file Application.hpp.

Definition at line 290 of file Application.hpp.

Definition at line 329 of file Application.hpp.

Definition at line 322 of file Application.hpp.

Definition at line 327 of file Application.hpp.

Note:
The logger can only be used after init and before shutdown

Definition at line 297 of file Application.hpp.

Definition at line 317 of file Application.hpp.

boost::program_options::options_description wns::simulator::Application::options_ [protected]

Definition at line 265 of file Application.hpp.

Definition at line 336 of file Application.hpp.

Definition at line 340 of file Application.hpp.

Definition at line 275 of file Application.hpp.

Definition at line 260 of file Application.hpp.

Definition at line 312 of file Application.hpp.

0 - everything fine

1 - an error occured

Definition at line 225 of file Application.hpp.

Definition at line 338 of file Application.hpp.

Definition at line 245 of file Application.hpp.

Definition at line 255 of file Application.hpp.

Definition at line 240 of file Application.hpp.


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

Generated on Sun May 27 03:33:06 2012 for openWNS by  doxygen 1.5.5