1
//---------------------------------------------------------------------------
3
// Project: OpenWalnut ( http://www.openwalnut.org )
5
// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
6
// For more information see http://www.openwalnut.org/copying
8
// This file is part of OpenWalnut.
10
// OpenWalnut is free software: you can redistribute it and/or modify
11
// it under the terms of the GNU Lesser General Public License as published by
12
// the Free Software Foundation, either version 3 of the License, or
13
// (at your option) any later version.
15
// OpenWalnut is distributed in the hope that it will be useful,
16
// but WITHOUT ANY WARRANTY; without even the implied warranty of
17
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
// GNU Lesser General Public License for more details.
20
// You should have received a copy of the GNU Lesser General Public License
21
// along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
23
//---------------------------------------------------------------------------
25
#ifndef WROIPROJECTFILEIO_H
26
#define WROIPROJECTFILEIO_H
32
#include "boost/tuple/tuple.hpp"
34
#include "../common/WProjectFileIO.h"
39
* IO Class for writing the ROI structure to a project file.
41
class WRoiProjectFileIO: public WProjectFileIO
45
* Default constructor.
52
virtual ~WRoiProjectFileIO();
55
* This method parses the specified line and interprets it. It gets called line by line by WProjectFile.
57
* \param line the current line as string
58
* \param lineNumber the current line number. Useful for error/warning/debugging output.
60
* \return true if the line could be parsed.
62
virtual bool parse( std::string line, unsigned int lineNumber );
65
* Called whenever the end of the project file has been reached. This is useful if your specific parser class wants to do some post
66
* processing after parsing line by line.
71
* Saves the state to the specified stream.
73
* \param output the stream to print the state to.
75
virtual void save( std::ostream& output ); // NOLINT
78
* Create a clone of the IO. This is especially useful for custom parsers registered at \ref WProjectFile::registerParser. Implement this
81
* \param project the project file using this parser instance.
83
* \return Cloned instance.
85
virtual SPtr clone( WProjectFile* project ) const;
92
typedef unsigned int Branch;
95
* Property for branch/roi with ID. Property name and value are stored as string
97
typedef boost::tuple< std::string, std::string > Property;
100
* The properties as vector.
102
typedef std::vector< Property > Properties;
105
* All loaded branch IDs
107
std::vector< Branch > m_branches;
110
* Properties of each branch
112
std::map< Branch, Properties > m_branchProperties;
117
typedef unsigned int RoiID;
120
* ROI by ID, second is parent branch ID
122
typedef boost::tuple< RoiID, Branch > Roi;
127
std::vector< Roi > m_rois;
130
* Properties of each branch
132
std::map< RoiID, Properties > m_roiProperties;
135
#endif // WROIPROJECTFILEIO_H