16 #ifndef TRANSREC_CONFIG_PARAM_H 17 #define TRANSREC_CONFIG_PARAM_H 19 #include <epicsAssert.h> 21 #include <asynPortDriver.h> 23 #include "TRNonCopyable.h" 24 #include "TRConfigParamTraits.h" 28 #ifndef DOXYGEN_SHOULD_SKIP_THIS 35 class TRConfigParamBase
40 virtual void setSnapshotToDesired () = 0;
41 virtual void setEffectiveToSnapshot () = 0;
42 virtual void setEffectiveToInvalid () = 0;
64 template <
typename ValueType,
typename EffectiveValueType = ValueType>
66 private TRConfigParamBase,
71 typedef TRConfigParamTraits<ValueType> Traits;
72 typedef TRConfigParamTraits<EffectiveValueType> EffectiveTraits;
79 int m_effective_param;
80 ValueType m_snapshot_value;
81 EffectiveValueType m_invalid_value;
94 : m_initialized(false)
109 assert(m_initialized);
111 return m_snapshot_value;
124 return m_snapshot_value;
139 assert(m_initialized);
163 assert(m_initialized);
165 m_snapshot_value = value;
186 ValueType getDesired ();
198 void setDesired (ValueType value);
212 assert(m_initialized);
214 return m_desired_param;
218 void init (
TRBaseDriver *driver,
char const *base_name, EffectiveValueType invalid_value,
bool internal);
219 void setEffectiveParam (EffectiveValueType value);
223 void setSnapshotToDesired ();
224 void setEffectiveToSnapshot ();
225 void setEffectiveToInvalid ();
void setSnapshot(ValueType value)
Adjust the snapshot value for the current configuration.
Definition: TRConfigParam.h:161
void setIrrelevant()
Mark this parameter as irrelevant for the current configuration.
Definition: TRConfigParam.h:137
ValueType getSnapshotFast()
Like getSnapshot but does not have any asserts.
Definition: TRConfigParam.h:122
Central class of the Transient Recorder framework for transient recorders (digitizers).
Definition: TRBaseDriver.h:55
ValueType getSnapshot()
Return the current snapshot value of the parameter.
Definition: TRConfigParam.h:107
TRConfigParam()
Default constructor for configuration parameters.
Definition: TRConfigParam.h:93
Transient Recorder configuration parameter.
Definition: TRConfigParam.h:65
int desiredParamIndex()
Return the asyn parameter index of the desired-value parameter.
Definition: TRConfigParam.h:210