A Xentara attribute.
More...
#include <xentara/model/Attribute.hpp>
|
|
template<std::equality_comparable_with< std::string_view > String, typename... Attributes> |
static auto | resolve (const String &name, const Attribute &firstAttribute, const Attributes &... moreAttributes) -> const Attribute * |
| deprecated Checks the name of a list of attributes and returns the first one that matches
|
|
A Xentara attribute.
- Note
- This class merely identifies the attribute, it does not represent the attribute of an individual element. To access the attribute of a specific Xentara element, use the the class ElementAttribute.
- See also
- ElementAttribute
-
Attributes in the Xentara user manual
- Examples
- PublishingConfigAttributes.cpp.
◆ Access
An Access type for an attribute.
Enumerator |
---|
ReadOnly | The attribute supports reading only.
|
WriteOnly | The attribute supports writing only.
|
ReadWrite | The attribute supports reading and writing.
|
◆ Attribute() [1/2]
Constructor for attributes with built-in roles.
- Parameters
-
role | The role of the attribute. |
access | The possible access modes for the attribute |
dataType | The data type of the attribute |
◆ Attribute() [2/2]
Constructor for custom attributes.
- Parameters
-
uuid | The UUID of the attribute |
name | The name of the attribute, in UTF-8 encoding. The string data the view references to is not copied. It must remain valid for the lifetime of the plugin. |
To keep naming conventions as consistent as possible between plugins, Xentara provides a set of predefined attribute names. All things being equal, you should prefer using one of the predefines names. If the documentation, the specification, or common usage for your plugin use different nomenclature, however, you should prefer that over the standard names.
If your attribute references another element, you sould use the name of the element. If your attribute references an I/O device, for example, you should use xentara::io::ComponentClass::kDevice as the name.
- Parameters
-
access | The possible access modes for the attribute |
dataType | The data type of the attribute |
ioDirections | The relevant I/O directions.
The I/O directions are used for I/O attributes to specify whether a data point should inherit this attribute from its attached input and/or output. If the directions contain the flag io::Direction::Input, then the data point will inherit this attribute from its input. If the directions contain the flag io::Direction::Output, then the data point will inherit this attribute from its output. If you do not set either flag (the default), then the attribute will not be considered an I/O attribute and will not be inherited by any data points.
|
◆ access()
auto xentara::model::Attribute::access |
( |
| ) |
const -> Access
|
◆ dataType()
auto xentara::model::Attribute::dataType |
( |
| ) |
const -> const data::DataType &
|
◆ ioDirections()
auto xentara::model::Attribute::ioDirections |
( |
| ) |
const -> io::Directions
|
Gets the relevant I/O directions.
- Returns
- The I/O directions. The I/O directions are used for I/O attributes to specify whether a data point should inherit this attribute from its attached input and/or output.
◆ name()
Gets the name.
- Returns
- The name, in UTF-8 encoding
◆ operator==() [1/4]
auto xentara::model::Attribute::operator== |
( |
const Attribute & |
rhs | ) |
const -> bool
|
Checks whether a reference refers to this attribute.
This operator checks the identity of the objects, not the properties. The operator returns true only if the rhs refers to the same object as this. It is equivalent to this == std::addressof(rhs)
.
- Returns
- Returns true if the attribute has the given name.
◆ operator==() [2/4]
auto xentara::model::Attribute::operator== |
( |
const Role & |
rhs | ) |
const -> bool
|
Checks the role of the attribute.
This is a convenience operator you can use to check the UUID of an attribute. It is equivalent to uuid() == rhs.uuid()
.
- Returns
- Returns true if the attribute has the same UUID as the role.
◆ operator==() [3/4]
auto xentara::model::Attribute::operator== |
( |
const String & |
rhs | ) |
const -> bool
|
Checks the name of the attribute.
This is a convenience operator you can use to check the name of an attribute. It is equivalent to name() == rhs
.
- Returns
- Returns true if the attribute has the given name.
◆ operator==() [4/4]
auto xentara::model::Attribute::operator== |
( |
const UUID & |
rhs | ) |
const -> bool
|
Checks the UUID of the attribute.
This is a convenience operator you can use to check the UUID of an attribute. It is equivalent to uuid() == rhs
.
- Returns
- Returns true if the attribute has the given UUID.
◆ resolve()
template<std::equality_comparable_with<
std::string_view > String, typename... Attributes>
static auto xentara::model::Attribute::resolve |
( |
const String & |
name, |
|
|
const Attribute & |
firstAttribute, |
|
|
const Attributes &... |
moreAttributes |
|
) |
| -> const Attribute *
|
|
static |
deprecated Checks the name of a list of attributes and returns the first one that matches
- Deprecated:
- This function is no longer used
◆ setAccess()
auto xentara::model::Attribute::setAccess |
( |
Access |
access | ) |
-> void
|
◆ setDataType()
◆ setIoDirections()
auto xentara::model::Attribute::setIoDirections |
( |
io::Directions |
ioDirections | ) |
-> void
|
Sets the relevant I/O directions.
- Parameters
-
ioDirections | The desired I/O directions. The I/O directions are used for I/O attributes to specify whether a data point should inherit this attribute from its attached input and/or output. |
◆ uuid()
◆ kAddress
The standard name for an address.
◆ kCategory
const Attribute xentara::model::Attribute::kCategory |
|
static |
The attribute for the element category of an element.
◆ kChangeTime
const Attribute xentara::model::Attribute::kChangeTime |
|
static |
The attribute for the change time stamp of a value.
◆ kChannel
The standard name for a channel.
◆ kDataType
The role for a data type.
◆ kDeviceState
const Attribute xentara::model::Attribute::kDeviceState |
|
static |
The attribute for the state of a device.
◆ kError
const Role xentara::model::Attribute::kError |
|
static |
The standard name for an error.
◆ kLength
The standard name for a length.
◆ kName
const Attribute xentara::model::Attribute::kName |
|
static |
The attribute for the name of an element.
◆ kOffset
The standard name for an offset.
◆ kPrimaryKey
const Attribute xentara::model::Attribute::kPrimaryKey |
|
static |
The attribute for the primary key of an element.
◆ kQuality
const Attribute xentara::model::Attribute::kQuality |
|
static |
The attribute for the quality of a value.
◆ kSourceTime
const Attribute xentara::model::Attribute::kSourceTime |
|
static |
The attribute for the time stamp of a value provided by the data source, like the device.
◆ kType
const Attribute xentara::model::Attribute::kType |
|
static |
The attribute for the type (class) of an element.
◆ kUpdateTime
const Attribute xentara::model::Attribute::kUpdateTime |
|
static |
The attribute for the update time stamp of a value.
◆ kUuid
const Attribute xentara::model::Attribute::kUuid |
|
static |
The attribute for the UUID of an element.
◆ kValue
const Role xentara::model::Attribute::kValue |
|
static |
◆ kWriteError
const Role xentara::model::Attribute::kWriteError |
|
static |
The standard name for a write error.
◆ kWriteTime
const Attribute xentara::model::Attribute::kWriteTime |
|
static |
The attribute for the time stamp of the last attempted write operation of an output.
◆ ReadOnly
constexpr Access xentara::model::Attribute::ReadOnly |
|
staticconstexpr |
◆ ReadWrite
constexpr Access xentara::model::Attribute::ReadWrite |
|
staticconstexpr |
◆ WriteOnly
constexpr Access xentara::model::Attribute::WriteOnly |
|
staticconstexpr |