dnp3 (C++ API) 1.6.0
Loading...
Searching...
No Matches
dnp3::Database Class Reference

Internal database access. More...

#include <dnp3.hpp>

Public Member Functions

 Database (Database &&other) noexcept
 Transfer ownership of the underlying C-type to this instance and invalidate the other instance. More...
 
UpdateInfo update_flags (uint16_t index, UpdateFlagsType flags_type, const Flags &flags, const Timestamp &time, const UpdateOptions &options)
 Update the flags for the specified point without changing the value. More...
 
bool add_binary_input (uint16_t index, EventClass point_class, const BinaryInputConfig &config)
 Add a new BinaryInput point. More...
 
bool remove_binary_input (uint16_t index)
 Remove a BinaryInput point. More...
 
bool update_binary_input (const BinaryInput &value, const UpdateOptions &options)
 Update a BinaryInput point. More...
 
UpdateInfo update_binary_input_2 (const BinaryInput &value, const UpdateOptions &options)
 Update a BinaryInput point. More...
 
BinaryInput get_binary_input (uint16_t index)
 Get a BinaryInput point. More...
 
bool add_double_bit_binary_input (uint16_t index, EventClass point_class, const DoubleBitBinaryInputConfig &config)
 Add a new Double-Bit Binary Input point. More...
 
bool remove_double_bit_binary_input (uint16_t index)
 Remove a Double-Bit Binary Input point. More...
 
bool update_double_bit_binary_input (const DoubleBitBinaryInput &value, const UpdateOptions &options)
 Update a Double-Bit Binary Input point. More...
 
UpdateInfo update_double_bit_binary_input_2 (const DoubleBitBinaryInput &value, const UpdateOptions &options)
 Update a Double-Bit Binary Input point. More...
 
DoubleBitBinaryInput get_double_bit_binary_input (uint16_t index)
 Get a Double-Bit Binary Input point. More...
 
bool add_binary_output_status (uint16_t index, EventClass point_class, const BinaryOutputStatusConfig &config)
 Add a new Binary Output Status point. More...
 
bool remove_binary_output_status (uint16_t index)
 Remove a Binary Output Status point. More...
 
bool update_binary_output_status (const BinaryOutputStatus &value, const UpdateOptions &options)
 Update a Binary Output Status point. More...
 
UpdateInfo update_binary_output_status_2 (const BinaryOutputStatus &value, const UpdateOptions &options)
 Update a Binary Output Status point. More...
 
BinaryOutputStatus get_binary_output_status (uint16_t index)
 Get a Binary Output Status point. More...
 
bool add_counter (uint16_t index, EventClass point_class, const CounterConfig &config)
 Add a new Counter point. More...
 
bool remove_counter (uint16_t index)
 Remove a Counter point. More...
 
bool update_counter (const Counter &value, const UpdateOptions &options)
 Update a Counter point. More...
 
UpdateInfo update_counter_2 (const Counter &value, const UpdateOptions &options)
 Update a Counter point. More...
 
Counter get_counter (uint16_t index)
 Get a Counter point. More...
 
bool add_frozen_counter (uint16_t index, EventClass point_class, const FrozenCounterConfig &config)
 Add a new Frozen Counter point. More...
 
bool remove_frozen_counter (uint16_t index)
 Remove a Frozen Counter point. More...
 
bool update_frozen_counter (const FrozenCounter &value, const UpdateOptions &options)
 Update an Frozen Counter point. More...
 
UpdateInfo update_frozen_counter_2 (const FrozenCounter &value, const UpdateOptions &options)
 Update an Frozen Counter point. More...
 
FrozenCounter get_frozen_counter (uint16_t index)
 Get a Frozen Counter point. More...
 
bool add_analog_input (uint16_t index, EventClass point_class, const AnalogInputConfig &config)
 Add a new AnalogInput point. More...
 
bool remove_analog_input (uint16_t index)
 Remove an AnalogInput point. More...
 
bool update_analog_input (const AnalogInput &value, const UpdateOptions &options)
 Update a AnalogInput point. More...
 
UpdateInfo update_analog_input_2 (const AnalogInput &value, const UpdateOptions &options)
 Update a AnalogInput point. More...
 
AnalogInput get_analog_input (uint16_t index)
 Get a AnalogInput point. More...
 
