HAL  v4.5.0-83-g30c8f0afc
The Hardware Analyzer - a comprehensive reverse engineering and manipulation framework for gate-level netlists.
hal::GraphContextSerializer Class Reference

#include </home/runner/work/hal/hal/plugins/gui/include/gui/graph_widget/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

Stores the graph views of a project so that they can be restored when the project is opened again.

Definition at line 36 of file graph_context_serializer.h.

Constructor & Destructor Documentation

◆ GraphContextSerializer()

hal::GraphContextSerializer::GraphContextSerializer ( )
inline

Definition at line 40 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 restore().

◆ restore()

◆ selectedContext()

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

Definition at line 48 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, and hal::GraphContextManager::handleSaveTriggered().


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