|
xentara-cpp-control v1.0.1
The Xentara C++ Control Framework
|
An class that represents a single output for a control. More...
#include <xentara/Output.hpp>
Public Member Functions | |
| Output () | |
| Constructor. | |
| Output (const Element &dataPoint) | |
| Constructor with datapoint Element. | |
| auto | operator= (const Element &dataPoint) -> Output & |
| Assignment operator that sets the data point to read from. | |
| auto | write (RunContext &context, const Type &value) -> std::error_code |
| Writes a value to the data point. | |
| auto | write (RunContext &context, Type &&value) -> std::error_code |
| Writes a value to the data point. | |
Related Symbols | |
(Note that these are not member symbols.) | |
Typed outputs | |
| using | BooleanOutput = Output< bool > |
| A type alias for an output that reads the data point as a C++ bool. | |
| using | SCharOutput = Output< signed char > |
| A type alias for an output that reads the data point as an signed char. | |
| using | UCharOutput = Output< unsigned char > |
| A type alias for an output that reads the data point as an unsigned char. | |
| using | ShortOutput = Output< short > |
| A type alias for an output that reads the data point as a short. | |
| using | UShortOutput = Output< unsigned short > |
| A type alias for an output that reads the data point as an unsigned short. | |
| using | IntOutput = Output< int > |
| A type alias for an output that reads the data point as an integer. | |
| using | UIntOutput = Output< unsigned int > |
| A type alias for an output that reads the data point as an unsigned integer. | |
| using | LongOutput = Output< long > |
| A type alias for an output that reads the data point as a long. | |
| using | ULongOutput = Output< unsigned long > |
| A type alias for an output that reads the data point as an unsigned long. | |
| using | LongLongOutput = Output< long long > |
| A type alias for an output that reads the data point as a long long. | |
| using | ULongLongOutput = Output< unsigned long long > |
| A type alias for an output that reads the data point as an unsigned long long. | |
| using | FloatOutput = Output< float > |
| A type alias for an output that reads the data point as a float. | |
| using | DoubleOutput = Output< double > |
| A type alias for an output that reads the data point as a double. | |
| using | UInt8Output = Output< std::uint8_t > |
| A type alias for an output that reads the data point as a 8 bit unsigned integer. | |
| using | UInt16Output = Output< std::uint16_t > |
| A type alias for an output that reads the data point as a 16 bit unsigned integer. | |
| using | UInt32Output = Output< std::uint32_t > |
| A type alias for an output that reads the data point as a 32 bit unsigned integer. | |
| using | UInt64Output = Output< std::uint64_t > |
| A type alias for an output that reads the data point as a 64 bit unsigned integer. | |
| using | Int8Output = Output< std::int8_t > |
| A type alias for an output that reads the data point as a 8 bit signed integer. | |
| using | Int16Output = Output< std::int16_t > |
| A type alias for an output that reads the data point as a 16 bit signed integer. | |
| using | Int32Output = Output< std::int32_t > |
| A type alias for an output that reads the data point as a 32 bit signed integer. | |
| using | Int64Output = Output< std::int64_t > |
| A type alias for an output that reads the data point as a 64 bit signed integer. | |
| using | Float32Output = Output< float > |
| A type alias for an output that reads the data point as a 32 bit floating point. | |
| using | Float64Output = Output< double > |
| A type alias for an output that reads the data point as a 64 bit floating point. | |
| using | StringOutput = Output< std::string > |
| A type alias for an output that reads the data point as a string. | |
| using | WStringOutput = Output< std::wstring > |
| A type alias for an output that reads the data point as a wstring. | |
| using | U8StringOutput = Output< std::u8string > |
| A type alias for an output that reads the data point as a u8string. | |
| using | U16StringOutput = Output< std::u16string > |
| A type alias for an output that reads the data point as a u16string. | |
| using | U32StringOutput = Output< std::u32string > |
| A type alias for an output that reads the data point as a u32string. | |
| using | UUIDOutput = Output< xentara::utils::core::Uuid > |
| A type alias for an output that reads the data point as a UUID. | |
| using | TimePointOutput = Output< std::chrono::system_clock::time_point > |
| A type alias for an output that reads the data point as a time point. | |
An class that represents a single output for a control.
This is class is used to define the outputs for your control code. You must declare one member of this class in your control class for each output your control code needs to read. The output must then be attached to an actual Xentara data point in the initialize() callback of your control class using the data point element assignment operator.
| Type | The C++ type for the write value. |
| xentara::Output< Type >::Output | ( | ) |
Constructor.
| xentara::Output< Type >::Output | ( | const Element & | dataPoint | ) |
Constructor with datapoint Element.
| dataPoint | The data point to write to. 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 value write handle error |
| auto xentara::Output< Type >::operator= | ( | const Element & | dataPoint | ) | -> Output & |
Assignment operator that sets the data point to read from.
| dataPoint | The data point to write to. 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 value write handle error |
| auto xentara::Output< Type >::write | ( | RunContext & | context, |
| const Type & | value | ||
| ) | -> std::error_code |
Writes a value to the data point.
The value will be converted to the type used by the target, if possible. If the value cannot be converted, the function will set the type mismatch error in the run context.
The write function first checks if there is any error in the context. If there is any error, the write will not be performed and the same error code will be returned. If there is no error in the context, the write is performed and appropiate error code is returned
| context | The run context passed to the step() callback of your control class. |
| value | The value which has to be written to the element. |
| auto xentara::Output< Type >::write | ( | RunContext & | context, |
| Type && | value | ||
| ) | -> std::error_code |
Writes a value to the data point.
The value will be converted to the type used by the target, if possible. If the value cannot be converted, the function will set the type mismatch error in the run context.
The write function first checks if there is any error in the context. If there is any error, the write will not be performed and the same error code will be returned. If there is no error in the context, the write is performed and appropiate error code is returned
| context | The run context passed to the step() callback of your control class. |
| value | The value which has to be written to the element. |
|
related |
A type alias for an output that reads the data point as a C++ bool.
|
related |
A type alias for an output that reads the data point as a double.
|
related |
A type alias for an output that reads the data point as a 32 bit floating point.
|
related |
A type alias for an output that reads the data point as a 64 bit floating point.
|
related |
A type alias for an output that reads the data point as a float.
|
related |
A type alias for an output that reads the data point as a 16 bit signed integer.
|
related |
A type alias for an output that reads the data point as a 32 bit signed integer.
|
related |
A type alias for an output that reads the data point as a 64 bit signed integer.
|
related |
A type alias for an output that reads the data point as a 8 bit signed integer.
A type alias for an output that reads the data point as an integer.
A type alias for an output that reads the data point as a long long.
|
related |
A type alias for an output that reads the data point as a long.
A type alias for an output that reads the data point as an signed char.
|
related |
A type alias for an output that reads the data point as a short.
|
related |
A type alias for an output that reads the data point as a string.
|
related |
A type alias for an output that reads the data point as a time point.
|
related |
A type alias for an output that reads the data point as a u16string.
|
related |
A type alias for an output that reads the data point as a u32string.
|
related |
A type alias for an output that reads the data point as a u8string.
A type alias for an output that reads the data point as an unsigned char.
|
related |
A type alias for an output that reads the data point as a 16 bit unsigned integer.
|
related |
A type alias for an output that reads the data point as a 32 bit unsigned integer.
|
related |
A type alias for an output that reads the data point as a 64 bit unsigned integer.
|
related |
A type alias for an output that reads the data point as a 8 bit unsigned integer.
A type alias for an output that reads the data point as an unsigned integer.
A type alias for an output that reads the data point as an unsigned long long.
A type alias for an output that reads the data point as an unsigned long.
A type alias for an output that reads the data point as an unsigned short.
|
related |
A type alias for an output that reads the data point as a UUID.
|
related |
A type alias for an output that reads the data point as a wstring.