libfoedus-core
FOEDUS Core Library
|
Object Externalization. More...
Object Externalization.
![]() |
Classes | |
struct | foedus::externalize::Externalizable |
Represents an object that can be written to and read from files/bytes in XML format. More... | |
struct | foedus::externalize::TinyxmlGetter< T > |
Functor to help use tinyxml2's Element QueryXxxText(). More... | |
struct | foedus::externalize::TinyxmlSetter< T > |
Functor to help use tinyxml2's Element SetText(). More... | |
Macros | |
#define | EXTERNALIZE_SAVE_ELEMENT(element, attribute, comment) CHECK_ERROR(add_element(element, EX_EXPAND(attribute), comment, attribute)) |
Adds an xml element to represent a member variable of this object. More... | |
#define | EXTERNALIZE_SAVE_ENUM_ELEMENT(element, attribute, comment) CHECK_ERROR(add_enum_element(element, EX_EXPAND(attribute), comment, attribute)) |
Adds an xml element to represent a member variable of this object. More... | |
#define | EXTERNALIZE_LOAD_ELEMENT(element, attribute) CHECK_ERROR(get_element(element, EX_EXPAND(attribute), & attribute)) |
Reads a child xml element to load a member variable of this object. More... | |
#define | EXTERNALIZE_LOAD_ELEMENT_OPTIONAL(element, attribute, default_value) CHECK_ERROR(get_element(element, EX_EXPAND(attribute), & attribute, true, default_value)) |
Reads a child xml element to load a member variable of this object. More... | |
#define | EXTERNALIZE_LOAD_ENUM_ELEMENT(element, attribute) CHECK_ERROR(get_enum_element(element, EX_EXPAND(attribute), & attribute)) |
Reads a child xml element to load a member variable of this object. More... | |
#define | EXTERNALIZE_LOAD_ENUM_ELEMENT_OPTIONAL(element, attribute, default_value) CHECK_ERROR(get_enum_element(element, EX_EXPAND(attribute), & attribute, true, default_value)) |
Reads a child xml element to load a member variable of this object. More... | |
#define | EXTERNALIZABLE(clazz) |
Macro to declare/define essential methods for an externalizable class. More... | |
#define EXTERNALIZABLE | ( | clazz | ) |
Macro to declare/define essential methods for an externalizable class.
Each externalizable class should invoke this macro in public scope of class definition. Then, it should define load() and save() in cpp.
Definition at line 294 of file externalizable.hpp.
#define EXTERNALIZE_LOAD_ELEMENT | ( | element, | |
attribute | |||
) | CHECK_ERROR(get_element(element, EX_EXPAND(attribute), & attribute)) |
Reads a child xml element to load a member variable of this object.
[in] | element | the current XML element that represents this, in other words parent of the element to read. |
[in] | attribute | the member variable of this to save. This is also used as tag name. |
Definition at line 254 of file externalizable.hpp.
Referenced by foedus::savepoint::SavepointOptions::load(), foedus::snapshot::SnapshotMetadata::load(), foedus::storage::StorageOptions::load(), foedus::thread::ThreadOptions::load(), foedus::xct::XctOptions::load(), foedus::fs::DeviceEmulationOptions::load(), foedus::proc::ProcOptions::load(), foedus::soc::SocOptions::load(), foedus::cache::CacheOptions::load(), foedus::debugging::DebuggingOptions::load(), foedus::log::LogOptions::load(), foedus::savepoint::Savepoint::load(), foedus::memory::MemoryOptions::load(), and foedus::snapshot::SnapshotOptions::load().
#define EXTERNALIZE_LOAD_ELEMENT_OPTIONAL | ( | element, | |
attribute, | |||
default_value | |||
) | CHECK_ERROR(get_element(element, EX_EXPAND(attribute), & attribute, true, default_value)) |
Reads a child xml element to load a member variable of this object.
[in] | element | the current XML element that represents this, in other words parent of the element to read. |
[in] | attribute | the member variable of this to save. This is also used as tag name. |
[in] | default_value | If the element doesn't exist, this value is set to the variable. |
For optional elements, use this.
Definition at line 264 of file externalizable.hpp.
#define EXTERNALIZE_LOAD_ENUM_ELEMENT | ( | element, | |
attribute | |||
) | CHECK_ERROR(get_enum_element(element, EX_EXPAND(attribute), & attribute)) |
Reads a child xml element to load a member variable of this object.
[in] | element | the current XML element that represents this, in other words parent of the element to read. |
[in] | attribute | the member variable of this to save. This is also used as tag name. |
For enum, use this one.
Definition at line 274 of file externalizable.hpp.
Referenced by foedus::thread::ThreadOptions::load(), foedus::soc::SocOptions::load(), and foedus::debugging::DebuggingOptions::load().
#define EXTERNALIZE_LOAD_ENUM_ELEMENT_OPTIONAL | ( | element, | |
attribute, | |||
default_value | |||
) | CHECK_ERROR(get_enum_element(element, EX_EXPAND(attribute), & attribute, true, default_value)) |
Reads a child xml element to load a member variable of this object.
[in] | element | the current XML element that represents this, in other words parent of the element to read. |
[in] | attribute | the member variable of this to save. This is also used as tag name. |
[in] | default_value | If the element doesn't exist, this value is set to the variable. |
For optional elements, use this.
For optional enum, use this one.
Definition at line 283 of file externalizable.hpp.
#define EXTERNALIZE_SAVE_ELEMENT | ( | element, | |
attribute, | |||
comment | |||
) | CHECK_ERROR(add_element(element, EX_EXPAND(attribute), comment, attribute)) |
Adds an xml element to represent a member variable of this object.
[in] | element | the current XML element that represents this, in other words parent of the new element. |
[in] | attribute | the member variable of this to save. This is also used as tag name. |
[in] | comment | this is output as an XML comment. |
Definition at line 234 of file externalizable.hpp.
Referenced by foedus::savepoint::SavepointOptions::save(), foedus::snapshot::SnapshotMetadata::save(), foedus::storage::StorageOptions::save(), foedus::thread::ThreadOptions::save(), foedus::xct::XctOptions::save(), foedus::fs::DeviceEmulationOptions::save(), foedus::proc::ProcOptions::save(), foedus::soc::SocOptions::save(), foedus::cache::CacheOptions::save(), foedus::debugging::DebuggingOptions::save(), foedus::log::LogOptions::save(), foedus::savepoint::Savepoint::save(), foedus::memory::MemoryOptions::save(), and foedus::snapshot::SnapshotOptions::save().
#define EXTERNALIZE_SAVE_ENUM_ELEMENT | ( | element, | |
attribute, | |||
comment | |||
) | CHECK_ERROR(add_enum_element(element, EX_EXPAND(attribute), comment, attribute)) |
Adds an xml element to represent a member variable of this object.
[in] | element | the current XML element that represents this, in other words parent of the new element. |
[in] | attribute | the member variable of this to save. This is also used as tag name. |
[in] | comment | this is output as an XML comment. |
For enums, use this one.
Definition at line 243 of file externalizable.hpp.
Referenced by foedus::thread::ThreadOptions::save(), foedus::soc::SocOptions::save(), and foedus::debugging::DebuggingOptions::save().