C++ TargetRTS
Loading...
Searching...
No Matches
RTTimerActor.h
1/*
2 * Licensed Materials - Property of HCL and/or IBM
3 * Copyright HCL Technologies Ltd. 2016, 2021. All Rights Reserved.
4 * Copyright IBM Corporation 1999, 2016. All Rights Reserved.
5 *
6 * U.S. Government Users Restricted Rights - Use, duplication or
7 * disclosure restricted by GSA ADP Schedule.
8 */
9
10#ifndef __RTTimerActor_h__
11#define __RTTimerActor_h__ included
12
13#ifdef PRAGMA
14#pragma interface
15#endif
16
17#ifndef __RTActor_h__
18#include <RTActor.h>
19#endif
20
21#ifndef __RTTimerList_h__
22#include <RTTimerList.h>
23#endif
24
25#ifndef __RTTimespec_h__
26#include <RTTimespec.h>
27#endif
28
29#ifndef __RTTiming_h__
30#include <RTTiming.h>
31#endif
32
33#include "RTSyncObject.h"
34class RTTimerNode;
35
36class RTTimerActor : public RTActor
37{
38public:
40 virtual ~RTTimerActor( void );
41
42 RTS_INLINE
43 static RTTimerActor * soleInstance( void );
44 static void waitUntilInstanceReady( void );
45 virtual void rtsBehavior( int, int ) override;
46
47 RTS_INLINE int anyPending( void ) const;
48 int numPending( void ) const;
49 int nextTimeout( RTTimespec & );
50
51 virtual int designLevel( void ) const override;
52
53 static const RTActorClass classData;
54 virtual const RTActor_class * getActorData( void ) const override;
55
56 friend class RTTracer;
57
58 void informIn( RTTimerNode * );
59 void informAt( RTTimerNode * );
60 void informAgain( RTTimerNode * );
61 void cancel( RTTimerNode * );
62 void cancelAll( Timing::Base * );
63
64 void adjustTimeBegin( void );
65 void adjustTimeEnd( const RTTimespec & delta,
66 RTController * originator );
67 static void getRelativeClock( RTTimespec & );
68
69protected:
70 RTTimerList pendingAbsolute;
71 RTTimerList pendingRelative;
72
73 static RTTimespec currentOffset;
74
75 void start( void );
76 void stop( void );
77
78 void sendTimeouts( void );
79
80 static const RTActor_class rtg_class;
81
82private:
83 static const RTStateId rtg_parent_state[];
84
85 static RTTimerActor * _soleInstance;
86 static RTSyncObject _syncInstance;
87
88 // unavailable methods
89 RTTimerActor( const RTTimerActor & );
90 RTTimerActor & operator=( const RTTimerActor & );
91}; //lint !e1712
92
93#if RTS_INLINES
94#include <RTTimerActor.inl>
95#endif
96
97#endif // __RTTimerActor_h__
An instance of this class represents a capsule instance.
Definition: RTActor.h:44
Represents a capsule part.
Definition: RTActorRef.h:39
A controller manages a group of capsule instances that all run in the same physical thread (i....
Definition: RTController.h:56
Definition: RTTimerActor.h:37
virtual void rtsBehavior(int, int) override
Defines the state machine behavior for this capsule instance.
virtual const RTActor_class * getActorData(void) const override
Get information (meta data) about the capsule, such as its name, ports, states etc.
Definition: RTTimerList.h:26
Definition: RTTimerNode.h:47
Definition: RTTracer.h:20
Represents a timer port.
Definition: RTTiming.h:43
Definition: RTActor_class.h:49
A type descriptor providing information about the external characteristics of a capsule.
Definition: RTActorClass.h:36
A time value which can represent either an absolute or relative time.
Definition: RTTimespec.h:29