~ubuntu-branches/ubuntu/wily/openwalnut/wily-proposed

« back to all changes in this revision

Viewing changes to .pc/gcc5.patch/src/core/kernel/WRoiProjectFileIO.h

  • Committer: Package Import Robot
  • Author(s): Michael Terry
  • Date: 2015-08-12 13:14:55 UTC
  • Revision ID: package-import@ubuntu.com-20150812131455-cwndvoy9wwx34ya2
Tags: 1.4.0~rc1+hg3a3147463ee2-1ubuntu4
* debian/patches/gcc5.patch:
  - Work around incompatibility between boost+gcc5 and Qt4, fixing FTBFS

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//---------------------------------------------------------------------------
 
2
//
 
3
// Project: OpenWalnut ( http://www.openwalnut.org )
 
4
//
 
5
// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
 
6
// For more information see http://www.openwalnut.org/copying
 
7
//
 
8
// This file is part of OpenWalnut.
 
9
//
 
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.
 
14
//
 
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.
 
19
//
 
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/>.
 
22
//
 
23
//---------------------------------------------------------------------------
 
24
 
 
25
#ifndef WROIPROJECTFILEIO_H
 
26
#define WROIPROJECTFILEIO_H
 
27
 
 
28
#include <string>
 
29
#include <vector>
 
30
#include <map>
 
31
 
 
32
#include "boost/tuple/tuple.hpp"
 
33
 
 
34
#include "../common/WProjectFileIO.h"
 
35
 
 
36
class WProjectFile;
 
37
 
 
38
/**
 
39
 * IO Class for writing the ROI structure to a project file.
 
40
 */
 
41
class  WRoiProjectFileIO: public WProjectFileIO
 
42
{
 
43
public:
 
44
    /**
 
45
     * Default constructor.
 
46
     */
 
47
    WRoiProjectFileIO();
 
48
 
 
49
    /**
 
50
     * Destructor.
 
51
     */
 
52
    virtual ~WRoiProjectFileIO();
 
53
 
 
54
    /**
 
55
     * This method parses the specified line and interprets it. It gets called line by line by WProjectFile.
 
56
     *
 
57
     * \param line the current line as string
 
58
     * \param lineNumber the current line number. Useful for error/warning/debugging output.
 
59
     *
 
60
     * \return true if the line could be parsed.
 
61
     */
 
62
    virtual bool parse( std::string line, unsigned int lineNumber );
 
63
 
 
64
    /**
 
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.
 
67
     */
 
68
    virtual void done();
 
69
 
 
70
    /**
 
71
     * Saves the state to the specified stream.
 
72
     *
 
73
     * \param output the stream to print the state to.
 
74
     */
 
75
    virtual void save( std::ostream& output );   // NOLINT
 
76
 
 
77
    /**
 
78
     * Create a clone of the IO. This is especially useful for custom parsers registered at \ref WProjectFile::registerParser. Implement this
 
79
     * function.
 
80
     *
 
81
     * \param project the project file using this parser instance.
 
82
     *
 
83
     * \return Cloned instance.
 
84
     */
 
85
    virtual SPtr clone( WProjectFile* project ) const;
 
86
 
 
87
protected:
 
88
private:
 
89
    /**
 
90
     * Branch by ID
 
91
     */
 
92
    typedef unsigned int Branch;
 
93
 
 
94
    /**
 
95
     * Property for branch/roi with ID. Property name and value are stored as string
 
96
     */
 
97
    typedef boost::tuple< std::string, std::string > Property;
 
98
 
 
99
    /**
 
100
     * The properties as vector.
 
101
     */
 
102
    typedef std::vector< Property > Properties;
 
103
 
 
104
    /**
 
105
     * All loaded branch IDs
 
106
     */
 
107
    std::vector< Branch > m_branches;
 
108
 
 
109
    /**
 
110
     * Properties of each branch
 
111
     */
 
112
    std::map< Branch, Properties > m_branchProperties;
 
113
 
 
114
    /**
 
115
     * ID of a ROI
 
116
     */
 
117
    typedef unsigned int RoiID;
 
118
 
 
119
    /**
 
120
     * ROI by ID, second is parent branch ID
 
121
     */
 
122
    typedef boost::tuple< RoiID, Branch > Roi;
 
123
 
 
124
    /**
 
125
     * All loaded rois
 
126
     */
 
127
    std::vector< Roi > m_rois;
 
128
 
 
129
    /**
 
130
     * Properties of each branch
 
131
     */
 
132
    std::map< RoiID, Properties > m_roiProperties;
 
133
};
 
134
 
 
135
#endif  // WROIPROJECTFILEIO_H
 
136