bool add_analog_output_status (uint16_t index, EventClass point_class, const AnalogOutputStatusConfig &config)
 Add a new Analog Output Status point. More...
 
bool remove_analog_output_status (uint16_t index)
 Remove an Analog Output Status point. More...
 
bool update_analog_output_status (const AnalogOutputStatus &value, const UpdateOptions &options)
 Update a Analog Output Status point. More...
 
UpdateInfo update_analog_output_status_2 (const AnalogOutputStatus &value, const UpdateOptions &options)
 Update a Analog Output Status point. More...
 
AnalogOutputStatus get_analog_output_status (uint16_t index)
 Get a Analog Output Status point. More...
 
bool add_octet_string (uint16_t index, EventClass point_class)
 Add a new Octet String point. More...
 
bool remove_octet_string (uint16_t index)
 Remove an Octet String point. More...
 
bool update_octet_string (uint16_t index, const std::vector< uint8_t > &value, const UpdateOptions &options)
 Update an Octet String point. More...
 
UpdateInfo update_octet_string_2 (uint16_t index, const std::vector< uint8_t > &value, const UpdateOptions &options)
 Update an Octet String point. More...
 
AttrDefError define_string_attr (uint8_t set, bool writable, uint8_t variation, const std::string &value)
 Define a string attribute. More...
 
AttrDefError define_int_attr (uint8_t set, bool writable, uint8_t variation, int32_t value)
 Define a signed integer attribute. More...
 
AttrDefError define_uint_attr (uint8_t set, bool writable, uint8_t variation, uint32_t value)
 Define an unsigned integer attribute. More...
 
AttrDefError define_time_attr (uint8_t set, bool writable, uint8_t variation, uint64_t value)
 Define a DNP3 time attribute. More...
 
AttrDefError define_bool_attr (uint8_t set, bool writable, uint8_t variation, bool value)
 Define a boolean attribute which is mapped to an unsigned integer internally. More...
 
AttrDefError define_float_attr (uint8_t set, bool writable, uint8_t variation, float value)
 Define a 32-bit floating point attribute. More...
 
AttrDefError define_double_attr (uint8_t set, bool writable, uint8_t variation, double value)
 Define a 64-bit floating point attribute. More...
 

Friends

class CppDatabaseFriend
 

Detailed Description

Internal database access.

Warning
This object is only valid within a transaction

Constructor & Destructor Documentation

◆ Database()

dnp3::Database::Database ( Database &&  other)
inlinenoexcept

Transfer ownership of the underlying C-type to this instance and invalidate the other instance.

Note
the moved class will now throw an exception if any method is called
Parameters
otherClass from which ownership will be transfer to this instance

Member Function Documentation

◆ add_analog_input()

bool dnp3::Database::add_analog_input ( uint16_t  index,
EventClass  point_class,
const AnalogInputConfig config 
)

Add a new AnalogInput point.

Parameters
indexIndex of the point
point_classEvent class
configConfiguration
Returns
True if the point was successfully added, false otherwise

◆ add_analog_output_status()

bool dnp3::Database::add_analog_output_status ( uint16_t  index,
EventClass  point_class,
const AnalogOutputStatusConfig config 
)

Add a new Analog Output Status point.

Parameters
indexIndex of the point
point_classEvent class
configConfiguration
Returns
True if the point was successfully added, false otherwise

◆ add_binary_input()

bool dnp3::Database::add_binary_input ( uint16_t  index,
EventClass  point_class,
const BinaryInputConfig config 
)

Add a new BinaryInput point.

Parameters
indexIndex of the point
point_classEvent class
configConfiguration
Returns
True if the point was successfully added, false otherwise

◆ add_binary_output_status()

bool dnp3::Database::add_binary_output_status ( uint16_t  index,
EventClass  point_class,
const BinaryOutputStatusConfig config 
)

Add a new Binary Output Status point.

Parameters
indexIndex of the point
point_classEvent class
configConfiguration
Returns
True if the point was successfully added, false otherwise

◆ add_counter()

bool dnp3::Database::add_counter ( uint16_t  index,
EventClass  point_class,
const CounterConfig config 
)

Add a new Counter point.

Parameters
indexIndex of the point
point_classEvent class
configConfiguration
Returns
True if the point was successfully added, false otherwise

◆ add_double_bit_binary_input()

bool dnp3::Database::add_double_bit_binary_input ( uint16_t  index,
EventClass  point_class,
const DoubleBitBinaryInputConfig config 
)

Add a new Double-Bit Binary Input point.

Parameters
indexIndex of the point
point_classEvent class
configConfiguration
Returns
True if the point was successfully added, false otherwise

◆ add_frozen_counter()

bool dnp3::Database::add_frozen_counter ( uint16_t  index,
EventClass  point_class,
const FrozenCounterConfig config 
)

Add a new Frozen Counter point.

Parameters
indexIndex of the point
point_classEvent class
configConfiguration
Returns
True if the point was successfully added, false otherwise

◆ add_octet_string()

bool dnp3::Database::add_octet_string ( uint16_t  index,
EventClass  point_class 
)

Add a new Octet String point.

Parameters
indexIndex of the point
point_classEvent class
Returns
True if the point was successfully added, false otherwise

◆ define_bool_attr()

AttrDefError dnp3::Database::define_bool_attr ( uint8_t  set,
bool  writable,
uint8_t  variation,
bool  value 
)

Define a boolean attribute which is mapped to an unsigned integer internally.

Parameters
setThe set to which the attribute belongs
writableTrue if the attribute may be written
variationThe variation of the attribute
valueThe value of the attribute
Returns
Enumeration indicating if the operation was successful

◆ define_double_attr()

AttrDefError dnp3::Database::define_double_attr ( uint8_t  set,
bool  writable,
uint8_t  variation,
double  value 
)

Define a 64-bit floating point attribute.

Parameters
setThe set to which the attribute belongs
writableTrue if the attribute may be written
variationThe variation of the attribute
valueThe value of the attribute
Returns
Enumeration indicating if the operation was successful

◆ define_float_attr()

AttrDefError dnp3::Database::define_float_attr ( uint8_t  set,
bool  writable,
uint8_t  variation,
float  value 
)

Define a 32-bit floating point attribute.

Parameters
setThe set to which the attribute belongs
writableTrue if the attribute may be written
variationThe variation of the attribute
valueThe value of the attribute
Returns
Enumeration indicating if the operation was successful

◆ define_int_attr()

AttrDefError dnp3::Database::define_int_attr ( uint8_t  set,
bool  writable,
uint8_t  variation,
int32_t  value 
)

Define a signed integer attribute.

Parameters
setThe set to which the attribute belongs
writableTrue if the attribute may be written
variationThe variation of the attribute
valueThe value of the attribute
Returns
Enumeration indicating if the operation was successful

◆ define_string_attr()

AttrDefError dnp3::Database::define_string_attr ( uint8_t  set,
bool  writable,
uint8_t  variation,
const std::string &  value 
)

Define a string attribute.

Parameters
setThe set to which the attribute belongs
writableTrue if the attribute may be written
variationThe variation of the attribute
valueThe value of the attribute
Returns
Enumeration indicating if the operation was successful

◆ define_time_attr()

AttrDefError dnp3::Database::define_time_attr ( uint8_t  set,
bool  writable,
uint8_t  variation,
uint64_t  value 
)

Define a DNP3 time attribute.

Parameters
setThe set to which the attribute belongs
writableTrue if the attribute may be written
variationThe variation of the attribute
valueThe DNP3 timestamp value of the attribute. Only the lower 48-bits are used.
Returns
Enumeration indicating if the operation was successful

◆ define_uint_attr()

AttrDefError dnp3::Database::define_uint_attr ( uint8_t  set,
bool  writable,
uint8_t  variation,
uint32_t  value 
)

Define an unsigned integer attribute.

Parameters
setThe set to which the attribute belongs
writableTrue if the attribute may be written
variationThe variation of the attribute
valueThe value of the attribute
Returns
Enumeration indicating if the operation was successful

◆ get_analog_input()

AnalogInput dnp3::Database::get_analog_input ( uint16_t  index)

Get a AnalogInput point.

Parameters
indexIndex of the point to get
Returns
Analog point
Exceptions
ParamException

◆ get_analog_output_status()

AnalogOutputStatus dnp3::Database::get_analog_output_status ( uint16_t  index)

Get a Analog Output Status point.

Parameters
indexIndex of the point to get
Returns
Analog Output Status point
Exceptions
ParamException

◆ get_binary_input()

BinaryInput dnp3::Database::get_binary_input ( uint16_t  index)

Get a BinaryInput point.

Parameters
indexIndex of the point to get
Returns
Binary Input point
Exceptions
ParamException

◆ get_binary_output_status()

BinaryOutputStatus dnp3::Database::get_binary_output_status ( uint16_t  index)

Get a Binary Output Status point.

Parameters
indexIndex of the point to get
Returns
Binary Output Status point
Exceptions
ParamException

◆ get_counter()

Counter dnp3::Database::get_counter ( uint16_t  index)

Get a Counter point.

Parameters
indexIndex of the point to get
Returns
Counter point
Exceptions
ParamException

◆ get_double_bit_binary_input()

DoubleBitBinaryInput dnp3::Database::get_double_bit_binary_input ( uint16_t  index)

Get a Double-Bit Binary Input point.

Parameters
indexIndex of the point to get
Returns
Double-Bit Binary Input point
Exceptions
ParamException

◆ get_frozen_counter()

FrozenCounter dnp3::Database::get_frozen_counter ( uint16_t  index)

Get a Frozen Counter point.

Parameters
indexIndex of the point to get
Returns
Frozen Counter point
Exceptions
ParamException

◆ remove_analog_input()

bool dnp3::Database::remove_analog_input ( uint16_t  index)

Remove an AnalogInput point.

Parameters
indexIndex of the point
Returns
True if the point was successfully removed, false otherwise

◆ remove_analog_output_status()

bool dnp3::Database::remove_analog_output_status ( uint16_t  index)

Remove an Analog Output Status point.

Parameters
indexIndex of the point
Returns
True if the point was successfully removed, false otherwise

◆ remove_binary_input()

bool dnp3::Database::remove_binary_input ( uint16_t  index)

Remove a BinaryInput point.

Parameters
indexIndex of the point
Returns
True if the point was successfully removed, false otherwise

◆ remove_binary_output_status()

bool dnp3::Database::remove_binary_output_status ( uint16_t  index)

Remove a Binary Output Status point.

Parameters
indexIndex of the point
Returns
True if the point was successfully removed, false otherwise

◆ remove_counter()

bool dnp3::Database::remove_counter ( uint16_t  index)

Remove a Counter point.

Parameters
indexIndex of the point
Returns
True if the point was successfully removed, false otherwise

◆ remove_double_bit_binary_input()

bool dnp3::Database::remove_double_bit_binary_input ( uint16_t  index)

Remove a Double-Bit Binary Input point.

Parameters
indexIndex of the point
Returns
True if the point was successfully removed, false otherwise

◆ remove_frozen_counter()

bool dnp3::Database::remove_frozen_counter ( uint16_t  index)

Remove a Frozen Counter point.

Parameters
indexIndex of the point
Returns
True if the point was successfully removed, false otherwise

◆ remove_octet_string()

bool dnp3::Database::remove_octet_string ( uint16_t  index)

Remove an Octet String point.

Parameters
indexIndex of the point
Returns
True if the point was successfully removed, false otherwise

◆ update_analog_input()

bool dnp3::Database::update_analog_input ( const AnalogInput value,
const UpdateOptions options 
)

Update a AnalogInput point.

Parameters
valueNew value of the point
optionsUpdate options
Returns
True if the point was successfully updated, false otherwise

◆ update_analog_input_2()

UpdateInfo dnp3::Database::update_analog_input_2 ( const AnalogInput value,
const UpdateOptions options 
)

Update a AnalogInput point.

Parameters
valueNew value of the point
optionsUpdate options
Returns
Provides detailed information about what occurred during the update operation

◆ update_analog_output_status()

bool dnp3::Database::update_analog_output_status ( const AnalogOutputStatus value,
const UpdateOptions options 
)

Update a Analog Output Status point.

Parameters
valueNew value of the point
optionsUpdate options
Returns
True if the point was successfully updated, false otherwise

◆ update_analog_output_status_2()

UpdateInfo dnp3::Database::update_analog_output_status_2 ( const AnalogOutputStatus value,
const UpdateOptions options 
)

Update a Analog Output Status point.

Parameters
valueNew value of the point
optionsUpdate options
Returns
Provides detailed information about what occurred during the update operation

