template<class Class>
OcaNumericObserverList class
Template parameters | |
---|---|
Class | - Class to wrap. |
Contents
This class template detects the methods and events defined for the class OcaNumericObserverList in the AES70 specification and exposes them through AES70. Note that all AES70 methods and event handlers need to be public in order to be detected.
Detects the following symbols with the corresponding detector classes:
GetLastObservation : aes70::
device:: Method Return values:
- Observation : OcaList<OcaFloat64>
GetState : aes70::
device:: Getter Return values:
- state : OcaObserverState
GetObservedProperties : aes70::
device:: Getter Return values:
- property : OcaList<OcaProperty>
SetObservedProperties : aes70::
device:: Setter Arguments:
- property : OcaList<OcaProperty>
GetThreshold : aes70::
device:: Getter Return values:
- Threshold : OcaFloat64
SetThreshold : aes70::
device:: Setter Arguments:
- Threshold : OcaFloat64
GetOperator : aes70::
device:: Getter Return values:
- _operator : OcaRelationalOperator
SetOperator : aes70::
device:: Setter Arguments:
- _operator : OcaRelationalOperator
GetTwoWay : aes70::
device:: Getter Return values:
- twoWay : OcaBoolean
SetTwoWay : aes70::
device:: Setter Arguments:
- twoWay : OcaBoolean
GetHysteresis : aes70::
device:: Getter Return values:
- hysteresis : OcaFloat64
SetHysteresis : aes70::
device:: Setter Arguments:
- hysteresis : OcaFloat64
GetPeriod : aes70::
device:: Getter Return values:
- period : OcaFloat32
SetPeriod : aes70::
device:: Setter Arguments:
- period : OcaFloat32
Detects the following event handlers:
- OnObservation with arguments:
- OcaEvent : OCP1::
Struct<OCP1:: OcaUint32, OCP1::Struct<OCP1::OcaUint16, OCP1::OcaUint16>> - OcaList : OCP1::OcaList<OCP1::OcaFloat64>
- OcaEvent : OCP1::
Detects the following event handlers for property changes (of type aes70::
- OnStateChanged with property encoder OCP1::
OcaUint8 - OnObservedPropertiesChanged with property encoder OCP1::
OcaList<OCP1:: Struct<OCP1:: OcaUint32, OCP1:: Struct<OCP1::Struct<OCP1::OcaUint16, OCP1::OcaUint16>, OCP1:: OcaUint8, OCP1::Struct<OCP1::OcaUint16, OCP1::OcaUint16>, OCP1::Struct<OCP1::OcaUint16, OCP1::OcaUint16>>>> - OnThresholdChanged with property encoder OCP1::
OcaFloat64 - OnOperatorChanged with property encoder OCP1::
OcaUint8 - OnTwoWayChanged with property encoder OCP1::
OcaBoolean - OnHysteresisChanged with property encoder OCP1::
OcaFloat64 - OnPeriodChanged with property encoder OCP1::
OcaFloat32
From the AES70 standard:
Observer of a scalar numeric or boolean property ("target property") of a set of specified objects. This class is a subclass of OcaNumericObserver, and differs from that class only in that it observes a set of properties rather than a single property. Does not work for array, list, map, struct, or string properties. OcaNumericObserverList emits an Observation event under certain conditions. There are three kinds of conditions:
- Numeric comparison. A target property value meets a certain comparison condition. A selection of comparison operators is available. Such observations are called "asynchronous observations".
- Timer expiry. The value of the Period property, if nonzero, is a the time interval for the recurrent timed emission of Observation events. Such events ("periodic observations") are emitted regardless of the target property's value.
- Combination of (1) and (2). If a numeric comparison and a nonzero period are both specified, then the Observation event is emitted when the timer expires and the numeric comparison is true for at least one of the observed properties. Such observations are called "conditional-periodic observations". This is a weakly typed class. Its threshold is specified as an OcaFloat64 number.
- For unsigned integer targets, the threshold and target are both coerced to OcaUint64 before comparing.
- For signed integer targets, the threshold and target are both coerced to OcaInt64 before comparing.
- For boolean values, the threshold hreshold and target are both coerced to OcaUint8, True is assigned the value One, False is assigned the value Zero. Note that this coercion may result in rounding errors if the observed datatype is of type OcaUint64 or OcaUint64. An OcaNumericObserver instance and the property it observes are bound at the time the OcaNumericObserver instance is constructed. For static devices, construction will occur during manufacture, or possibly during a subsequent hardware configuration step. For reconfigurable devices, construction might be done by online controllers as part of device configuration sessions. This class is normally used for monitoring readings of sensor readings, but may be used equally well for watching workers' parameter settings.
Base classes
-
template<class Class>class OcaAgent
Public static variables
- static const OcaClassVersionNumber ClassVersion
-
static const classid_
tpl<3> ClassId - static const size_t count_events
Public static functions
- static auto get_event_index(OcaEventID id, size_t index) -> AES70_ALWAYS_INLINE ptrdiff_t
Constructors, destructors, conversion operators
-
template<typename ... TN>OcaNumericObserverList(TN && ... args)
Public functions
- auto get_class_version() const -> uint16_t virtual
- auto get_classid() const -> const classid& virtual
-
void init(aes70::
device:: device* d, uint32_t n) virtual -
auto call(const OcaMethodID id,
const uint8_t* src,
const uint8_t* src_end,
uint8_t parameterCount,
const aes70::
response_generator& response) -> bool virtual - auto get_event_index(const OcaEventID OcaEventID) const -> ptrdiff_t virtual
Function documentation
template<classClass>
static AES70_ALWAYS_INLINE ptrdiff_t aes70:: device:: OcaNumericObserverList<Class>:: get_event_index(OcaEventID id,
size_t index)
Internal class for finding the event index of a given EventID. Returns -1 if the given event is not defined.
template<classClass>
template<typename ... TN>
aes70:: device:: OcaNumericObserverList<Class>:: OcaNumericObserverList(TN && ... args)
Constructor which calls the constructor of Class with args forwarded.
template<classClass>
uint16_t aes70:: device:: OcaNumericObserverList<Class>:: get_class_version() const virtual
Returns the AES70 class version of this object.
template<classClass>
const classid& aes70:: device:: OcaNumericObserverList<Class>:: get_classid() const virtual
Returns the AES70 class id of this object.
template<classClass>
void aes70:: device:: OcaNumericObserverList<Class>:: init(aes70:: device:: device* d,
uint32_t n) virtual
Called when this object is added to a device.
template<classClass>
bool aes70:: device:: OcaNumericObserverList<Class>:: call(const OcaMethodID id,
const uint8_t* src,
const uint8_t* src_end,
uint8_t parameterCount,
const aes70:: response_generator& response) virtual
Internal method used to call AES70 methods in this object.
template<classClass>
ptrdiff_t aes70:: device:: OcaNumericObserverList<Class>:: get_event_index(const OcaEventID OcaEventID) const virtual
Returns the index of a given event. The idea is that all events defined on a aes70 class can be enumerated. For events which this object does not implement, the value -1 is returned.
Variable documentation
template<classClass>
static const OcaClassVersionNumber aes70:: device:: OcaNumericObserverList<Class>:: ClassVersion
The ClassVersion of this class according to the AES70 standard.
template<classClass>
static const classid_ tpl<3> aes70:: device:: OcaNumericObserverList<Class>:: ClassId
The ClassID of this class according to the AES70 standard.
template<classClass>
static const size_t aes70:: device:: OcaNumericObserverList<Class>:: count_events
Number of events defined in this class. This depends on which events are implemented by Class.