Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/src/core/NamespaceNode.h @ 1055

Last change on this file since 1055 was 1052, checked in by landauf, 16 years ago

merged core2 back to trunk
there might be some errors, wasn't able to test it yet due to some strange g++ and linker behaviour.

File size: 2.0 KB
Line 
1/*
2 *   ORXONOX - the hottest 3D action shooter ever to exist
3 *
4 *
5 *   License notice:
6 *
7 *   This program is free software; you can redistribute it and/or
8 *   modify it under the terms of the GNU General Public License
9 *   as published by the Free Software Foundation; either version 2
10 *   of the License, or (at your option) any later version.
11 *
12 *   This program is distributed in the hope that it will be useful,
13 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
14 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 *   GNU General Public License for more details.
16 *
17 *   You should have received a copy of the GNU General Public License
18 *   along with this program; if not, write to the Free Software
19 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20 *
21 *   Author:
22 *      Fabian 'x3n' Landau
23 *   Co-authors:
24 *      ...
25 *
26 */
27
28#ifndef _NamespaceNode_H__
29#define _NamespaceNode_H__
30
31#include <map>
32#include <set>
33#include <string>
34
35#include "CorePrereqs.h"
36
37namespace orxonox
38{
39    class NamespaceNode
40    {
41        public:
42            NamespaceNode(const std::string& name, NamespaceNode* parent = 0);
43            ~NamespaceNode();
44
45            std::set<NamespaceNode*> getNodeRelative(const std::string& name);
46
47            void setRoot(bool bRoot) { this->bRoot_ = bRoot; }
48            void setHidden(bool bHidden) { this->bHidden_ = bHidden; }
49
50            bool isRoot() const { return this->bRoot_; }
51            bool isHidden() const { return this->bHidden_; }
52
53            bool includes(const NamespaceNode*) const;
54
55            std::string toString() const;
56            std::string toString(const std::string& indentation) const;
57
58        private:
59            std::string name_;
60            NamespaceNode* parent_;
61            std::map<std::string, NamespaceNode*> subnodes_;
62            bool bHidden_;
63            bool bRoot_;
64    };
65}
66
67#endif /* _NamespaceNode_H__ */
Note: See TracBrowser for help on using the repository browser.