Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

LOW_platformMisc Class Reference

Abstract base class for simple opering system dependent functions. More...

#include <LOW_platformMisc.h>

Inheritance diagram for LOW_platformMisc:

Inheritance graph
[legend]
Collaboration diagram for LOW_platformMisc:

Collaboration graph
[legend]
List of all members.

Public Types

typedef LOW_platformMisc::timestamp_t timestamp_t
 Data structure for timestamps. More...


Static Public Methods

const void secSleep (const unsigned int inSeconds)
 Sleep for a specified number of seconds. More...

const void milliSleep (const unsigned long inMilliSeconds)
 Sleep for a specified number of milli seconds. More...

const void microSleep (const unsigned long inMicroSeconds)
 Sleep for a specified number of micro seconds. More...

const void nanoSleep (const unsigned long inNanoSeconds)
 Sleep for a specified number of nano seconds. More...

const void nanoSleep (const unsigned int inSeconds, const unsigned long inNanoSeconds)
 Sleep for a specified number of nano seconds. More...

const void getTimestamp (timestamp_t &outTimestamp)
 Get a timestamp. More...

const void diffTimestamp (const timestamp_t &inT1, const timestamp_t &inT2, timestamp_t &outResult)
 Calculate difference of two timestamps. More...

const LOW_platformMiscFactory::threadIdent_t getThreadID ()
 Get identifier for current thread. More...

const std::string getHostname ()
 Get the host's name. More...


Protected Methods

virtual const void p_secSleep (const unsigned int inSeconds)=0
 Sleep for a specified number of seconds. More...

virtual const void p_milliSleep (const unsigned long inMilliSeconds)=0
 Sleep for a specified number of milli seconds. More...

virtual const void p_microSleep (const unsigned long inMicroSeconds)=0
 Sleep for a specified number of micro seconds. More...

virtual const void p_nanoSleep (const unsigned long inNanoSeconds)=0
 Sleep for a specified number of nano seconds. More...

virtual const void p_nanoSleep (const unsigned int inSeconds, const unsigned long inNanoSeconds)=0
 Sleep for a specified number of nano seconds. More...

virtual const void p_getTimestamp (timestamp_t &outTimestamp)=0
 Get a timestamp. More...

virtual const LOW_platformMiscFactory::threadIdent_t p_getThreadID ()=0
 Get identifier for current thread. More...

virtual const std::string p_getHostname ()=0
 Get the host's name. More...


Static Private Attributes

LOW_platformMisc * runtimeInstance = LOW_platformMiscFactory::new_platformMisc()
 Runtime instance of platform specific implementation of this class. More...


Detailed Description

Abstract base class for simple opering system dependent functions.

The methods are accessed via the public and static access functions. This class itself takes care of creating an appropiate instance.

Specific platforms dereive their implementation classes from this class.

The instances are created by LOW_platformMiscFactory, following the factory design pattern.

Note: There is no prescribed constructor. A class deriving from this one should only provide the default constructor.

See also:
LOW_platformMiscFactory
Author:
Harald Roelle, Helmut Reiser

Definition at line 43 of file LOW_platformMisc.h.


Member Typedef Documentation

typedef struct LOW_platformMisc::timestamp_t LOW_platformMisc::timestamp_t
 

Data structure for timestamps.


Member Function Documentation

const void LOW_platformMisc::diffTimestamp const timestamp_t   inT1,
const timestamp_t   inT2,
timestamp_t   outResult
[static]
 

Calculate difference of two timestamps.

Parameters:
inT1  A timestamp.
inT2  A timestamp.
outResult  T1-T2.

Definition at line 61 of file LOW_platformMisc.cpp.

References LOW_platformMisc::timestamp_t::milSec, and LOW_platformMisc::timestamp_t::sec.

Referenced by LOW_compJalousieController::measureTransitionDelays().

const std::string LOW_platformMisc::getHostname   [static]
 

Get the host's name.

Returns:
Host's name.

Definition at line 83 of file LOW_platformMisc.cpp.

References p_getHostname(), and runtimeInstance.

const LOW_platformMiscFactory::threadIdent_t LOW_platformMisc::getThreadID   [static]
 

Get identifier for current thread.

Returns:
Unique identifier for current thread.

Definition at line 77 of file LOW_platformMisc.cpp.

References p_getThreadID(), and runtimeInstance.

Referenced by LOW_link::commLock::commLock(), LOW_helper_msglog::fprintLogHeader(), and LOW_link::commLock::~commLock().

const void LOW_platformMisc::getTimestamp timestamp_t   outTimestamp [static]
 

Get a timestamp.

Parameters:
outTimestamp  Where timestamp should be written to.

Definition at line 55 of file LOW_platformMisc.cpp.

References p_getTimestamp(), and runtimeInstance.

Referenced by LOW_compJalousieController::measureTransitionDelays().

const void LOW_platformMisc::microSleep const unsigned long    inMicroSeconds [static]
 

Sleep for a specified number of micro seconds.

Parameters:
inMicroSeconds  Number of micro seconds to sleep.

Definition at line 37 of file LOW_platformMisc.cpp.

