HAL
hal::GraphContextSerializer Class Reference

#include <graph_context_serializer.h>

Inheritance diagram for hal::GraphContextSerializer:
Inheritance graph
Collaboration diagram for hal::GraphContextSerializer:
Collaboration graph

Public Member Functions

 GraphContextSerializer ()
 
std::string serialize (Netlist *netlist, const std::filesystem::path &savedir, bool isAutoSave)
 
void deserialize (Netlist *netlist, const std::filesystem::path &loaddir)
 
bool restore (const std::filesystem::path &loaddir=std::filesystem::path())
 
GraphContextselectedContext () const
 
- Public Member Functions inherited from hal::ProjectSerializer
 ProjectSerializer (const std::string &name)
 
virtual ~ProjectSerializer ()
 

Additional Inherited Members

- Protected Attributes inherited from hal::ProjectSerializer
std::string m_name
 

Detailed Description

Definition at line 33 of file graph_context_serializer.h.

Constructor & Destructor Documentation

◆ GraphContextSerializer()

hal::GraphContextSerializer::GraphContextSerializer ( )
inline

Definition at line 37 of file graph_context_serializer.h.

Member Function Documentation

◆ deserialize()

void hal::GraphContextSerializer::deserialize ( Netlist netlist,
const std::filesystem::path &  loaddir 
)
virtual

Abstract deserialize method to be implemented by derived class. Note that it can be assumed upon calling this method that the deserialization of the netlist has been successful. Caller will provide project directory name but not the filename. The latter one can be queried from ProjectManager.

Parameters
[in]netlistThe netlist already deserialized
[in]loaddirProject directory to load files from

Implements hal::ProjectSerializer.

Definition at line 9 of file graph_context_serializer.cpp.

References test_multiple::netlist, and restore().

◆ restore()

◆ selectedContext()

GraphContext* hal::GraphContextSerializer::selectedContext ( ) const
inline

Definition at line 45 of file graph_context_serializer.h.

Referenced by hal::ContentManager::handleOpenDocument().

◆ serialize()

std::string hal::GraphContextSerializer::serialize ( Netlist netlist,
const std::filesystem::path &  savedir,
bool  isAutosave 
)
virtual

Abstract serialize method to be implemented by derived class. If there was no need for serialization or serialization failed an empty file name should be returned.

Parameters
[in]netlistThe netlist to be serialized
[in]savedirTarget project directory
[in]isAutosaveTrue if serialize call was issued from autosave, false otherwise
Returns
relative name of file name that was used for serialization

Implements hal::ProjectSerializer.

Definition at line 26 of file graph_context_serializer.cpp.

References QString::fromStdString(), hal::gGraphContextManager, hal::GraphContextManager::handleSaveTriggered(), and test_multiple::netlist.


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