F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
ComAggregator.hpp
Go to the documentation of this file.
1
// ======================================================================
2
// \title ComAggregator.hpp
3
// \author lestarch
4
// \brief hpp file for ComAggregator component implementation class
5
// ======================================================================
6
7
#ifndef Svc_ComAggregator_HPP
8
#define Svc_ComAggregator_HPP
9
10
#include <atomic>
11
#include "
Os/Mutex.hpp
"
12
#include "
Svc/ComAggregator/ComAggregatorComponentAc.hpp
"
13
14
namespace
Svc
{
15
16
class
ComAggregator
final :
public
ComAggregatorComponentBase
{
17
friend
class
ComAggregatorTester
;
// Allow unit test access to private members
18
public
:
19
// ----------------------------------------------------------------------
20
// Component construction and destruction
21
// ----------------------------------------------------------------------
22
24
ComAggregator
(
const
char
*
const
compName
25
);
26
28
~ComAggregator
();
29
30
void
preamble
()
override
;
31
32
private
:
33
// ----------------------------------------------------------------------
34
// Handler implementations for typed input ports
35
// ----------------------------------------------------------------------
36
41
void
comStatusIn_handler(
FwIndexType
portNum,
42
Fw::Success
& condition
43
)
override
;
44
48
void
dataIn_handler(
FwIndexType
portNum,
49
Fw::Buffer
& data,
50
const
ComCfg::FrameContext
& context)
override
;
51
55
void
dataReturnIn_handler(
FwIndexType
portNum,
56
Fw::Buffer
& data,
57
const
ComCfg::FrameContext
& context)
override
;
58
60
void
timeout_handler(
FwIndexType
portNum,
61
U32 context
62
)
override
;
63
64
private
:
65
// ----------------------------------------------------------------------
66
// Implementations for internal state machine actions
67
// ----------------------------------------------------------------------
68
72
void
Svc_AggregationMachine_action_doClear(
SmId
smId,
73
Svc_AggregationMachine::Signal
signal
74
)
override
;
75
79
void
Svc_AggregationMachine_action_doFill(
SmId
smId,
80
Svc_AggregationMachine::Signal
signal,
81
const
Svc::ComDataContextPair
& value
82
)
override
;
83
87
void
Svc_AggregationMachine_action_doSend(
SmId
smId,
88
Svc_AggregationMachine::Signal
signal
89
)
override
;
90
94
void
Svc_AggregationMachine_action_doHold(
SmId
smId,
95
Svc_AggregationMachine::Signal
signal,
96
const
Svc::ComDataContextPair
& value
97
)
override
;
98
102
void
Svc_AggregationMachine_action_assertNoStatus(
SmId
smId,
103
Svc_AggregationMachine::Signal
signal
104
)
override
;
105
106
private
:
107
// ----------------------------------------------------------------------
108
// Implementations for internal state machine guards
109
// ----------------------------------------------------------------------
110
114
bool
Svc_AggregationMachine_guard_isFull(
SmId
smId,
115
Svc_AggregationMachine::Signal
signal,
116
const
Svc::ComDataContextPair
& value
117
)
const override
;
118
122
bool
Svc_AggregationMachine_guard_willFill(
SmId
smId,
123
Svc_AggregationMachine::Signal
signal,
124
const
Svc::ComDataContextPair
& value
125
)
const override
;
126
130
bool
Svc_AggregationMachine_guard_isNotEmpty(
SmId
smId,
131
Svc_AggregationMachine::Signal
signal
132
)
const override
;
133
137
bool
Svc_AggregationMachine_guard_isGood(
SmId
smId,
138
Svc_AggregationMachine::Signal
signal,
139
const
Fw::Success
& value
140
)
const override
;
141
142
private
:
143
U8
m_frameBufferStore[
ComCfg::AggregationSize
];
144
Fw::Buffer::OwnershipState
m_bufferState =
145
Fw::Buffer::OwnershipState::OWNED
;
146
Fw::Buffer
m_frameBuffer;
147
Fw::ExternalSerializeBufferWithMemberCopy
m_frameSerializer;
148
ComCfg::FrameContext
m_lastContext;
149
150
Svc::ComDataContextPair
m_held;
151
std::atomic<bool> m_allow_timeout;
152
};
153
154
}
// namespace Svc
155
156
#endif
Svc::ComAggregator::ComAggregatorTester
friend class ComAggregatorTester
Definition:
ComAggregator.hpp:17
Svc::ComAggregatorComponentBase::SmId
SmId
State machine identifiers.
Definition:
ComAggregatorComponentAc.hpp:60
Svc::ComDataContextPair
Definition:
ComDataContextPairSerializableAc.hpp:21
Svc::ComAggregator
Definition:
ComAggregator.hpp:16
Svc::ComAggregator::~ComAggregator
~ComAggregator()
Destroy ComAggregator object.
Definition:
ComAggregator.cpp:22
ComCfg::AggregationSize
Definition:
FppConstantsAc.hpp:124
Svc::ComAggregator::preamble
void preamble() override
A function that will be called before the event loop is entered.
Definition:
ComAggregator.cpp:24
Mutex.hpp
ComAggregatorComponentAc.hpp
U8
uint8_t U8
8-bit unsigned integer
Definition:
BasicTypes.h:53
Svc::ComAggregatorComponentBase
Auto-generated base for ComAggregator component.
Definition:
ComAggregatorComponentAc.hpp:25
Svc::AggregationMachineStateMachineBase::Signal
Signal
The signal type.
Definition:
AggregationMachineStateMachineAc.hpp:46
Svc::ComAggregator::ComAggregator
ComAggregator(const char *const compName)
Construct ComAggregator object.
Definition:
ComAggregator.cpp:15
FwIndexType
PlatformIndexType FwIndexType
Definition:
FwIndexTypeAliasAc.h:15
Fw::Buffer::OwnershipState
OwnershipState
Definition:
Buffer.hpp:54
ComCfg::FrameContext
Type used to pass context info between components during framing/deframing.
Definition:
FrameContextSerializableAc.hpp:20
Fw::ExternalSerializeBufferWithMemberCopy
External serialize buffer with member copy semantics.
Definition:
Serializable.hpp:1552
Svc
RateGroupDivider component implementation.
Definition:
ActiveRateGroupCfg.hpp:18
Fw::Buffer::OwnershipState::OWNED
The buffer is currently owned.
Fw::Buffer
Definition:
Buffer.hpp:47
Fw::Success
Success/Failure.
Definition:
SuccessEnumAc.hpp:17
Svc
ComAggregator
ComAggregator.hpp
Generated by
1.8.14