Semi-abstract class for Items with an id; can be persisted i.e. serialized.
More...
#include <Persistent.h>
Semi-abstract class for Items with an id; can be persisted i.e. serialized.
#include <libpf/persistency/Persistent.h>
◆ Persistent() [1/3]
Persistent::Persistent |
( |
const std::string & |
tag, |
|
|
const std::string & |
description, |
|
|
Persistent * |
parent, |
|
|
uint32_t |
id |
|
) |
| |
◆ Persistent() [2/3]
◆ Persistent() [3/3]
◆ ~Persistent()
Persistent::~Persistent |
( |
void |
| ) |
|
|
inline |
◆ created_at()
double Persistent::created_at |
( |
void |
| ) |
const |
◆ getId()
virtual uint32_t Persistent::getId |
( |
void |
| ) |
|
|
pure virtual |
returns the next available id and increments the internal counter
Implemented in Node.
◆ id()
uint32_t Persistent::id |
( |
void |
| ) |
const |
- Returns
- the progressive counter, unique within the scope of the root and all its descendants
◆ insert()
virtual int Persistent::insert |
( |
Persistency * |
persistency | ) |
const |
|
pure virtual |
auto-determine the offset and recursively insert Node into persistency
- Returns
- the database id of the inserted Node
- Parameters
-
persistency | database connection |
Implemented in Node.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ parentId()
uint32_t Persistent::parentId |
( |
void |
| ) |
const |
- Returns
- unique integer identifier of the parent item
◆ range()
virtual uint32_t Persistent::range |
( |
void |
| ) |
const |
|
pure virtual |
- Returns
- the range of ids required to save to persistency this Node and all its descendants; minimum value is 0
- Note
- the maximum id among this Node and all its descendants = range() + id() - 1
Implemented in Node.
◆ remove()
virtual void Persistent::remove |
( |
Persistency * |
persistency | ) |
const |
|
pure virtual |
remove object from persistency database
- Parameters
-
persistency | database connection |
Implemented in Node.
◆ restore()
virtual void Persistent::restore |
( |
Persistency * |
persistency | ) |
|
|
pure virtual |
recursively restore Node variable values from persistency
- Parameters
-
persistency | database connection |
Implemented in Node.
◆ rootId()
virtual uint32_t Persistent::rootId |
( |
void |
| ) |
const |
|
pure virtual |
- Returns
- the unique integer identifier of the root item
Implemented in Node.
◆ update()
virtual int Persistent::update |
( |
Persistency * |
persistency | ) |
const |
|
pure virtual |
recursively update Node into persistency
- Returns
- the database id of the updated Node
- Parameters
-
persistency | database connection |
Implemented in Node.
◆ updated_at() [1/2]
void Persistent::updated_at |
( |
double |
u | ) |
const |
◆ updated_at() [2/2]
double Persistent::updated_at |
( |
void |
| ) |
const |
◆ uuid()
std::string Persistent::uuid |
( |
void |
| ) |
const |
returns a UUIDs (Universally Unique Identifier) Version 4 as defined by RFC 4122 in its canonical form, represented with a 36-character string containing 32 lowercase hexadecimal digits, displayed in five groups separated by hyphens, in the form 8-4-4-4-12
◆ Node
The documentation for this class was generated from the following file: