Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 #ifndef __MARKETPACKAGE_HPP__
00042 #define __MARKETPACKAGE_HPP__
00043
00044
00045 #include <openfluid/dllexport.hpp>
00046 #include <openfluid/base/RuntimeEnv.hpp>
00047 #include <openfluid/market/MarketInfos.hpp>
00048 #include <openfluid/tools/ExternalProgram.hpp>
00049
00050
00051 namespace openfluid { namespace market {
00052
00053
00054 class DLLEXPORT MarketPackage
00055 {
00056 protected:
00057
00058 static const std::string BUILDS_SUBDIR;
00059
00060 static const std::string DLOADS_SUBDIR;
00061
00062 static const std::string LOG_FILENAME;
00063
00064
00065
00066
00067
00068 static std::string m_TempDir;
00069
00070
00071
00072
00073 static std::string m_TempBuildsDir;
00074
00075
00076
00077
00078 static std::string m_TempDownloadsDir;
00079
00080
00081
00082
00083 static std::string m_MarketBagSimulatorDir;
00084
00085
00086
00087
00088 static std::string m_MarketBagObserverDir;
00089
00090
00091
00092
00093 static std::string m_MarketBagBuilderextDir;
00094
00095
00096
00097
00098 static std::string m_MarketBagDatasetDir;
00099
00100
00101
00102
00103 static std::string m_MarketBagBinSubDir;
00104
00105
00106
00107
00108 static std::string m_MarketBagSrcSubDir;
00109
00110 static openfluid::tools::ExternalProgram m_CMakeProgram;
00111
00112
00113
00114
00115 static std::string m_SimulatorBuildConfigOptions;
00116
00117
00118
00119
00120 static std::string m_ObserverBuildConfigOptions;
00121
00122
00123
00124
00125 static std::string m_BuilderextBuildConfigOptions;
00126
00127 static std::string m_LogFile;
00128
00129 static bool m_IsLogEnabled;
00130
00131 static bool m_Initialized;
00132
00133
00134
00135 openfluid::ware::WareID_t m_ID;
00136
00137 std::string m_PackageURL;
00138
00139 std::string m_PackageFilename;
00140
00141 std::string m_PackageDest;
00142
00143 bool m_Downloaded;
00144
00145 static void resetLogFile();
00146
00147 static void appendToLogFile(const std::string& PackageName,
00148 const PackageInfo::PackageType& Type,
00149 const std::string& Action,
00150 const std::string& Str);
00151
00152 static void appendToLogFile(const std::string& Str);
00153
00154
00155 public:
00156
00157 MarketPackage(const openfluid::ware::WareID_t& ID, const std::string& PackageURL);
00158
00159 virtual ~MarketPackage();
00160
00161 static void initialize(bool EnableLog);
00162
00163
00164
00165
00166 static void setWorksDirs(const std::string& TempDir, const std::string& MarketBagSimulatorDir,
00167 const std::string& MarketBagObserverDir, const std::string& MarketBagBuilderextDir,
00168 const std::string& MarketBagDatasetDir, const std::string& MarketBagBinSubDir,
00169 const std::string& MarketBagSrcSubDir);
00170
00171 static std::string getMarketBagSimulatorDir() { return m_MarketBagSimulatorDir; };
00172
00173 static std::string getMarketBagObserverDir() { return m_MarketBagObserverDir; };
00174
00175 static std::string getMarketBagBuilderextDir() { return m_MarketBagBuilderextDir; };
00176
00177 static std::string getMarketBagDatasetDir() { return m_MarketBagDatasetDir; };
00178
00179 static std::string getMarketBagBinSubDir() { return m_MarketBagBinSubDir; };
00180
00181 static std::string getMarketBagSrcSubDir() { return m_MarketBagSrcSubDir; };
00182
00183 static std::string getTempDir() { return m_TempDir; };
00184
00185 static std::string getTempBuildsDir() { return m_TempBuildsDir; };
00186
00187 static std::string getTempDownloadsDir() { return m_TempDownloadsDir; };
00188
00189 static std::string getLogFile() { return m_LogFile; };
00190
00191
00192
00193
00194
00195 static std::string getCommonBuildOptions(const PackageInfo::PackageType& Type);
00196
00197
00198
00199
00200
00201
00202 static void setCommonBuildOptions(const PackageInfo::PackageType& Type, const std::string& BuildOptions);
00203
00204
00205
00206
00207
00208
00209
00210 static std::string composeFullBuildOptions(const PackageInfo::PackageType& Type, const std::string& BuildOptions);
00211
00212 openfluid::ware::WareID_t getID() const { return m_ID; };
00213
00214 virtual MetaPackageInfo::SelectionType getFormat() const = 0;
00215
00216
00217
00218
00219
00220 virtual std::string getInstallPath() const = 0;
00221
00222
00223
00224
00225 virtual PackageInfo::PackageType getPackageType() const = 0;
00226
00227 virtual void process() = 0;
00228
00229 void download();
00230
00231
00232 };
00233
00234
00235
00236
00237 } }
00238
00239
00240 #endif