Volume Cartographer 2.27.0
|
Base class for objects stored on disk with an associated metadata file. More...
#include <vc/core/types/DiskBasedObjectBaseClass.hpp>
Public Types | |
using | Identifier = std::string |
Identifier type. More... | |
using | Description = std::pair< Identifier, std::string > |
Public Member Functions | |
DiskBasedObjectBaseClass ()=delete | |
Identifier | id () const |
Get the "unique" ID for the object. | |
auto | path () const -> filesystem::path |
Get the path to the object. | |
auto | name () const -> std::string |
Get the human-readable name for the object. | |
void | setName (std::string n) |
Set the human-readable name of the object. | |
template<typename T > | |
void | setMetadataEntry (const std::string &key, T value) |
Set a metadata entry. More... | |
template<typename T > | |
auto | getMetadataEntry (const std::string &key) const -> std::optional< T > |
Get a metadata entry. More... | |
void | saveMetadata () const |
Update metadata on disk. | |
Protected Member Functions | |
DiskBasedObjectBaseClass (filesystem::path path) | |
DiskBasedObjectBaseClass (filesystem::path path, Identifier uuid, std::string name) | |
Protected Attributes | |
Metadata | metadata_ |
filesystem::path | path_ |
Base class for objects stored on disk with an associated metadata file.
Disk-based objects are meant to be used for objects stored inside of a VolumePkg that need to be unique and identifiable, like Segmentations, Renders, and Volumes. The goal of such objects is to make it easier to access data from within the complex structure of a VolumePkg.
As its name implies, a disk-based object is associated with a specific file or directory on disk from which it loads and into which it saves data. Derived classes are responsible for the process of updating this information.
Definition at line 25 of file DiskBasedObjectBaseClass.hpp.
using volcart::DiskBasedObjectBaseClass::Description = std::pair<Identifier, std::string> |
ID/Name pair
Definition at line 32 of file DiskBasedObjectBaseClass.hpp.
using volcart::DiskBasedObjectBaseClass::Identifier = std::string |
Identifier type.
Definition at line 29 of file DiskBasedObjectBaseClass.hpp.
|
delete |
Default constructor
|
explicitprotected |
Load the object from file
|
protected |
Make a new object
|
inline |
Get a metadata entry.
Definition at line 72 of file DiskBasedObjectBaseClass.hpp.
|
inline |
Set a metadata entry.
Definition at line 61 of file DiskBasedObjectBaseClass.hpp.
|
protected |
Definition at line 89 of file DiskBasedObjectBaseClass.hpp.
|
protected |
Location for the object on disk
Definition at line 92 of file DiskBasedObjectBaseClass.hpp.