References p_microSleep(), and runtimeInstance.

const void LOW_platformMisc::milliSleep const unsigned long    inMilliSeconds [static]
 

Sleep for a specified number of milli seconds.

Parameters:
inMilliSeconds  Number of milli seconds to sleep.

Definition at line 31 of file LOW_platformMisc.cpp.

References p_milliSleep(), and runtimeInstance.

Referenced by LOW_compJalousieController::moveDownStop(), LOW_compJalousieController::moveUpStop(), LOW_linkDS2480B::resetLinkAdapter(), and LOW_linkDS2480B::strongPullup().

const void LOW_platformMisc::nanoSleep const unsigned int    inSeconds,
const unsigned long    inNanoSeconds
[static]
 

Sleep for a specified number of nano seconds.

Parameters:
inSeconds  Number of seconds to sleep.
inNanoSeconds  Number of additional nano seconds to sleep.

Definition at line 49 of file LOW_platformMisc.cpp.

References p_nanoSleep(), and runtimeInstance.

const void LOW_platformMisc::nanoSleep const unsigned long    inNanoSeconds [static]
 

Sleep for a specified number of nano seconds.

Parameters:
inNanoSeconds  Number of nano seconds to sleep.

Definition at line 43 of file LOW_platformMisc.cpp.

References p_nanoSleep(), and runtimeInstance.

virtual const std::string LOW_platformMisc::p_getHostname   [protected, pure virtual]
 

Get the host's name.

Virtual method to be implemented by OS specific subclasses.

Returns:
Host's name.

Reimplemented in LOW_platformMisc_Linux.

Referenced by getHostname().

virtual const LOW_platformMiscFactory::threadIdent_t LOW_platformMisc::p_getThreadID   [protected, pure virtual]
 

Get identifier for current thread.

Virtual method to be implemented by OS specific subclasses.

Returns:
Unique identifier for current thread.

Reimplemented in LOW_platformMisc_Linux.

Referenced by getThreadID().

virtual const void LOW_platformMisc::p_getTimestamp timestamp_t   outTimestamp [protected, pure virtual]
 

Get a timestamp.

Virtual method to be implemented by OS specific subclasses.

Parameters:
outTimestamp  Where timestamp should written to.

Referenced by getTimestamp().

virtual const void LOW_platformMisc::p_microSleep const unsigned long    inMicroSeconds [protected, pure virtual]
 

Sleep for a specified number of micro seconds.

Virtual method to be implemented by OS specific subclasses.

Parameters:
inMicroSeconds  Number of micro seconds to sleep.

Reimplemented in LOW_platformMisc_Linux.

Referenced by microSleep().

virtual const void LOW_platformMisc::p_milliSleep const unsigned long    inMilliSeconds [protected, pure virtual]
 

Sleep for a specified number of milli seconds.

Virtual method to be implemented by OS specific subclasses.

Parameters:
inMilliSeconds  Number of milli seconds to sleep.

Reimplemented in LOW_platformMisc_Linux.

Referenced by milliSleep().

virtual const void LOW_platformMisc::p_nanoSleep const unsigned int    inSeconds,
const unsigned long    inNanoSeconds
[protected, pure virtual]
 

Sleep for a specified number of nano seconds.

Virtual method to be implemented by OS specific subclasses.

Parameters:
inSeconds  Number of seconds to sleep.
inNanoSeconds  Number of additional nano seconds to sleep.

Reimplemented in LOW_platformMisc_Linux.

virtual const void LOW_platformMisc::p_nanoSleep const unsigned long    inNanoSeconds [protected, pure virtual]
 

Sleep for a specified number of nano seconds.

Virtual method to be implemented by OS specific subclasses.

Parameters:
inNanoSeconds  Number of nano seconds to sleep.

Reimplemented in LOW_platformMisc_Linux.

Referenced by nanoSleep().

virtual const void LOW_platformMisc::p_secSleep const unsigned int    inSeconds [protected, pure virtual]
 

Sleep for a specified number of seconds.

Virtual method to be implemented by OS specific subclasses.

Parameters:
inSeconds  Number of seconds to sleep.

Reimplemented in LOW_platformMisc_Linux.

Referenced by secSleep().

const void LOW_platformMisc::secSleep const unsigned int    inSeconds [static]
 

Sleep for a specified number of seconds.

Parameters:
inSeconds  Number of seconds to sleep.

Definition at line 25 of file LOW_platformMisc.cpp.

References p_secSleep(), and runtimeInstance.

Referenced by LOW_linkPassiveSerial::strongPullup().


Member Data Documentation

LOW_platformMisc * LOW_platformMisc::runtimeInstance = LOW_platformMiscFactory::new_platformMisc() [static, private]
 

Runtime instance of platform specific implementation of this class.

Having created this instance relieves the burden of explicitely creating/accessing an instance by users of methods in this class.

Definition at line 22 of file LOW_platformMisc.cpp.

Referenced by getHostname(), getThreadID(), getTimestamp(), microSleep(), milliSleep(), nanoSleep(), and secSleep().


The documentation for this class was generated from the following files:
Generated on Sun Jan 12 21:07:58 2003 by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001