OpenIG  2.0.4
cross-platform open-source OpenSceneGraph Image Generator
Configuration.h
1 //#******************************************************************************
2 //#*
3 //#* Copyright (C) 2015 Compro Computer Services
4 //#* http://openig.compro.net
5 //#*
6 //#* Source available at: https://github.com/CCSI-CSSI/MuseOpenIG
7 //#*
8 //#* This software is released under the LGPL.
9 //#*
10 //#* This software is free software; you can redistribute it and/or modify
11 //#* it under the terms of the GNU Lesser General Public License as published
12 //#* by the Free Software Foundation; either version 2.1 of the License, or
13 //#* (at your option) any later version.
14 //#*
15 //#* This software 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
18 //#* the 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 this library; if not, write to the Free Software
22 //#* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 //#*
24 //#* Please direct any questions or comments to the OpenIG Forums
25 //#* Email address: openig@compro.net
26 //#*
27 //#*
28 //#* Please direct any questions or comments to the OpenIG Forums
29 //#* Email address: openig@compro.net
30 //#*
31 //#*
32 //#*****************************************************************************
33 
34 #ifndef CONFIGURATION_H
35 #define CONFIGURATION_H
36 
37 #if defined(OPENIG_SDK)
38  #include <OpenIG-Base/Export.h>
39 #else
40  #include <Core-Base/Export.h>
41 #endif
42 
43 #include <string>
44 #include <map>
45 
46 namespace OpenIG {
47  namespace Base {
54  class IGCORE_EXPORT Configuration
55  {
56  public:
64  static Configuration* instance();
65 
75  bool readFromXML(const std::string& fileName, const std::string& section);
76 
85  const std::string getConfig(const std::string& token, const std::string = "");
86 
95  double getConfig(const std::string& token, double value = 0.0);
96 
105  int getConfig(const std::string& token, int value = 0);
106 
107  protected:
108  Configuration() {}
109  ~Configuration() {}
110 
111  typedef std::map< std::string, std::string > ConfigMap;
112  typedef std::map< std::string, std::string >::iterator ConfigMapIterator;
113  typedef std::map< std::string, std::string >::const_iterator ConfigMapConstIterator;
114 
116  ConfigMap _configuration;
117 
118  };
119  } // namespace
120 } // openig
121 
122 #endif // CONFIGURATION_H
Definition: ImageGenerator.h:62
ConfigMap _configuration
token based std::map of tag values
Definition: Configuration.h:116
The Configuration class.
Definition: Configuration.h:54