Simulation Modeling Tool Kit
Public Member Functions | Protected Attributes | List of all members
smtk::model::SessionIO Class Reference

A base class for delegating session I/O. More...

#include <SessionIO.h>

Inheritance diagram for smtk::model::SessionIO:
Collaboration diagram for smtk::model::SessionIO:

Public Member Functions

 smtkTypeMacroBase (SessionIO)
std::string referencePath () const
 Return a reference directory to use during import/export. More...
void setReferencePath (const std::string &p)
 Set the directory to use during import/export for creating relative paths.

Protected Attributes

std::string m_referencePath

Detailed Description

A base class for delegating session I/O.

Sessions sometimes need to import and export additional state beyond a list of operations. For example, when it is not possible to store SMTK UUIDs as modeling-kernel-native attributes, the session may keep an array of UUIDs in order of iteration.

Sessions should not have methods tied to any particular format (e.g., JSON, XML, etc.); so we provide this base class. To use this class:

Note that the I/O format being handled will dictate additional subclass methods to be implemented.

Member Function Documentation

◆ referencePath()

std::string smtk::model::SessionIO::referencePath ( ) const

Return a reference directory to use during import/export.

Any relative file or directory specification should be relative to this reference path. This is used during export to turn absolute paths into relative ones. It may be used during import to do the reverse.

The documentation for this class was generated from the following file: