AgIsoStack++
A control-function-focused implementation of the major ISOBUS and J1939 protocols
|
DeviceElementObject is the object definition of the XML element DeviceElement. The attribute Type specifies the type of this particular element definition. More...
#include <isobus_task_controller_client_objects.hpp>
Public Types | |
enum class | Type : std::uint8_t { Device = 1 , Function = 2 , Bin = 3 , Section = 4 , Unit = 5 , Connector = 6 , NavigationReference = 7 } |
Enumerates the types of device element object. More... | |
Public Member Functions | |
DeviceElementObject (std::string deviceElementDesignator, std::uint16_t deviceElementNumber, std::uint16_t parentObjectID, Type deviceEelementType, std::uint16_t uniqueID) | |
Constructor for a DeviceElementObject. | |
~DeviceElementObject () override=default | |
Destructor for a DeviceElementObject. | |
std::string | get_table_id () const override |
Returns the XML namespace for the object. | |
ObjectTypes | get_object_type () const override |
Returns the object type. | |
std::vector< std::uint8_t > | get_binary_object () const override |
Returns the binary representation of the TC object, or an empty vector if object is invalid. | |
std::uint16_t | get_element_number () const |
Returns the element number. | |
void | set_element_number (std::uint16_t newElementNumber) |
Update the object's element number to a new value. | |
std::uint16_t | get_parent_object () const |
Returns the parent object ID. | |
void | set_parent_object (std::uint16_t parentObjectID) |
Updates the object ID associated to this object's parent object. | |
Type | get_type () const |
Returns the type of the element object. | |
void | add_reference_to_child_object (std::uint16_t childID) |
This function can be called to add an object as a child of this object. | |
bool | remove_reference_to_child_object (std::uint16_t childID) |
Removes a child object reference from this object. | |
std::uint16_t | get_number_child_objects () const |
Returns the number of child objects added with add_reference_to_child_object . | |
std::uint16_t | get_child_object_id (std::size_t index) |
Returns a child object ID by index. | |
Public Member Functions inherited from isobus::task_controller_object::Object | |
Object (std::string objectDesignator, std::uint16_t uniqueID) | |
Constructor for the TC object base class. | |
virtual | ~Object ()=default |
Destructor for a TC Object. | |
std::string | get_designator () const |
Returns the Descriptive text for this object, UTF-8 encoded, 32 characters max. | |
void | set_designator (const std::string &newDesignator) |
Updates the designator to a new value. | |
std::uint16_t | get_object_id () const |
Returns the object ID of the object. | |
void | set_object_id (std::uint16_t id) |
Updates the object ID of the object to a new value. | |
Private Attributes | |
std::vector< std::uint16_t > | referenceList |
List of references to DeviceProcessDataObjects or DevicePropertyObjects. | |
std::uint16_t | elementNumber |
Element number for process data variable addressing. | |
std::uint16_t | parentObject |
Object ID of parent DeviceElementObject or DeviceObject in order to establish a hierarchical order of DeviceElements. | |
Type | elementType |
See the comments on Type or ISO11783-10 table A.2. | |
Static Private Attributes | |
static const std::string | tableID = "DET" |
XML element namespace for DeviceElement. | |
Additional Inherited Members | |
Static Public Attributes inherited from isobus::task_controller_object::Object | |
static constexpr std::uint16_t | MAX_OBJECT_ID = 65534 |
The max allowable "valid" object ID. | |
static constexpr std::size_t | MAX_DESIGNATOR_LENGTH = 128 |
Defines the max length of a designator (in bytes) | |
static constexpr std::size_t | MAX_DESIGNATOR_LEGACY_LENGTH = 32 |
Defines the max length of a designator (in bytes) for TCs older than version 4. | |
Protected Attributes inherited from isobus::task_controller_object::Object | |
std::string | designator |
UTF-8 Descriptive text to identify this object. Max length of 32. | |
std::uint16_t | objectID |
Unique object ID in the DDOP. | |
DeviceElementObject is the object definition of the XML element DeviceElement. The attribute Type specifies the type of this particular element definition.
Referable Child Objects: DeviceProcessDataObject, DevicePropertyObject
Definition at line 203 of file isobus_task_controller_client_objects.hpp.
|
strong |
Enumerates the types of device element object.
Definition at line 207 of file isobus_task_controller_client_objects.hpp.
isobus::task_controller_object::DeviceElementObject::DeviceElementObject | ( | std::string | deviceElementDesignator, |
std::uint16_t | deviceElementNumber, | ||
std::uint16_t | parentObjectID, | ||
Type | deviceEelementType, | ||
std::uint16_t | uniqueID ) |
Constructor for a DeviceElementObject.
[in] | deviceElementDesignator | Descriptive text for the object, UTF-8, 32-128 chars max depending on TC version |
[in] | deviceElementNumber | The Element number for process data variable addressing |
[in] | parentObjectID | Object ID of parent DeviceElementObject or DeviceObject in order to establish a hierarchical order of DeviceElements |
[in] | deviceEelementType | The type of element, such as "device" or "bin" |
[in] | uniqueID | The object ID of the object. Must be unique in the DDOP. |
Definition at line 222 of file isobus_task_controller_client_objects.cpp.
void isobus::task_controller_object::DeviceElementObject::add_reference_to_child_object | ( | std::uint16_t | childID | ) |
This function can be called to add an object as a child of this object.
[in] | childID | The object ID of the child to reference from this object |
Definition at line 303 of file isobus_task_controller_client_objects.cpp.
|
overridevirtual |
Returns the binary representation of the TC object, or an empty vector if object is invalid.
Implements isobus::task_controller_object::Object.
Definition at line 244 of file isobus_task_controller_client_objects.cpp.
std::uint16_t isobus::task_controller_object::DeviceElementObject::get_child_object_id | ( | std::size_t | index | ) |
Returns a child object ID by index.
[in] | index | The index of the child object ID to return |
Definition at line 326 of file isobus_task_controller_client_objects.cpp.
std::uint16_t isobus::task_controller_object::DeviceElementObject::get_element_number | ( | ) | const |
Returns the element number.
Definition at line 278 of file isobus_task_controller_client_objects.cpp.
std::uint16_t isobus::task_controller_object::DeviceElementObject::get_number_child_objects | ( | ) | const |
Returns the number of child objects added with add_reference_to_child_object
.
add_reference_to_child_object
Definition at line 321 of file isobus_task_controller_client_objects.cpp.
|
overridevirtual |
Returns the object type.
Implements isobus::task_controller_object::Object.
Definition at line 239 of file isobus_task_controller_client_objects.cpp.
std::uint16_t isobus::task_controller_object::DeviceElementObject::get_parent_object | ( | ) | const |
Returns the parent object ID.
Definition at line 288 of file isobus_task_controller_client_objects.cpp.
|
overridevirtual |
Returns the XML namespace for the object.
Implements isobus::task_controller_object::Object.
Definition at line 234 of file isobus_task_controller_client_objects.cpp.
DeviceElementObject::Type isobus::task_controller_object::DeviceElementObject::get_type | ( | ) | const |
Returns the type of the element object.
Definition at line 298 of file isobus_task_controller_client_objects.cpp.
bool isobus::task_controller_object::DeviceElementObject::remove_reference_to_child_object | ( | std::uint16_t | childID | ) |
Removes a child object reference from this object.
[in] | childID | An object ID associated to a child object to remove. |
Definition at line 308 of file isobus_task_controller_client_objects.cpp.
void isobus::task_controller_object::DeviceElementObject::set_element_number | ( | std::uint16_t | newElementNumber | ) |
Update the object's element number to a new value.
[in] | newElementNumber | The element number to set |
Definition at line 283 of file isobus_task_controller_client_objects.cpp.
void isobus::task_controller_object::DeviceElementObject::set_parent_object | ( | std::uint16_t | parentObjectID | ) |
Updates the object ID associated to this object's parent object.
[in] | parentObjectID | The object ID to set as the parent to this object |
Definition at line 293 of file isobus_task_controller_client_objects.cpp.
|
private |
Element number for process data variable addressing.
Definition at line 289 of file isobus_task_controller_client_objects.hpp.
|
private |
See the comments on Type
or ISO11783-10 table A.2.
Definition at line 291 of file isobus_task_controller_client_objects.hpp.
|
private |
Object ID of parent DeviceElementObject or DeviceObject in order to establish a hierarchical order of DeviceElements.
Definition at line 290 of file isobus_task_controller_client_objects.hpp.
|
private |
List of references to DeviceProcessDataObjects or DevicePropertyObjects.
Definition at line 288 of file isobus_task_controller_client_objects.hpp.
|
staticprivate |
XML element namespace for DeviceElement.
Definition at line 287 of file isobus_task_controller_client_objects.hpp.