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
33class RTTimerNode;
34
35class RTTimerActor : public RTActor
36{
37public:
39 virtual ~RTTimerActor( void );
40
41 RTS_INLINE
42 static RTTimerActor * soleInstance( void );
43
44 virtual void rtsBehavior( int, int ) override;
45
46 RTS_INLINE int anyPending( void ) const;
47 int numPending( void ) const;
48 int nextTimeout( RTTimespec & );
49
50 virtual int designLevel( void ) const override;
51
52 static const RTActorClass classData;
53 virtual const RTActor_class * getActorData( void ) const override;
54
55 void informIn( RTTimerNode * );
56 void informAt( RTTimerNode * );
57 void informAgain( RTTimerNode * );
58 void cancel( RTTimerNode * );
59 void cancelAll( Timing::Base * );
60
61 void adjustTimeBegin( void );
62 void adjustTimeEnd( const RTTimespec & delta,
63 RTController * originator );
64 static void getRelativeClock( RTTimespec & );
65
66protected:
67 RTTimerList pendingAbsolute;
68 RTTimerList pendingRelative;
69
70 static RTTimespec currentOffset;
71
72 void start( void );
73 void stop( void );
74
75 void sendTimeouts( void );
76
77 static const RTActor_class rtg_class;
78
79private:
80 static const RTStateId rtg_parent_state[];
81
82 static RTTimerActor * _soleInstance;
83
84 // unavailable methods
85 RTTimerActor( const RTTimerActor & );
86 RTTimerActor & operator=( const RTTimerActor & );
87}; //lint !e1712
88
89#if RTS_INLINES
90#include <RTTimerActor.inl>
91#endif
92
93#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:54
Definition: RTTimerActor.h:36
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
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