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 #include <openfluid/dllexport.hpp>
00041 #include <openfluid/tools/SwissTools.hpp>
00042
00043
00044 #ifndef __WARESIGNATURE_HPP__
00045 #define __WARESIGNATURE_HPP__
00046
00047
00048
00049
00050
00051 #define DECLARE_NAME(name) Signature->Name = name;
00052
00053
00054
00055
00056 #define DECLARE_DESCRIPTION(desc) Signature->Description = desc;
00057
00058
00059
00060
00061 #define DECLARE_AUTHOR(name,email) Signature->Authors.push_back(std::make_pair((name),(email)));
00062
00063
00064
00065
00066 #define DECLARE_VERSION(version) Signature->Version = version;
00067
00068
00069
00070
00071 #define DECLARE_STATUS(status) Signature->Status = status;
00072
00073
00074
00075
00076 #define DECLARE_SDKVERSION Signature->setABIVersion(openfluid::config::FULL_VERSION);
00077
00078
00079
00080
00081
00082
00083 namespace openfluid { namespace ware {
00084
00085
00086 typedef std::string WareID_t;
00087
00088 typedef std::string WareName_t;
00089
00090 typedef std::string WareVersion_t;
00091
00092
00093
00094
00095
00096 enum WareStatus_t
00097 {
00098
00099
00100
00101 EXPERIMENTAL,
00102
00103
00104
00105
00106 BETA,
00107
00108
00109
00110
00111 STABLE
00112 };
00113
00114
00115
00116
00117
00118
00119 class DLLEXPORT WareSignature
00120 {
00121 public:
00122
00123 typedef std::list<std::pair<std::string,std::string> > AuthorsList_t;
00124
00125 WareID_t ID;
00126
00127 WareName_t Name;
00128
00129 std::string Description;
00130
00131
00132
00133
00134 WareVersion_t Version;
00135
00136
00137
00138
00139 WareStatus_t Status;
00140
00141
00142
00143
00144 WareVersion_t ABIVersion;
00145
00146
00147
00148
00149 AuthorsList_t Authors;
00150
00151
00152 WareSignature() :
00153 ID(""),Name(""),Description(""),Version(""),
00154 Status(EXPERIMENTAL),ABIVersion("")
00155 {
00156 Authors.clear();
00157 }
00158
00159
00160 virtual ~WareSignature()
00161 {}
00162
00163
00164 void setABIVersion(WareVersion_t Version)
00165 {
00166 ABIVersion = Version;
00167 }
00168
00169
00170 std::string getAuthorsAsString() const
00171 {
00172 std::string Str = "";
00173
00174 for (openfluid::ware::WareSignature::AuthorsList_t::const_iterator it = Authors.begin(); it != Authors.end();++it)
00175 {
00176 if (it != Authors.begin())
00177 Str+= ", ";
00178
00179 Str += openfluid::tools::ReplaceEmptyString((*it).first,("(unknown author)"));
00180 Str += " <";
00181 Str += openfluid::tools::ReplaceEmptyString((*it).second,("(unknown author email)"));
00182 Str += ">";
00183 }
00184 return Str;
00185 }
00186
00187
00188 };
00189
00190
00191
00192 } }
00193
00194
00195
00196 #endif