29 using namespace Utils;
38 explicit IRTJmbInParameter(std::shared_ptr<IJmbParamDef> iParamDef) : fParamDef{std::move(iParamDef)} {}
44 ParamID
getParamID()
const {
return fParamDef->fParamID; }
50 virtual bool hasUpdate()
const = 0;
53 virtual tresult readFromMessage(
Message const &iMessage) = 0;
59 virtual void writeToStream(std::ostream &oStream)
const = 0;
79 fUpdateQueue{std::make_unique<T>(iParamDef->fDefaultValue),
true}
98 bool hasUpdate()
const override {
return !fUpdateQueue.isEmpty(); }
101 tresult readFromMessage(
Message const &iMessage)
override;
104 void writeToStream(std::ostream &oStream)
const override;
116 bool res = fUpdateQueue.updateAndPushIf([
this, &iMessage](
auto oUpdate) ->
bool {
117 return getParamDefT()->readFromMessage(iMessage, *oUpdate) == kResultOk;
120 return res ? kResultOk : kResultFalse;
129 getParamDefT()->writeToStream(*last(), oStream);
148 inline ParamID
getParamID()
const {
return fPtr->getParamID(); }
151 inline T *
pop() {
return fPtr->pop(); }
154 inline T
const *
last()
const {
return fPtr->last(); }
157 inline T
const *
popOrLast() {
return fPtr->popOrLast(); }
163 inline T
const &
getValue()
const {
return *fPtr->last(); }
166 inline T
const &
value()
const {
return *fPtr->last(); }
169 inline operator T
const &()
const {
return *fPtr->last(); }
T * pop()
Definition: RTJmbInParameter.h:151
JmbParamDef< T > const * getParamDefT() const
Definition: RTJmbInParameter.h:83
T ParamType
Definition: RTJmbInParameter.h:75
ParamID getParamID() const
Definition: RTJmbInParameter.h:44
Definition: ParamDef.h:199
tresult readFromMessage(Message const &iMessage) override
Definition: RTJmbInParameter.h:114
bool hasUpdate() const
Definition: RTJmbInParameter.h:160
Definition: Messaging.h:43
Definition: RTJmbInParameter.h:142
Definition: MessageHandler.h:30
ParamType const * popOrLast()
Definition: RTJmbInParameter.h:95
T const * operator->() const
Definition: RTJmbInParameter.h:172
RTJmbInParameter< T > * fPtr
Definition: RTJmbInParameter.h:175
T const & value() const
Definition: RTJmbInParameter.h:166
ParamType const * last() const
Definition: RTJmbInParameter.h:92
ParamType * pop()
Definition: RTJmbInParameter.h:89
Definition: RTJmbInParameter.h:72
std::shared_ptr< IJmbParamDef > fParamDef
Definition: RTJmbInParameter.h:62
ParamID getParamID() const
Definition: RTJmbInParameter.h:148
Definition: RTJmbInParameter.h:34
RTJmbInParameter(std::shared_ptr< JmbParamDef< T >> iParamDef)
Definition: RTJmbInParameter.h:77
void writeToStream(std::ostream &oStream) const override
Definition: RTJmbInParameter.h:127
T const * last() const
Definition: RTJmbInParameter.h:154
T const * popOrLast()
Definition: RTJmbInParameter.h:157
IJmbParamDef const * getParamDef() const
Definition: RTJmbInParameter.h:41
T const & getValue() const
Definition: RTJmbInParameter.h:163
Definition: Concurrent.h:148
bool hasUpdate() const override
Definition: RTJmbInParameter.h:98
Definition: ParamDef.h:225
IRTJmbInParameter(std::shared_ptr< IJmbParamDef > iParamDef)
Definition: RTJmbInParameter.h:38
RTJmbInParam(RTJmbInParameter< T > *iPtr)
Definition: RTJmbInParameter.h:145
tresult handleMessage(Message const &iMessage) override
Definition: RTJmbInParameter.h:56