20#ifndef _SOURCE_IO_TFFIO_H_
21#define _SOURCE_IO_TFFIO_H_
79 if(toFile<T>(dataElement, metaData, fe) != S_OK)
81 return toStr(fe, metaData);
106 template <
typename T>
110 fromFile<T>(fe, metaData, &de);
123 template <
typename T>
125 return fromString<T>(str,
MetaData());
309 inline static std::unordered_map<std::string, FIOModule*> *modules = NULL;
Tissue Forge I/O.
Definition tfThreeDFAngleMeshGenerator.h:28
std::string toStr(IOElement &fileElement, const MetaData &metaData)
Generate a JSON string representation of an intermediate I/O object.
std::string toString()
Return a simulation state as a JSON string.
T fromString(const std::string &str, const MetaData &metaData)
Generate an object from a JSON string.
Definition tfFIO.h:107
IOElement fromStr(const std::string &str, const MetaData &metaData)
Generate an intermediate I/O object from a JSON string.
Tissue Forge data import/export interface.
Definition tfFIO.h:202
static bool hasImport()
Test whether imported data is available.
static void loadModule(const std::string moduleName)
Load a module from imported data.
static HRESULT fromFile(const std::string &loadFilePath, IOElement &el)
Load a simulation from file.
static void registerModule(const std::string moduleName, FIOModule *module)
Register a module for I/O events.
static HRESULT releaseIORootElement()
Release current root element.
static const std::string KEY_VALUE
Definition tfFIO.h:208
static const std::string KEY_METADATA
Definition tfFIO.h:214
static const std::string KEY_MODULES
Definition tfFIO.h:223
static IOElement fromFile(const std::string &loadFilePath)
Load a simulation from file.
static IOElement generateIORootElement()
Generate root element from current simulation state.
static HRESULT getCurrentIORootElement(IOElement *el)
Get the current root element, if any.
static const std::string KEY_ROOT
Definition tfFIO.h:211
static const std::string KEY_UNIVERSE
Definition tfFIO.h:220
static const std::string KEY_TYPE
Definition tfFIO.h:205
static HRESULT toFile(const std::string &saveFilePath)
Save a simulation to file.
static const std::string KEY_SIMULATOR
Definition tfFIO.h:217
static std::string toString()
Return a simulation state as a JSON string.
Tissue Forge data import summary.
Definition tfFIO.h:136
std::unordered_map< unsigned int, unsigned int > particleTypeIdMap
Definition tfFIO.h:142
std::unordered_map< unsigned int, unsigned int > particleIdMap
Definition tfFIO.h:139
Interface for Tissue Forge peripheral module I/O (e.g., models)
Definition tfFIO.h:151
void load()
User-facing function to load module data from main import.
virtual HRESULT toFile(const MetaData &metaData, IOElement &fileElement)=0
Export module data.
void registerIOModule()
Register this module for I/O events.
virtual std::string moduleName()=0
Name of module. Used as a storage key.
virtual HRESULT fromFile(const MetaData &metaData, const IOElement &fileElement)=0
Import module data.
Container for _IOElement.
Definition tf_io.h:71
int32_t HRESULT
Definition tf_port.h:255