2 * Header File for Tracking IDL Versions
4 * Source File Counterpart is util/idl_version.cpp.
7 #ifndef IDL_VERSION_HEADER
8 #define IDL_VERSION_HEADER
10 #include "TAO_IDL_FE_Export.h"
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
20 enum SpecificIdlVersion
22 /// Invalid Version Value
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
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.
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.
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
;
56 * Class Operations involving SpecificIdlVersion Values
58 class TAO_IDL_FE_Export IdlVersion
62 * New IdlVersion set to DEFAULT_DEFAULT_IDL_VERSION.
67 * New IdlVersion set from a SpecificIdlVersion if version is valid,
68 * otherwise IDL_VERSION_INVALID.
70 IdlVersion (SpecificIdlVersion version
);
73 * Get version as a SpecificIdlVersion.
75 SpecificIdlVersion
version () const;
77 * Set version from a SpecificIdlVersion if version is valid, otherwise
78 * IDL_VERSION_INVALID.
80 void version (SpecificIdlVersion version
);
85 bool is_valid () const;
88 * Get version as string.
90 const char * to_string () const;
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
);
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
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;
116 SpecificIdlVersion version_
;