HAL
hal::ProjectSerializer Class Referenceabstract

#include <project_serializer.h>

Inheritance diagram for hal::ProjectSerializer:
Inheritance graph
Collaboration diagram for hal::ProjectSerializer:
Collaboration graph

Public Member Functions

 ProjectSerializer (const std::string &name)
 
virtual ~ProjectSerializer ()
 
virtual std::string serialize (Netlist *netlist, const std::filesystem::path &savedir, bool isAutosave)=0
 
virtual void deserialize (Netlist *netlist, const std::filesystem::path &loaddir)=0
 

Protected Attributes

std::string m_name
 

Detailed Description

Definition at line 36 of file project_serializer.h.

Constructor & Destructor Documentation

◆ ProjectSerializer()

hal::ProjectSerializer::ProjectSerializer ( const std::string &  name)

Constructor

Parameters
nameTag name for serializer to be identified by project manager

Definition at line 5 of file project_serializer.cpp.

References hal::ProjectManager::instance(), m_name, and hal::ProjectManager::register_serializer().

◆ ~ProjectSerializer()

hal::ProjectSerializer::~ProjectSerializer ( )
virtual

Virtual destructor

Definition at line 11 of file project_serializer.cpp.

References hal::ProjectManager::instance(), m_name, and hal::ProjectManager::unregister_serializer().

Member Function Documentation

◆ deserialize()

virtual void hal::ProjectSerializer::deserialize ( Netlist netlist,
const std::filesystem::path &  loaddir 
)
pure 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

Implemented in hal::ModuleColorSerializer, hal::GroupingColorSerializer, hal::CommentManager, hal::GroupingSerializer, hal::PythonSerializer, and hal::GraphContextSerializer.

◆ serialize()

virtual std::string hal::ProjectSerializer::serialize ( Netlist netlist,
const std::filesystem::path &  savedir,
bool  isAutosave 
)
pure 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

Implemented in hal::ModuleColorSerializer, hal::GroupingColorSerializer, hal::CommentManager, hal::GroupingSerializer, hal::PythonSerializer, and hal::GraphContextSerializer.

Member Data Documentation

◆ m_name


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