Enable table extensibility using smart pointers
- Last UpdatedApr 24, 2025
- 1 minute read
You should use the High Performance Database (HPDB) to access data when you want to extend baseline tables with customized fields.
If you still want to use lower-level Application Programming Interfaces (APIs) to access the records of tables that have been extended, you must not use static structures defined in C/C++ header files.
For example:
static tablename record;
if (!v_recget(dbnumber, pointnumber, &record, sizeof(record), V_READONLY, pDBErr))
You must use smart pointers in combination with get() and size() methods.
For example:
static auto record = rtdb::make_unique<tablename>();
if (!v_recget(dbnumber, pointnumber, record.get(), record.size(), V_READONLY, pDBErr))
Where:
tablename is the name of a table and also the name of a structure defined in a C/C++ header file.