25 #ifndef WMODULEPROJECTFILECOMBINER_H
26 #define WMODULEPROJECTFILECOMBINER_H
34 #include <boost/shared_ptr.hpp>
36 #include "../../common/WProjectFileIO.h"
38 #include "../WModuleCombiner.h"
87 virtual bool parse( std::string line,
unsigned int lineNumber );
100 virtual void save( std::ostream& output );
120 virtual boost::shared_ptr< WModule >
mapToModule(
unsigned int id )
const;
130 virtual unsigned int mapFromModule( boost::shared_ptr< WModule > module )
const;
136 typedef std::pair< unsigned int, boost::shared_ptr< WModule > >
ModuleID;
141 typedef std::map< unsigned int, boost::shared_ptr< WModule > >
ModuleIDMap;
146 std::map< unsigned int, boost::shared_ptr< WModule > >
m_modules;
151 typedef std::pair< unsigned int, std::string >
Connector;
166 typedef std::pair< unsigned int, std::string >
Property;
180 #endif // WMODULEPROJECTFILECOMBINER_H
std::pair< unsigned int, std::string > Connector
A connector is described by ID and name.
std::map< unsigned int, boost::shared_ptr< WModule > > ModuleIDMap
Map between ID and Module.
virtual void apply()
Apply the internal module structure to the target container.
std::pair< unsigned int, boost::shared_ptr< WModule > > ModuleID
The module ID type.
Class representing a single module of OpenWalnut.
virtual SPtr clone(WProjectFile *project) const
Create a clone of the IO.
virtual boost::shared_ptr< WModule > mapToModule(unsigned int id) const
Map a given project file ID to a module.
std::pair< Property, std::string > PropertyValue
A property value is a property and the new value as string.
virtual ~WModuleProjectFileCombiner()
Destructor.
virtual void save(std::ostream &output)
Saves the state to the specified stream.
std::pair< unsigned int, std::string > Property
A property is a pair of ID and name.
Class loading project files.
std::list< PropertyValue > m_properties
All properties.
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 ...
boost::shared_ptr< WProjectFileIO > SPtr
Abbreviation for a shared pointer.
std::list< Connection > m_connections
All connections.
A base class for all parts of OpenWalnut which can be serialized to a project file.
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...
std::pair< Connector, Connector > Connection
A connection is a pair of connectors.
virtual unsigned int mapFromModule(boost::shared_ptr< WModule > module) const
Map a given module to project file ID.
WModuleProjectFileCombiner()
Creates an empty combiner.
virtual void done()
Called whenever the end of the project file has been reached.
std::map< unsigned int, boost::shared_ptr< WModule > > m_modules
All Modules.