Base class to hold data of a given type. More...
#include <Database.h>

Public Types | |
| using | source_location = StackTrace::source_location |
Public Member Functions | |
| virtual ArraySize | arraySize () const =0 |
| Return the array size. | |
| virtual std::unique_ptr< KeyData > | clone () const =0 |
| Copy the data. | |
| virtual Array< double > | convertToDouble () const =0 |
| Return the data as a Array<double> (throw error if this is not valid) | |
| virtual Array< int64_t > | convertToInt64 () const =0 |
| Return the data as a Array<int64_t> (throw error if this is not valid) | |
| double | convertUnits (const Units &, std::string_view="") const |
| Return the conversion factor (if used) | |
| template<class TYPE > | |
| Array< TYPE > | getArray (const Units &unit={}, std::string_view name="", source_location src=source_location::current()) const |
| Convert the data to a scalar of the given type. | |
| virtual typeID | getClassType () const =0 |
| Return class type. | |
| virtual typeID | getDataType () const =0 |
| template<class TYPE > | |
| TYPE | getScalar (const Units &unit={}, std::string_view name="", source_location src=source_location::current()) const |
| Convert the data to a scalar of the given type. | |
| virtual bool | is_floating_point () const =0 |
| Return true if the type is a floating point type. | |
| virtual bool | is_integral () const =0 |
| Return true if the type is a integer point type. | |
| template<class TYPE > | |
| bool | isType () const |
| bool | operator!= (const KeyData &rhs) const |
| Check if two sets of data are not equal. | |
| virtual bool | operator== (const KeyData &rhs) const =0 |
| Check if two sets of data are equal. | |
| virtual size_t | pack (std::byte *) const =0 |
| Pack the data to a buffer. | |
| virtual size_t | packSize () const =0 |
| Return the number of bytes required to pack the data. | |
| virtual void | print (std::ostream &os, std::string_view indent="", bool sort=true, bool printType=false) const =0 |
| Print the data to a stream. | |
| virtual void | readHDF5 (int64_t fid, const std::string &name)=0 |
| Read the data from HDF5. | |
| const Units & | unit () const |
| Return the units. | |
| virtual size_t | unpack (const std::byte *)=0 |
| Unpack the data from a buffer. | |
| virtual void | writeHDF5 (int64_t fid, const std::string &name) const =0 |
| Write the data to HDF5. | |
| virtual | ~KeyData () |
| Destructor. | |
Protected Member Functions | |
| KeyData () | |
| KeyData (const KeyData &)=delete | |
| KeyData (const Units &unit) | |
| KeyData (KeyData &&)=delete | |
| KeyData & | operator= (const KeyData &)=delete |
| KeyData & | operator= (KeyData &&)=delete |
Protected Attributes | |
| Units | d_unit |
Base class to hold data of a given type.
Definition at line 36 of file Database.h.
| using AMP::KeyData::source_location = StackTrace::source_location |
Definition at line 39 of file Database.h.
|
inlinevirtual |
Destructor.
Definition at line 41 of file Database.h.
|
inlineprotected |
Definition at line 96 of file Database.h.
|
inlineprotected |
Definition at line 97 of file Database.h.
|
protecteddelete |
|
protecteddelete |
|
pure virtual |
Return the array size.
Implemented in AMP::Database.
|
pure virtual |
Copy the data.
Implemented in AMP::Database.
|
pure virtual |
Return the data as a Array<double> (throw error if this is not valid)
Implemented in AMP::Database.
|
pure virtual |
Return the data as a Array<int64_t> (throw error if this is not valid)
Implemented in AMP::Database.
| double AMP::KeyData::convertUnits | ( | const Units & | , |
| std::string_view | = "" |
||
| ) | const |
Return the conversion factor (if used)
| Array< TYPE > AMP::KeyData::getArray | ( | const Units & | unit = {}, |
| std::string_view | name = "", |
||
| source_location | src = source_location::current() |
||
| ) | const |
Convert the data to a scalar of the given type.
|
pure virtual |
Return class type.
Implemented in AMP::Database.
|
pure virtual |
Implemented in AMP::Database.
| TYPE AMP::KeyData::getScalar | ( | const Units & | unit = {}, |
| std::string_view | name = "", |
||
| source_location | src = source_location::current() |
||
| ) | const |
Convert the data to a scalar of the given type.
|
pure virtual |
Return true if the type is a floating point type.
Implemented in AMP::Database.
|
pure virtual |
Return true if the type is a integer point type.
Implemented in AMP::Database.
| bool AMP::KeyData::isType | ( | ) | const |
|
inline |
Check if two sets of data are not equal.
Definition at line 69 of file Database.h.
References operator==().
|
pure virtual |
|
pure virtual |
Pack the data to a buffer.
Implemented in AMP::Database.
|
pure virtual |
Return the number of bytes required to pack the data.
Implemented in AMP::Database.
|
pure virtual |
Print the data to a stream.
Implemented in AMP::Database.
|
pure virtual |
Read the data from HDF5.
Implemented in AMP::Database.
|
inline |
Return the units.
Definition at line 71 of file Database.h.
References d_unit.
Referenced by AMP::Database::addArgsWithUnits().
|
pure virtual |
Unpack the data from a buffer.
Implemented in AMP::Database.
|
pure virtual |
Write the data to HDF5.
Implemented in AMP::Database.
|
protected |
Definition at line 105 of file Database.h.
Referenced by unit().
|
Advanced Multi-Physics (AMP) Oak Ridge National Laboratory Idaho National Laboratory Los Alamos National Laboratory |
This page automatically produced from the source code by Last updated: Tue Mar 10 2026 13:06:42. Comments on this page |