All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
WareSignature.hpp
Go to the documentation of this file.
1 /*
2 
3  This file is part of OpenFLUID software
4  Copyright(c) 2007, INRA - Montpellier SupAgro
5 
6 
7  == GNU General Public License Usage ==
8 
9  OpenFLUID is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  (at your option) any later version.
13 
14  OpenFLUID is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with OpenFLUID. If not, see <http://www.gnu.org/licenses/>.
21 
22 
23  == Other Usage ==
24 
25  Other Usage means a use of OpenFLUID that is inconsistent with the GPL
26  license, and requires a written agreement between You and INRA.
27  Licensees for Other Usage of OpenFLUID may use this file in accordance
28  with the terms contained in the written agreement between You and INRA.
29 
30 */
31 
32 
33 /**
34  \file WareSignature.hpp
35  \brief Header of ...
36 
37  \author Jean-Christophe FABRE <fabrejc@supagro.inra.fr>
38  */
39 
40 #include <openfluid/dllexport.hpp>
42 
43 
44 #ifndef __WARESIGNATURE_HPP__
45 #define __WARESIGNATURE_HPP__
46 
47 
48 /**
49  Macro for declaration of the ware name
50 */
51 #define DECLARE_NAME(name) Signature->Name = name;
52 
53 /**
54  Macro for declaration of the ware description
55 */
56 #define DECLARE_DESCRIPTION(desc) Signature->Description = desc;
57 
58 /**
59  Macro for declaration of the ware author name and email
60 */
61 #define DECLARE_AUTHOR(name,email) Signature->Authors.push_back(std::make_pair((name),(email)));
62 
63 /**
64  Macro for declaration of the ware version
65 */
66 #define DECLARE_VERSION(version) Signature->Version = version;
67 
68 /**
69  Macro for declaration of the ware status
70 */
71 #define DECLARE_STATUS(status) Signature->Status = status;
72 
73 /**
74  Macro for declaration of ABI version used to build the ware
75 */
76 #define DECLARE_SDKVERSION Signature->setABIVersion(openfluid::config::FULL_VERSION);
77 
78 
79 // =====================================================================
80 // =====================================================================
81 
82 
83 namespace openfluid { namespace ware {
84 
85 
86 typedef std::string WareID_t;
87 
88 typedef std::string WareName_t;
89 
90 typedef std::string WareVersion_t;
91 
92 
93 /**
94  Ware status
95 */
97 {
98  /**
99  Experimental status, for testing only
100  */
102 
103  /**
104  Beta status, on the road to a stable status
105  */
107 
108  /**
109  Stable status
110  */
112 };
113 
114 
115 // =====================================================================
116 // =====================================================================
117 
118 
120 {
121  public:
122 
123  typedef std::list<std::pair<std::string,std::string> > AuthorsList_t;
124 
126 
128 
129  std::string Description;
130 
131  /**
132  Version number
133  */
135 
136  /**
137  Development status
138  */
140 
141  /**
142  ABI version number used to build the ware
143  */
145 
146  /**
147  Authors as a list of pairs [name,email]
148  */
150 
151 
153  ID(""),Name(""),Description(""),Version(""),
154  Status(EXPERIMENTAL),ABIVersion("")
155  {
156  Authors.clear();
157  }
158 
159 
160  virtual ~WareSignature()
161  {}
162 
163 
165  {
166  ABIVersion = Version;
167  }
168 
169 
170  std::string getAuthorsAsString() const
171  {
172  std::string Str = "";
173 
174  for (openfluid::ware::WareSignature::AuthorsList_t::const_iterator it = Authors.begin(); it != Authors.end();++it)
175  {
176  if (it != Authors.begin())
177  Str+= ", ";
178 
179  Str += openfluid::tools::ReplaceEmptyString((*it).first,("(unknown author)"));
180  Str += " <";
181  Str += openfluid::tools::ReplaceEmptyString((*it).second,("(unknown author email)"));
182  Str += ">";
183  }
184  return Str;
185  }
186 
187 
188 };
189 
190 
191 
192 } } // openfluid::ware
193 
194 
195 
196 #endif /* __WARESIGNATURE_HPP__ */
Definition: WareSignature.hpp:119
WareStatus_t Status
Definition: WareSignature.hpp:139
std::string WareName_t
Definition: WareSignature.hpp:88
Definition: WareSignature.hpp:106
WareID_t ID
Definition: WareSignature.hpp:125
WareVersion_t Version
Definition: WareSignature.hpp:134
std::string WareVersion_t
Definition: WareSignature.hpp:90
std::list< std::pair< std::string, std::string > > AuthorsList_t
Definition: WareSignature.hpp:123
WareName_t Name
Definition: WareSignature.hpp:127
WareVersion_t ABIVersion
Definition: WareSignature.hpp:144
WareStatus_t
Definition: WareSignature.hpp:96
std::string WareID_t
Definition: WareSignature.hpp:86
WareSignature()
Definition: WareSignature.hpp:152
AuthorsList_t Authors
Definition: WareSignature.hpp:149
std::string DLLEXPORT ReplaceEmptyString(std::string SourceStr, const std::string &ReplaceStr)
void setABIVersion(WareVersion_t Version)
Definition: WareSignature.hpp:164
virtual ~WareSignature()
Definition: WareSignature.hpp:160
std::string Description
Definition: WareSignature.hpp:129
Definition: WareSignature.hpp:111
std::string getAuthorsAsString() const
Definition: WareSignature.hpp:170
Definition: WareSignature.hpp:101
#define DLLEXPORT
Definition: dllexport.hpp:51