|
Adaptyst
A comprehensive and architecture-agnostic performance analysis tool
|
#include <output.hpp>
Public Member Functions | |
| ObjectWithMetadata () | |
| template<class T> | |
| void | set_metadata (std::string key, T value, bool save=true) |
| template<class T> | |
| T | get_metadata (std::string key, T default_value) |
| template<class T> | |
| T | get_metadata (std::string key) |
| virtual void | save_metadata ()=0 |
Protected Attributes | |
| nlohmann::json | metadata |
This abstract class describes an arbitrary object with attached metadata in form of key-value pairs, where the value type is templatised.
|
inline |
|
inline |
Gets a value from the metadata based on a given key, throwing an exception if the key is not found.
| key | Key to look for. |
|
inline |
Gets a value from the metadata based on a given key, with the default value provided if the key is not found.
| key | Key to look for. |
| default_value | Value to return if the key is not found. |
|
pure virtual |
Saves metadata in a way dependent on the implementation, e.g. to disk.
Implemented in adaptyst::File, and adaptyst::Path.
|
inline |
Sets a key-value pair in the metadata.
| key | Key in the key-value pair. |
| value | Value in the key-value pair. |
| save | Whether all metadata should be saved to disk or elsewhere after setting the pair. |
|
protected |