AgIsoStack++
A control-function-focused implementation of the major ISOBUS and J1939 protocols
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | Friends | List of all members
isobus::DeviceDescriptorObjectPoolHelper::ObjectPoolValue Class Reference

A wrapper for a DDOP value which tells you if the value was actually supplied by the DDOP. More...

#include <isobus_device_descriptor_object_pool_helpers.hpp>

Inheritance diagram for isobus::DeviceDescriptorObjectPoolHelper::ObjectPoolValue:
[legend]

Public Member Functions

 ObjectPoolValue ()=default
 Default constructor for ObjectPoolValue which defaults the value to being non-existant and not settable.
 
 operator bool () const
 overloads the bool operator so that you can check for this value's existence by doing if(thisObject)
 
bool exists () const
 Returns if this variable exists. A variable exists if it was either provided in the DDOP, or has been set manually as part of a DPD value command.
 
bool editable () const
 Returns if this value is editable. DPDs are editable. DPTs are not.
 
std::int32_t get () const
 Returns the value. If the value doesn't exist this will return 0.
 

Protected Attributes

std::int32_t value = 0
 The value being wrapped by this object.
 
bool isValuePresent = false
 Stores if the value has ever been set.
 
bool isSettable = false
 Stores if the value can be set, such as on a DPD's value.
 

Friends

class DeviceDescriptorObjectPoolHelper
 Allow our helper to change the values.
 

Detailed Description

A wrapper for a DDOP value which tells you if the value was actually supplied by the DDOP.

Definition at line 30 of file isobus_device_descriptor_object_pool_helpers.hpp.

Member Function Documentation

◆ editable()

bool isobus::DeviceDescriptorObjectPoolHelper::ObjectPoolValue::editable ( ) const

Returns if this value is editable. DPDs are editable. DPTs are not.

Returns
true if the value can be set/edited

Definition at line 25 of file isobus_device_descriptor_object_pool_helpers.cpp.

◆ exists()

bool isobus::DeviceDescriptorObjectPoolHelper::ObjectPoolValue::exists ( ) const

Returns if this variable exists. A variable exists if it was either provided in the DDOP, or has been set manually as part of a DPD value command.

Returns
true if the value has ever been set, otherwise false

Definition at line 20 of file isobus_device_descriptor_object_pool_helpers.cpp.

◆ get()

std::int32_t isobus::DeviceDescriptorObjectPoolHelper::ObjectPoolValue::get ( ) const

Returns the value. If the value doesn't exist this will return 0.

Returns
The value if it exists, otherwise 0.

Definition at line 30 of file isobus_device_descriptor_object_pool_helpers.cpp.

◆ operator bool()

isobus::DeviceDescriptorObjectPoolHelper::ObjectPoolValue::operator bool ( ) const
explicit

overloads the bool operator so that you can check for this value's existence by doing if(thisObject)

Returns
true if the value was in the DDOP or has been manually set, otherwise false

Definition at line 15 of file isobus_device_descriptor_object_pool_helpers.cpp.

Friends And Related Symbol Documentation

◆ DeviceDescriptorObjectPoolHelper

friend class DeviceDescriptorObjectPoolHelper
friend

Allow our helper to change the values.

Definition at line 57 of file isobus_device_descriptor_object_pool_helpers.hpp.

Member Data Documentation

◆ isSettable

bool isobus::DeviceDescriptorObjectPoolHelper::ObjectPoolValue::isSettable = false
protected

Stores if the value can be set, such as on a DPD's value.

Definition at line 61 of file isobus_device_descriptor_object_pool_helpers.hpp.

◆ isValuePresent

bool isobus::DeviceDescriptorObjectPoolHelper::ObjectPoolValue::isValuePresent = false
protected

Stores if the value has ever been set.

Definition at line 60 of file isobus_device_descriptor_object_pool_helpers.hpp.

◆ value

std::int32_t isobus::DeviceDescriptorObjectPoolHelper::ObjectPoolValue::value = 0
protected

The value being wrapped by this object.

Definition at line 59 of file isobus_device_descriptor_object_pool_helpers.hpp.


The documentation for this class was generated from the following files: