Represents a single instance of a polymorphic structure, storing its field values dynamically.
More...
#include <struct_utils.hpp>
|
| | ~PolymorphicStruct () |
| |
| void | set_field (std::string name, uint64_t val) |
| | Sets an integer/primitive field value.
|
| |
| void | set_field (std::string name, void *arr) |
| | Sets an array field value (takes ownership of the pointer).
|
| |
| bool | has_int_field (std::string name) |
| | Checks if a named integer field exists.
|
| |
| uint64_t | get_int_field (std::string name) |
| | Retrieves the value of a named integer field.
|
| |
| bool | has_arr_field (std::string name) |
| | Checks if a named array field exists.
|
| |
| void * | get_arr_field (std::string name) |
| | Retrieves the pointer to a named array field.
|
| |
|
| std::map< std::string, uint64_t > | int_vals |
| | Map storing integer/primitive field values by name.
|
| |
| std::map< std::string, void * > | arr_vals |
| | Map storing pointers to dynamically allocated array field values by name.
|
| |
Represents a single instance of a polymorphic structure, storing its field values dynamically.
◆ ~PolymorphicStruct()
| arion_poly_struct::PolymorphicStruct::~PolymorphicStruct |
( |
| ) |
|
|
inline |
Destructor: handles the cleanup of dynamically allocated array memory.
◆ get_arr_field()
| void * arion_poly_struct::PolymorphicStruct::get_arr_field |
( |
std::string |
name | ) |
|
|
inline |
Retrieves the pointer to a named array field.
◆ get_int_field()
| uint64_t arion_poly_struct::PolymorphicStruct::get_int_field |
( |
std::string |
name | ) |
|
|
inline |
Retrieves the value of a named integer field.
◆ has_arr_field()
| bool arion_poly_struct::PolymorphicStruct::has_arr_field |
( |
std::string |
name | ) |
|
|
inline |
Checks if a named array field exists.
◆ has_int_field()
| bool arion_poly_struct::PolymorphicStruct::has_int_field |
( |
std::string |
name | ) |
|
|
inline |
Checks if a named integer field exists.
◆ set_field() [1/2]
| void arion_poly_struct::PolymorphicStruct::set_field |
( |
std::string |
name, |
|
|
uint64_t |
val |
|
) |
| |
|
inline |
Sets an integer/primitive field value.
◆ set_field() [2/2]
| void arion_poly_struct::PolymorphicStruct::set_field |
( |
std::string |
name, |
|
|
void * |
arr |
|
) |
| |
|
inline |
Sets an array field value (takes ownership of the pointer).
◆ arr_vals
| std::map<std::string, void *> arion_poly_struct::PolymorphicStruct::arr_vals |
|
private |
Map storing pointers to dynamically allocated array field values by name.
◆ int_vals
| std::map<std::string, uint64_t> arion_poly_struct::PolymorphicStruct::int_vals |
|
private |
Map storing integer/primitive field values by name.
The documentation for this class was generated from the following file: