OpenASIP 2.2
Loading...
Searching...
No Matches
Environment.hh
Go to the documentation of this file.
1/*
2 Copyright (c) 2002-2019 Tampere University.
3
4 This file is part of TTA-Based Codesign Environment (TCE).
5
6 Permission is hereby granted, free of charge, to any person obtaining a
7 copy of this software and associated documentation files (the "Software"),
8 to deal in the Software without restriction, including without limitation
9 the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 and/or sell copies of the Software, and to permit persons to whom the
11 Software is furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 DEALINGS IN THE SOFTWARE.
23 */
24/**
25 * @file Environment.hh
26 *
27 * Declaration of Environment class.
28 *
29 * @author Atte Oksman 2003 (oksman-no.spam-cs.tut.fi)
30 * @author Viljami Korhonen 2007 (viljami.korhonen-no.spam-tut.fi)
31 * @author Pekka Jääskeläinen 2011
32 * @note reviewed 19 May 2004 by ao, jn, ml, am
33 * @note rating: red
34 */
35
36#ifndef TTA_ENVIRONMENT_HH
37#define TTA_ENVIRONMENT_HH
38
39#include <string>
40#include <vector>
41#include "TCEString.hh"
42
43/**
44 * A class to get the environmental variable values as well as to find files
45 * or directories from the project's directory structure.
46 */
48
49public:
50 static void initialize();
51
52 static std::string schemaDirPath(const std::string& prog);
53 static std::string dataDirPath(const std::string& prog);
54 static std::string bitmapsDirPath(const std::string& prog);
55 static std::string manDirPath(const std::string& prog);
56 static TCEString confPath(const std::string& fileName);
57 static TCEString userConfPath(const std::string& fileName);
58
59 static std::string errorLogFilePath();
60 static std::string iconDirPath();
61 static std::vector<std::string> includeDirPaths();
62 static std::vector<std::string> opsetIncludeDir();
63
64 static void setNewSchemaFileDir(const std::string& path);
65 static void setNewDataFileDir(const std::string& path);
66 static void setNewBitmapsFileDir(const std::string& path);
67 static void setNewManFileDir(const std::string& path);
68 static void setNewErrorLogFileDir(const std::string& path);
69
70 static std::string environmentVariable(const std::string& variable);
71 static std::vector<std::string> osalPaths();
72 static std::vector<std::string> codeCompressorPaths(
73 bool libraryPathsOnly = false);
74 static std::vector<std::string> schedulerPluginPaths();
75 static std::vector<std::string> icDecoderPluginPaths(
76 bool libraryPathsOnly = false);
77 static std::vector<std::string> hwModulePaths();
78 static std::vector<std::string> hdbPaths(
79 bool libraryPathsOnly = false);
80 static TCEString shortHDBPath(const TCEString& hdbPath);
81 static TCEString longHDBPath(const TCEString& hdbPath);
82 static std::vector<std::string> vhdlPaths(const std::string& hdbPath);
83 static std::vector<std::string> decompressorPaths(
84 bool libraryPathsOnly = false);
85 static std::vector<std::string> explorerPluginPaths();
86 static std::vector<std::string> estimatorPluginPaths();
87
88 static std::string pdfManual();
89 static std::string minimalADF();
90 static std::string tceCompiler();
91 static std::string defaultSchedulerConf();
92 static std::string oldGccSchedulerConf();
93 static std::string defaultICDecoderPlugin();
94 static std::string defaultTextEditorPath();
95
96 static std::string llvmtceCachePath();
97
98 static std::vector<std::string> implementationTesterTemplatePaths();
99 static std::string simTraceDirPath();
100
101 static bool developerMode();
102
103private:
104 Environment();
105 ~Environment();
106
107 static std::string pathTo(const std::string& name);
108 static inline void parsePathEnvVariable(std::vector<std::string>& paths);
109 static std::string findExecutableFromPATH(
110 const std::vector<std::string>& file);
111
112 /// Name of the XML Schema directory.
113 static const std::string SCHEMA_DIR_NAME_;
114 /// Name of the data directory.
115 static const std::string DATA_DIR_NAME_;
116 /// Name of the bitmaps directory.
117 static const std::string BITMAPS_DIR_NAME_;
118 /// Name of the manual directory.
119 static const std::string MAN_DIR_NAME_;
120 /// Name of the configuration directory.
121 static const std::string CONF_DIR_NAME_;
122 /// Name of the toolbar icon directory.
123 static const std::string ICON_DIR_NAME_;
124 /// Name of the system error log file.
125 static const std::string ERROR_LOG_FILE_NAME_;
126 /// Flag indicating whether class has been initialized.
127 static bool initialized_;
128 /// Flag indicating whether TCE is executing in developer mode.
129 static bool developerMode_;
130
131 /// Schema directory search paths.
132 static std::vector<std::string> schemaPaths_;
133 /// Data directory search paths.
134 static std::vector<std::string> dataPaths_;
135 /// Bitmaps directory search paths.
136 static std::vector<std::string> bitmapsPaths_;
137 /// Man directory search paths.
138 static std::vector<std::string> manPaths_;
139 /// Toolbar icon search paths.
140 static std::vector<std::string> iconPaths_;
141 /// Error file search paths.
142 static std::vector<std::string> errorPaths_;
143 /// Paths used in a particular search.
144 static std::vector<std::string> pathsToUse_;
145
146 /// Directory for new schema file.
147 static std::string newSchemaFileDir_;
148 /// Directory for new data file.
149 static std::string newDataFileDir_;
150 /// Directory for new bitmaps file.
151 static std::string newBitmapsFileDir_;
152 /// Directory for new icon file.
153 static std::string newIconFileDir_;
154 /// Directory for new manual file.
155 static std::string newManFileDir_;
156 /// Directory for new configure file.
157 static std::string newConfFile_;
158 /// Directory for new error log file.
159 static std::string newErrorLogFileDir_;
160 /// Directory to store ttasim traces
161 static std::string simTraceDir_;
162
163 /// Relative path to the installed TCE .pdf manual.
164 static const std::string PDF_MANUAL_INSTALLED;
165 /// Relative path to the TCE .pdf manual in source tree.
166 static const std::string PDF_MANUAL_SRC;
167 /// Relative path to the installed minimal.adf.
168 static const std::string MINIMAL_ADF_INSTALLED;
169 /// Relative path to the minimal.adf in source tree.
170 static const std::string MINIMAL_ADF_SRC;
171
172};
173
174#endif
static std::string defaultICDecoderPlugin()
static bool developerMode_
Flag indicating whether TCE is executing in developer mode.
static const std::string PDF_MANUAL_SRC
Relative path to the TCE .pdf manual in source tree.
static std::vector< std::string > schemaPaths_
Schema directory search paths.
static std::string simTraceDir_
Directory to store ttasim traces.
static void setNewManFileDir(const std::string &path)
static std::vector< std::string > dataPaths_
Data directory search paths.
static std::string tceCompiler()
static const std::string MAN_DIR_NAME_
Name of the manual directory.
static std::string findExecutableFromPATH(const std::vector< std::string > &file)
static std::string simTraceDirPath()
static std::string bitmapsDirPath(const std::string &prog)
static std::vector< std::string > icDecoderPluginPaths(bool libraryPathsOnly=false)
static std::vector< std::string > hwModulePaths()
static std::vector< std::string > pathsToUse_
Paths used in a particular search.
static std::vector< std::string > bitmapsPaths_
Bitmaps directory search paths.
static void initialize()
static std::string newManFileDir_
Directory for new manual file.
static void setNewBitmapsFileDir(const std::string &path)
static std::string pathTo(const std::string &name)
static std::string llvmtceCachePath()
static std::string defaultTextEditorPath()
static TCEString userConfPath(const std::string &fileName)
static std::vector< std::string > errorPaths_
Error file search paths.
static std::string environmentVariable(const std::string &variable)
static const std::string ERROR_LOG_FILE_NAME_
Name of the system error log file.
static std::vector< std::string > iconPaths_
Toolbar icon search paths.
static const std::string BITMAPS_DIR_NAME_
Name of the bitmaps directory.
static std::vector< std::string > implementationTesterTemplatePaths()
static void setNewDataFileDir(const std::string &path)
static std::string pdfManual()
static std::string defaultSchedulerConf()
static std::string minimalADF()
static std::string errorLogFilePath()
static const std::string ICON_DIR_NAME_
Name of the toolbar icon directory.
static std::string newIconFileDir_
Directory for new icon file.
static std::string newConfFile_
Directory for new configure file.
static std::vector< std::string > codeCompressorPaths(bool libraryPathsOnly=false)
static std::vector< std::string > includeDirPaths()
static std::string dataDirPath(const std::string &prog)
static std::vector< std::string > schedulerPluginPaths()
static void setNewSchemaFileDir(const std::string &path)
static const std::string MINIMAL_ADF_INSTALLED
Relative path to the installed minimal.adf.
static std::string newSchemaFileDir_
Directory for new schema file.
static std::vector< std::string > hdbPaths(bool libraryPathsOnly=false)
static std::string iconDirPath()
static bool developerMode()
static std::string newErrorLogFileDir_
Directory for new error log file.
static const std::string SCHEMA_DIR_NAME_
Name of the XML Schema directory.
static TCEString longHDBPath(const TCEString &hdbPath)
static std::string manDirPath(const std::string &prog)
static std::vector< std::string > decompressorPaths(bool libraryPathsOnly=false)
static bool initialized_
Flag indicating whether class has been initialized.
static std::vector< std::string > manPaths_
Man directory search paths.
static std::string schemaDirPath(const std::string &prog)
static std::string oldGccSchedulerConf()
static std::vector< std::string > osalPaths()
static std::vector< std::string > estimatorPluginPaths()
static std::string newBitmapsFileDir_
Directory for new bitmaps file.
static const std::string MINIMAL_ADF_SRC
Relative path to the minimal.adf in source tree.
static const std::string PDF_MANUAL_INSTALLED
Relative path to the installed TCE .pdf manual.
static const std::string DATA_DIR_NAME_
Name of the data directory.
static std::vector< std::string > vhdlPaths(const std::string &hdbPath)
static void parsePathEnvVariable(std::vector< std::string > &paths)
static TCEString shortHDBPath(const TCEString &hdbPath)
static TCEString confPath(const std::string &fileName)
static std::vector< std::string > opsetIncludeDir()
static std::vector< std::string > explorerPluginPaths()
static void setNewErrorLogFileDir(const std::string &path)
static const std::string CONF_DIR_NAME_
Name of the configuration directory.
static std::string newDataFileDir_
Directory for new data file.