MTemplateVariable.h
1 /*****************************************************************************
2  **
3  ** Header file for Muster API Template variable object
4  **
5  ** Name : MTemplateVariable.h
6  ** Author : Leonardo Bernardini
7  ** Version : Alpha 9.0 Wed May 17th 2017
8  **
9  ** Copyright 2000-2017, Virtual Vertex
10  ** All Rights Reserved.
11  **
12  ** This file contains UNPUBLISHED PROPRIETARY SOURCE CODE.
13  ** The contents of this file may not be disclosed to third parties, copied
14  ** or duplicated in any form, in whole or in part, without the prior written
15  ** permission of the author.
16  **
17  *****************************************************************************/
18 #ifndef MTEMPLATEVARIABLE_H
19 #define MTEMPLATEVARIABLE_H
20 
21 
22 #ifdef WIN32
23 // Windows definitions
24 #ifdef MCLIENTLIB_EXPORTS
25 #define MCLIENTLIB_API __declspec(dllexport)
26 #else
27 #define MCLIENTLIB_API __declspec(dllimport)
28 #endif
29 #else
30 
31 #ifndef MCLIENTLIB_EXPORTS
32 #ifdef LINUX
33 #define MCLIENTLIB_API
34 #else
35 #define MCLIENTLIB_API
36 #endif
37 #else
38 #define MCLIENTLIB_API
39 #endif
40 #endif
41 
42 #if defined(_WIN32)
43 #pragma warning(disable: 4251)
44 #endif // _WIN32
45 
46 #include <string>
47 #include <vector>
48 
49 namespace MClientLib {
50 
61  class MCLIENTLIB_API MTemplateVariable {
62  private:
63  int templateId;
64  std::string version;
65  std::string key;
66  std::string value;
67  public:
68 
70  MTemplateVariable(int _templateId,const std::string& version, const std::string& key, const std::string& value);
71 
72  int getTemplateId();
73  std::string getVersion();
74  std::string getKey();
75  std::string getValue();
76 
77  void setTemplateId(int);
78  void setVersion(const std::string&);
79  void setKey(const std::string&);
80  void setValue(const std::string&);
82  static std::vector<MTemplateVariable> Unmarshall(const std::string&);
83  static std::string Marshall(const std::vector<MTemplateVariable>& list);
85  };
86 
88 }
89 
90 #endif
Class holding an entry of a template variable.