25 #ifndef WMODULEPROJECTFILECOMBINER_H
26 #define WMODULEPROJECTFILECOMBINER_H
36 #include "../../common/WProjectFileIO.h"
37 #include "../WModuleCombiner.h"
86 virtual bool parse( std::string line,
unsigned int lineNumber );
99 virtual void save( std::ostream& output );
119 virtual std::shared_ptr< WModule >
mapToModule(
unsigned int id )
const;
129 virtual unsigned int mapFromModule( std::shared_ptr< WModule > module )
const;
135 typedef std::pair< unsigned int, std::shared_ptr< WModule > >
ModuleID;
140 typedef std::map< unsigned int, std::shared_ptr< WModule > >
ModuleIDMap;
145 std::map< unsigned int, std::shared_ptr< WModule > >
m_modules;
150 typedef std::pair< unsigned int, std::string >
Connector;
165 typedef std::pair< unsigned int, std::string >
Property;
This is a base class for all module combination classes.
This class is able to parse project files and create the appropriate module graph inside a specified ...
std::pair< unsigned int, std::shared_ptr< WModule > > ModuleID
The module ID type.
std::pair< Property, std::string > PropertyValue
A property value is a property and the new value as string.
std::list< PropertyValue > m_properties
All properties.
virtual bool parse(std::string line, unsigned int lineNumber)
This method parses the specified line and interprets it to fill the internal module graph structure.
virtual ~WModuleProjectFileCombiner()
Destructor.
std::map< unsigned int, std::shared_ptr< WModule > > m_modules
All Modules.
std::pair< unsigned int, std::string > Property
A property is a pair of ID and name.
std::pair< unsigned int, std::string > Connector
A connector is described by ID and name.
virtual WProjectFileIO::SPtr clone(WProjectFile *project) const
Create a clone of the IO.
virtual void save(std::ostream &output)
Saves the state to the specified stream.
std::map< unsigned int, std::shared_ptr< WModule > > ModuleIDMap
Map between ID and Module.
virtual std::shared_ptr< WModule > mapToModule(unsigned int id) const
Map a given project file ID to a module.
WModuleProjectFileCombiner()
Creates an empty combiner.
virtual unsigned int mapFromModule(std::shared_ptr< WModule > module) const
Map a given module to project file ID.
std::list< Connection > m_connections
All connections.
virtual void apply()
Apply the internal module structure to the target container.
virtual void done()
Called whenever the end of the project file has been reached.
std::pair< Connector, Connector > Connection
A connection is a pair of connectors.
Class representing a single module of OpenWalnut.
A base class for all parts of OpenWalnut which can be serialized to a project file.
std::shared_ptr< WProjectFileIO > SPtr
Abbreviation for a shared pointer.
Class loading project files.