Use =default for skeleton copy constructor
[ACE_TAO.git] / TAO / TAO_IDL / include / idl_version.h
blob3d47ec5cfe2deedef6feb1a43cae6fb146dfd40e
1 /**
2 * Header File for Tracking IDL Versions
4 * Source File Counterpart is util/idl_version.cpp.
5 */
7 #ifndef IDL_VERSION_HEADER
8 #define IDL_VERSION_HEADER
10 #include "TAO_IDL_FE_Export.h"
12 /**
13 * List of Specific Idl Versions
15 * Order is used to determine how versions compare to each other.
17 * NOTE: If updated, idlVersionNames in util/idl_version.cpp must be updated
18 * as well!
20 enum SpecificIdlVersion
22 /// Invalid Version Value
23 IDL_VERSION_INVALID,
25 /**
26 * IDL 3.x
27 * tao_idl dialect of IDL defined in OMG CORBA and IDL 3.5 specs.
28 * This is the version of IDL supported by the compiler as is without IDL
29 * version checks.
31 IDL_VERSION_3,
33 /**
34 * IDL 4.x
35 * tao_idl dialect of IDL as defined in OMG 2016-04-02 (http://www.omg.org/spec/IDL/4.0/)
36 * and later revisions.
38 IDL_VERSION_4,
40 /**
41 * SHOULD ALWAYS BE LAST, DO NOT PUT ANY VERSIONS PAST THIS!
43 * Attempting to pass this to IdlVersion will result in an invalid value.
45 IDL_VERSION_COUNT
48 /**
49 * Default version of IDL to use if BE does not specify a default version.
50 * This is so that BE can control the version without overriding idl_version_
51 * directly and making --default-idl-version incorrect.
53 const SpecificIdlVersion DEFAULT_DEFAULT_IDL_VERSION = IDL_VERSION_3;
55 /**
56 * Class Operations involving SpecificIdlVersion Values
58 class TAO_IDL_FE_Export IdlVersion
60 public:
61 /**
62 * New IdlVersion set to DEFAULT_DEFAULT_IDL_VERSION.
64 IdlVersion ();
66 /**
67 * New IdlVersion set from a SpecificIdlVersion if version is valid,
68 * otherwise IDL_VERSION_INVALID.
70 IdlVersion (SpecificIdlVersion version);
72 /**
73 * Get version as a SpecificIdlVersion.
75 SpecificIdlVersion version () const;
76 /**
77 * Set version from a SpecificIdlVersion if version is valid, otherwise
78 * IDL_VERSION_INVALID.
80 void version (SpecificIdlVersion version);
82 /**
83 * Is Version Valid?
85 bool is_valid () const;
87 /**
88 * Get version as string.
90 const char * to_string () const;
91 /**
92 * Set version from string, sets versions as invalid if it does not match
93 * any strings in idlVersionNames.
95 void from_string (const char * version);
97 /**
98 * Get the value for the __TAO_IDL_IDL_VERSION preprocessor macro.
100 const char * to_macro () const;
103 * Compare a IdlVersion to a SpecificIdlVersion or another IdlVersion
105 ///{
106 operator SpecificIdlVersion () const;
107 bool operator== (SpecificIdlVersion other) const;
108 bool operator!= (SpecificIdlVersion other) const;
109 bool operator> (SpecificIdlVersion other) const;
110 bool operator>= (SpecificIdlVersion other) const;
111 bool operator< (SpecificIdlVersion other) const;
112 bool operator<= (SpecificIdlVersion other) const;
113 ///}
115 private:
116 SpecificIdlVersion version_;
119 #endif