|
xentara-cpp-control v1.0.1
The Xentara C++ Control Framework
|
An class that represents a single input for a control. More...
#include <xentara/Input.hpp>
Public Member Functions | |
| Input () | |
| Constructor. | |
| Input (const Element &dataPoint) | |
| Constructor with datapoint Element. | |
| auto | operator= (const Element &dataPoint) -> Input & |
| Assignment operator that sets the data point to read from. | |
| auto | read (RunContext &context) const -> Type |
| Reads a value from the data point. | |
Related Symbols | |
(Note that these are not member symbols.) | |
| using | BooleanInput = Input< bool > |
| A type alias for an input that reads the data point as a C++ bool. | |
| using | SCharInput = Input< signed char > |
| A type alias for an input that reads the data point as an signed char. | |
| using | UCharInput = Input< unsigned char > |
| A type alias for an input that reads the data point as an unsigned char. | |
| using | ShortInput = Input< short > |
| A type alias for an input that reads the data point as a short. | |
| using | UShortInput = Input< unsigned short > |
| A type alias for an input that reads the data point as an unsigned short. | |
| using | IntInput = Input< int > |
| A type alias for an input that reads the data point as an integer. | |
| using | UIntInput = Input< unsigned int > |
| A type alias for an input that reads the data point as an unsigned integer. | |
| using | LongInput = Input< long > |
| A type alias for an input that reads the data point as a long. | |
| using | ULongInput = Input< unsigned long > |
| A type alias for an input that reads the data point as an unsigned long. | |
| using | LongLongInput = Input< long long > |
| A type alias for an input that reads the data point as a long long. | |
| using | ULongLongInput = Input< unsigned long long > |
| A type alias for an input that reads the data point as an unsigned long long. | |
| using | FloatInput = Input< float > |
| A type alias for an input that reads the data point as a float. | |
| using | DoubleInput = Input< double > |
| A type alias for an input that reads the data point as a double. | |
| using | UInt8Input = Input< std::uint8_t > |
| A type alias for an input that reads the data point as a 8 bit unsigned integer. | |
| using | UInt16Input = Input< std::uint16_t > |
| A type alias for an input that reads the data point as a 16 bit unsigned integer. | |
| using | UInt32Input = Input< std::uint32_t > |
| A type alias for an input that reads the data point as a 32 bit unsigned integer. | |
| using | UInt64Input = Input< std::uint64_t > |
| A type alias for an input that reads the data point as a 64 bit unsigned integer. | |
| using | Int8Input = Input< std::int8_t > |
| A type alias for an input that reads the data point as a 8 bit signed integer. | |
| using | Int16Input = Input< std::int16_t > |
| A type alias for an input that reads the data point as a 16 bit signed integer. | |
| using | Int32Input = Input< std::int32_t > |
| A type alias for an input that reads the data point as a 32 bit signed integer. | |
| using | Int64Input = Input< std::int64_t > |
| A type alias for an input that reads the data point as a 64 bit signed integer. | |
| using | Float32Input = Input< float > |
| A type alias for an input that reads the data point as a 32 bit floating point. | |
| using | Float64Input = Input< double > |
| A type alias for an input that reads the data point as a 64 bit floating point. | |
| using | StringInput = Input< std::string > |
| A type alias for an input that reads the data point as a string. | |
| using | WStringInput = Input< std::wstring > |
| A type alias for an input that reads the data point as a wstring. | |
| using | U8StringInput = Input< std::u8string > |
| A type alias for an input that reads the data point as a u8string. | |
| using | U16StringInput = Input< std::u16string > |
| A type alias for an input that reads the data point as a u16string. | |
| using | U32StringInput = Input< std::u32string > |
| A type alias for an input that reads the data point as a u32string. | |
| using | UUIDInput = Input< xentara::utils::core::Uuid > |
| A type alias for an input that reads the data point as a UUID. | |
| using | TimePointInput = Input< std::chrono::system_clock::time_point > |
| A type alias for an input that reads the data point as a time point. | |
An class that represents a single input for a control.
This class is used to define the inputs for your control code. You must declare one member of this class in your control class for each input your control code needs to read. The input must then be attached to an actual Xentara data point in the initialize() callback of your control class using the element assignment operator.
| Type | The C++ type for the read value. |
| xentara::Input< Type >::Input | ( | ) |
Constructor.
| xentara::Input< Type >::Input | ( | const Element & | dataPoint | ) |
Constructor with datapoint Element.
| dataPoint | The data point to read from. This can be a data point returned by Config::getDataPoint() or Model::findDataPoint(). |
| std::runtime_error | The requested element is not a data point in the Xentara model tree |
| std::runtime_error | The requested element has quality read handle error |
| std::runtime_error | The requested element has value read handle error |
| auto xentara::Input< Type >::operator= | ( | const Element & | dataPoint | ) | -> Input & |
Assignment operator that sets the data point to read from.
| dataPoint | The data point to read from. This can be a data point returned by Config::getDataPoint() or Model::findDataPoint(). |
| std::runtime_error | The requested element is not a data point in the Xentara model tree |
| std::runtime_error | The requested element has quality read handle error |
| std::runtime_error | The requested element has value read handle error |
| auto xentara::Input< Type >::read | ( | RunContext & | context | ) | const -> Type |
Reads a value from the data point.
The read value will be converted to the type specified by the Type template parameter, if possible. If the value cannot be converted, the function will set the type mismatch error in the run context.
The read function first checks the quality of the input. If the quality is bad, it will set the BadQuality error in the context and do nothing further. If the quality is not bad, it tries to read the value of the datapoint. If there is any error such as OutOfRange or TypeMismatch and so on, it will set the error code in the context and do nothing further. A default Type() will be returned in case of error. After read function, you need to check for error in the context.
| context | The run context passed to the step() callback of your control class. |
|
related |
A type alias for an input that reads the data point as a C++ bool.
|
related |
A type alias for an input that reads the data point as a double.
|
related |
A type alias for an input that reads the data point as a 32 bit floating point.
|
related |
A type alias for an input that reads the data point as a 64 bit floating point.
|
related |
A type alias for an input that reads the data point as a float.
|
related |
A type alias for an input that reads the data point as a 16 bit signed integer.
|
related |
A type alias for an input that reads the data point as a 32 bit signed integer.
|
related |
A type alias for an input that reads the data point as a 64 bit signed integer.
|
related |
A type alias for an input that reads the data point as a 8 bit signed integer.
A type alias for an input that reads the data point as an integer.
A type alias for an input that reads the data point as a long.
A type alias for an input that reads the data point as a long long.
A type alias for an input that reads the data point as an signed char.
|
related |
A type alias for an input that reads the data point as a short.
|
related |
A type alias for an input that reads the data point as a string.
|
related |
A type alias for an input that reads the data point as a time point.
|
related |
A type alias for an input that reads the data point as a u16string.
|
related |
A type alias for an input that reads the data point as a u32string.
|
related |
A type alias for an input that reads the data point as a u8string.
A type alias for an input that reads the data point as an unsigned char.
|
related |
A type alias for an input that reads the data point as a 16 bit unsigned integer.
|
related |
A type alias for an input that reads the data point as a 32 bit unsigned integer.
|
related |
A type alias for an input that reads the data point as a 64 bit unsigned integer.
|
related |
A type alias for an input that reads the data point as a 8 bit unsigned integer.
A type alias for an input that reads the data point as an unsigned integer.
A type alias for an input that reads the data point as an unsigned long.
A type alias for an input that reads the data point as an unsigned long long.
A type alias for an input that reads the data point as an unsigned short.
|
related |
A type alias for an input that reads the data point as a UUID.
|
related |
A type alias for an input that reads the data point as a wstring.