◆ update_binary_input()

bool dnp3::Database::update_binary_input ( const BinaryInput value,
const UpdateOptions options 
)

Update a BinaryInput point.

Parameters
valueNew value of the point
optionsUpdate options
Returns
True if the point was successfully updated, false otherwise

◆ update_binary_input_2()

UpdateInfo dnp3::Database::update_binary_input_2 ( const BinaryInput value,
const UpdateOptions options 
)

Update a BinaryInput point.

Parameters
valueNew value of the point
optionsUpdate options
Returns
Provides detailed information about what occurred during the update operation

◆ update_binary_output_status()

bool dnp3::Database::update_binary_output_status ( const BinaryOutputStatus value,
const UpdateOptions options 
)

Update a Binary Output Status point.

Parameters
valueNew value of the point
optionsUpdate options
Returns
True if the point was successfully updated, false otherwise

◆ update_binary_output_status_2()

UpdateInfo dnp3::Database::update_binary_output_status_2 ( const BinaryOutputStatus value,
const UpdateOptions options 
)

Update a Binary Output Status point.

Parameters
valueNew value of the point
optionsUpdate options
Returns
Provides detailed information about what occurred during the update operation

◆ update_counter()

bool dnp3::Database::update_counter ( const Counter value,
const UpdateOptions options 
)

Update a Counter point.

Parameters
valueNew value of the point
optionsUpdate options
Returns
True if the point was successfully updated, false otherwise

◆ update_counter_2()

UpdateInfo dnp3::Database::update_counter_2 ( const Counter value,
const UpdateOptions options 
)

Update a Counter point.

Parameters
valueNew value of the point
optionsUpdate options
Returns
Provides detailed information about what occurred during the update operation

◆ update_double_bit_binary_input()

bool dnp3::Database::update_double_bit_binary_input ( const DoubleBitBinaryInput value,
const UpdateOptions options 
)

Update a Double-Bit Binary Input point.

Parameters
valueNew value of the point
optionsUpdate options
Returns
True if the point was successfully updated, false otherwise

◆ update_double_bit_binary_input_2()

UpdateInfo dnp3::Database::update_double_bit_binary_input_2 ( const DoubleBitBinaryInput value,
const UpdateOptions options 
)

Update a Double-Bit Binary Input point.

Parameters
valueNew value of the point
optionsUpdate options
Returns
Provides detailed information about what occurred during the update operation

◆ update_flags()

UpdateInfo dnp3::Database::update_flags ( uint16_t  index,
UpdateFlagsType  flags_type,
const Flags flags,
const Timestamp time,
const UpdateOptions options 
)

Update the flags for the specified point without changing the value.

This is equivalent to getting the current value, changing the flags and the timestamp, then calling update

Parameters
indexIndex on which to perform the operation
flags_typePoint type on which to perform the operation
flagsNew flags applied to the point
timeNew timestamp applied to the point
optionsOptions that control how events and static values are handled
Returns
Provides detailed information about what occurred during the update operation

◆ update_frozen_counter()

bool dnp3::Database::update_frozen_counter ( const FrozenCounter value,
const UpdateOptions options 
)

Update an Frozen Counter point.

Parameters
valueNew value of the point
optionsUpdate options
Returns
True if the point was successfully updated, false otherwise

◆ update_frozen_counter_2()

UpdateInfo dnp3::Database::update_frozen_counter_2 ( const FrozenCounter value,
const UpdateOptions options 
)

Update an Frozen Counter point.

Parameters
valueNew value of the point
optionsUpdate options
Returns
Provides detailed information about what occurred during the update operation

◆ update_octet_string()

bool dnp3::Database::update_octet_string ( uint16_t  index,
const std::vector< uint8_t > &  value,
const UpdateOptions options 
)

Update an Octet String point.

Parameters
indexIndex of the octet string
valueNew value of the point
optionsUpdate options
Returns
True if the point was successfully updated, false otherwise

◆ update_octet_string_2()

UpdateInfo dnp3::Database::update_octet_string_2 ( uint16_t  index,
const std::vector< uint8_t > &  value,
const UpdateOptions options 
)

Update an Octet String point.

Parameters
indexIndex of the octet string
valueNew value of the point
optionsUpdate options
Returns
Provides detailed information about what occurred during the update operation

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