pvAccessCPP  7.1.2
pvaVersion.h
1 /**
2  * Copyright - See the COPYRIGHT that is included with this distribution.
3  * pvAccessCPP is distributed subject to a Software License Agreement found
4  * in file LICENSE that is included with this distribution.
5  */
6 
7 #ifndef VERSION_H_
8 #define VERSION_H_
9 
10 #ifdef epicsExportSharedSymbols
11 # define pvaVersionEpicsExportSharedSymbols
12 # undef epicsExportSharedSymbols
13 #endif
14 
15 #include <pv/pvType.h>
16 #include <pv/noDefaultMethods.h>
17 
18 #ifdef pvaVersionEpicsExportSharedSymbols
19 # define epicsExportSharedSymbols
20 # undef pvaVersionEpicsExportSharedSymbols
21 #endif
22 
23 #include <shareLib.h>
24 
25 #include "pv/pvaVersionNum.h"
26 
27 #ifndef VERSION_INT
28 # define VERSION_INT(V,R,M,P) ( ((V)<<24) | ((R)<<16) | ((M)<<8) | (P))
29 #endif
30 
31 #define PVACCESS_VERSION_INT VERSION_INT(EPICS_PVA_MAJOR_VERSION, EPICS_PVA_MINOR_VERSION, EPICS_PVA_MAINTENANCE_VERSION, 0)
32 
33 namespace epics {
34 namespace pvAccess {
35 
36 class epicsShareClass Version {
37  EPICS_NOT_COPYABLE(Version)
38 public:
39  /**
40  * Default constructor.
41  * @param productName product name.
42  * @param implementationLangugage implementation language.
43  * @param majorVersion major version.
44  * @param minorVersion minor version.
45  * @param maintenanceVersion maintenance version.
46  * @param developmentFlag development indicator flag.
47  */
48  Version(std::string const & productName,
49  std::string const & implementationLangugage,
50  int majorVersion, int minorVersion,
51  int maintenanceVersion, bool developmentFlag);
52 
53  /** The name of the product */
54  const std::string getProductName() const;
55 
56  /** Implementation Language: C++
57  */
58  const std::string getImplementationLanguage() const;
59 
60  /**
61  * Major version number. This changes only when there is a
62  * significant, externally apparent enhancement from the previous release.
63  * 'n' represents the n'th version.
64  *
65  * Clients should carefully consider the implications of new versions as
66  * external interfaces and behaviour may have changed.
67  */
68  int getMajorVersion() const;
69 
70  /**
71  * Minor version number. This changes when:
72  * <ul>
73  * <li>a new set of functionality is to be added</li>
74  * <li>API or behaviour change</li>
75  * <li>its designated as a reference release</li>
76  * </ul>
77  */
78  int getMinorVersion() const;
79 
80  /**
81  * Maintenance version number. Optional identifier used to designate
82  * maintenance drop applied to a specific release and contains fixes for
83  * defects reported. It maintains compatibility with the release and
84  * contains no API changes. When missing, it designates the final and
85  * complete development drop for a release.
86  */
87  int getMaintenanceVersion() const;
88 
89  /**
90  * Development flag.
91  *
92  * Development drops are works in progress towards a completed, final
93  * release. A specific development drop may not completely implement all
94  * aspects of a new feature, which may take several development drops to
95  * complete. At the point of the final drop for the release, the -SNAPSHOT suffix
96  * will be omitted.
97  */
98  bool isDevelopmentVersion() const;
99 
100  /**
101  * Get the long version string.
102  * @return std::string denoting current version
103  */
104  const std::string getLongVersionString() const;
105 
106  /**
107  * Get the basic version string.
108  * @return std::string denoting current version
109  */
110  const std::string getVersionString() const;
111 
112 private:
113  std::string _productName;
114  std::string _implementationLanguage;
115  int _majorVersion;
116  int _minorVersion;
117  int _maintenanceVersion;
118  bool _developmentFlag;
119 };
120 
121 epicsShareFunc std::ostream& operator<<(std::ostream& o, const Version& v);
122 }
123 }
124 
125 #endif /* VERSION_H_ */
Copyright - See the COPYRIGHT that is included with this distribution.
#define VERSION_INT(V, R, M, P)
Copyright - See the COPYRIGHT that is included with this distribution.
Definition: pvaVersion.h:28