SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
Public Types | Public Member Functions | Static Public Member Functions | List of all members
smtk::model::SessionIOJSON Class Reference

A base class for delegating session I/O to/from JSON. More...

#include <SessionIOJSON.h>

Inheritance diagram for smtk::model::SessionIOJSON:
[legend]
Collaboration diagram for smtk::model::SessionIOJSON:
[legend]

Public Types

using json = nlohmann::json
 

Public Member Functions

 smtkTypeMacro (SessionIOJSON)
 
 smtkCreateMacro (SessionIOJSON)
 
- Public Member Functions inherited from smtk::model::SessionIO
 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.
 

Static Public Member Functions

static json saveJSON (const smtk::model::ResourcePtr &rsrc)
 Serialize a resource into a set of JSON records.
 
static bool saveModelRecords (const json &j, const std::string &url)
 Write a set of JSON records to the given location.
 
static json loadJSON (const std::string &filename)
 Load JSON from a file and parse it, but do nothing more.
 
static bool loadModelRecords (const json &j, smtk::model::ResourcePtr rsrc)
 Given JSON data, attempt to deserialize SMTK model records from it. More...
 

Additional Inherited Members

- Protected Attributes inherited from smtk::model::SessionIO
std::string m_referencePath
 

Detailed Description

A base class for delegating session I/O to/from JSON.

Subclasses should implement both importJSON and exportJSON methods.

Member Function Documentation

◆ loadModelRecords()

bool smtk::model::SessionIOJSON::loadModelRecords ( const json &  j,
smtk::model::ResourcePtr  rsrc 
)
static

Given JSON data, attempt to deserialize SMTK model records from it.

If the JSON object represents model data, it is added to the given resource.


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