summaryrefslogtreecommitdiffstats
path: root/c/src/lib/include/rtems++/rtemsTimer.h
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1999-08-30 18:38:26 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1999-08-30 18:38:26 +0000
commita71938283c65531e49a6398905be59705c36b748 (patch)
tree510baa09390975da38b75eae9dab4b267c7e3674 /c/src/lib/include/rtems++/rtemsTimer.h
parentPatch from Ralf Corsepius <corsepiu@faw.uni-ulm.de>: (diff)
downloadrtems-a71938283c65531e49a6398905be59705c36b748.tar.bz2
Patch from Ralf Corsepius <corsepiu@faw.uni-ulm.de> to move
c/src/lib/librtems++ and c/src/lib/include/rtems++ to their own package librtems++ at the top of the tree. To apply: mkdir c/src/librtems++ cp c/src/lib/librtems++/README c/src/librtems++ mkdir c/src/librtems++/src cp c/src/lib/librtems++/*.cc c/src/librtems++/src cp c/src/lib/librtems++/Makefile.in c/src/librtems++/src mkdir c/src/librtems++/include mkdir c/src/librtems++/include/rtems++ cp c/src/lib/include/rtems++/*.h c/src/librtems++/include/rtems++ patch -p1 <rtems-rc-19990802-5.diff rm -rf c/src/lib/librtems++ rm -rf c/src/lib/include/rtems++ ./autogen Attention: * The procedure above copies the files first, then patches them and finally removes the old files afterwards. This has been done to enable you to copy the files in CVS to preserve their history.
Diffstat (limited to '')
-rw-r--r--c/src/lib/include/rtems++/rtemsTimer.h145
1 files changed, 0 insertions, 145 deletions
diff --git a/c/src/lib/include/rtems++/rtemsTimer.h b/c/src/lib/include/rtems++/rtemsTimer.h
deleted file mode 100644
index 43401bab73..0000000000
--- a/c/src/lib/include/rtems++/rtemsTimer.h
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- ------------------------------------------------------------------------
- $Id$
- ------------------------------------------------------------------------
-
- COPYRIGHT (c) 1997
- Objective Design Systems Ltd Pty (ODS)
- All rights reserved (R) Objective Design Systems Ltd Pty
-
- The license and distribution terms for this file may be found in the
- file LICENSE in this distribution or at
- http://www.OARcorp.com/rtems/license.html.
-
- ------------------------------------------------------------------------
-
- rtemsTimer class.
-
- This class allows the user to create a RTEMS timer.
-
- The trigger method is called when the timer expires. The method is
- called using the thread which calls the RTEMS 'rtems_clock_tick'
- method.
-
- Timers are always local to a node.
-
- ------------------------------------------------------------------------ */
-
-#if !defined(_rtemsTimer_h_)
-#define _rtemsTimer_h_
-
-#include <rtems++/rtemsStatusCode.h>
-
-/* ----
- rtemsTimer
-*/
-
-class rtemsTimer
- : public rtemsStatusCode
-{
-public:
- // only the first 4 characters of the name are taken,
-
- // create a timer object
- rtemsTimer(const char* name);
- rtemsTimer();
-
- // destroies the actual object
- virtual ~rtemsTimer();
-
- // create or destroy (delete) the timer
- virtual const rtems_status_code create(const char* name);
- virtual const rtems_status_code destroy();
-
- // timer control
- inline const rtems_status_code fire_after(const rtems_interval micro_secs);
- inline const rtems_status_code repeat_fire_at(const rtems_interval micro_secs);
- inline const rtems_status_code fire_when(const rtems_time_of_day& when);
-
- inline const rtems_status_code cancel();
- inline const rtems_status_code reset();
-
- // object id, and name
- const rtems_id id_is() const { return id; }
- const rtems_name name_is() const { return name; }
- const char *name_string() const { return name_str; }
-
-protected:
-
- // triggered method is called when the timer fires
- virtual void triggered() = 0;
-
-private:
- // not permitted
- rtemsTimer(const rtemsTimer& timer);
- rtemsTimer& operator=(const rtemsTimer& timer);
-
- // make this object reference an invalid RTEMS object
- void make_invalid();
-
- // semaphore name
- rtems_name name;
- char name_str[5];
-
- // repeat true restart the timer when it fires
- bool repeat;
-
- // the rtems id, object handle
- rtems_id id;
-
- // common timer handler
- static void common_handler(rtems_id id, void *user_data);
-};
-
-const rtems_status_code rtemsTimer::fire_after(const rtems_interval micro_secs)
-{
- repeat = false;
- rtems_interval usecs =
- micro_secs && (micro_secs < _TOD_Microseconds_per_tick) ?
- _TOD_Microseconds_per_tick : micro_secs;
- return set_status_code(rtems_timer_fire_after(id,
- TOD_MICROSECONDS_TO_TICKS(usecs),
- common_handler,
- this));
-}
-
-const rtems_status_code rtemsTimer::repeat_fire_at(const rtems_interval micro_secs)
-{
- repeat = true;
- rtems_interval usecs =
- micro_secs && (micro_secs < _TOD_Microseconds_per_tick) ?
- _TOD_Microseconds_per_tick : micro_secs;
- return set_status_code(rtems_timer_fire_after(id,
- TOD_MICROSECONDS_TO_TICKS(usecs),
- common_handler,
- this));
-}
-
-const rtems_status_code rtemsTimer::fire_when(const rtems_time_of_day& when)
-{
- return set_status_code(rtems_timer_fire_when(id,
- (rtems_time_of_day*) &when,
- common_handler,
- this));
-}
-
-const rtems_status_code rtemsTimer::cancel()
-{
- repeat = false;
- return set_status_code(rtems_timer_cancel(id));
-}
-
-const rtems_status_code rtemsTimer::reset()
-{
- return set_status_code(rtems_timer_reset(id));
-}
-
-#endif // _rtemsTimer_h_
-
-
-
-
-
-
-
-