@@ -63,54 +63,44 @@ class ACE_Export ACE_CDR
6363{
6464public:
6565 // = Constants defined by the CDR protocol.
66- // By defining as many of these constants as possible as enums we
67- // ensure they get inlined and avoid pointless static memory
68- // allocations.
6966
70- enum
71- {
72- // Note that some of these get reused as part of the standard
73- // binary format: unsigned is the same size as its signed cousin,
74- // float is LONG_SIZE, and double is LONGLONG_SIZE.
75-
76- OCTET_SIZE = 1 ,
77- SHORT_SIZE = 2 ,
78- LONG_SIZE = 4 ,
79- LONGLONG_SIZE = 8 ,
80- LONGDOUBLE_SIZE = 16 ,
81-
82- OCTET_ALIGN = 1 ,
83- SHORT_ALIGN = 2 ,
84- LONG_ALIGN = 4 ,
85- LONGLONG_ALIGN = 8 ,
86- // / @note the CORBA LongDouble alignment requirements do not
87- // / match its size...
88- LONGDOUBLE_ALIGN = 8 ,
89-
90- // / Maximal CDR 1.1 alignment: "quad precision" FP (i.e. "CDR::Long
91- // / double", size as above).
92- MAX_ALIGNMENT = 8 ,
93-
94- // / The default buffer size.
95- /* *
96- * @todo We want to add options to control this
97- * default value, so this constant should be read as the default
98- * default value ;-)
99- */
100- DEFAULT_BUFSIZE = ACE_DEFAULT_CDR_BUFSIZE,
101-
102- // / The buffer size grows exponentially until it reaches this size;
103- // / afterwards it grows linearly using the next constant
104- EXP_GROWTH_MAX = ACE_DEFAULT_CDR_EXP_GROWTH_MAX,
105-
106- // / Once exponential growth is ruled out the buffer size increases
107- // / in chunks of this size, note that this constants have the same
108- // / value right now, but it does not need to be so.
109- LINEAR_GROWTH_CHUNK = ACE_DEFAULT_CDR_LINEAR_GROWTH_CHUNK
110- };
67+ static constexpr size_t OCTET_SIZE = 1 ;
68+ static constexpr size_t SHORT_SIZE = 2 ;
69+ static constexpr size_t LONG_SIZE = 4 ;
70+ static constexpr size_t LONGLONG_SIZE = 8 ;
71+ static constexpr size_t LONGDOUBLE_SIZE = 16 ;
72+
73+ static constexpr size_t OCTET_ALIGN = 1 ;
74+ static constexpr size_t SHORT_ALIGN = 2 ;
75+ static constexpr size_t LONG_ALIGN = 4 ;
76+ static constexpr size_t LONGLONG_ALIGN = 8 ;
77+ // / @note the CORBA LongDouble alignment requirements do not
78+ // / match its size...
79+ static constexpr size_t LONGDOUBLE_ALIGN = 8 ;
80+
81+ // / Maximal CDR 1.1 alignment: "quad precision" FP (i.e. "CDR::Long
82+ // / double", size as above).
83+ static constexpr size_t MAX_ALIGNMENT = 8 ;
84+
85+ // / The default buffer size.
86+ /* *
87+ * @todo We want to add options to control this
88+ * default value, so this constant should be read as the default
89+ * default value ;-)
90+ */
91+ static constexpr size_t DEFAULT_BUFSIZE = ACE_DEFAULT_CDR_BUFSIZE;
92+
93+ // / The buffer size grows exponentially until it reaches this size;
94+ // / afterwards it grows linearly using the next constant
95+ static constexpr size_t EXP_GROWTH_MAX = ACE_DEFAULT_CDR_EXP_GROWTH_MAX;
96+
97+ // / Once exponential growth is ruled out the buffer size increases
98+ // / in chunks of this size, note that this constants have the same
99+ // / value right now, but it does not need to be so.
100+ static constexpr size_t LINEAR_GROWTH_CHUNK = ACE_DEFAULT_CDR_LINEAR_GROWTH_CHUNK;
111101
112102 /* *
113- * @enum Byte_Order
103+ * @class Byte_Order
114104 *
115105 * Defines values for the byte_order argument to ACE_OutputCDR and
116106 * ACE_InputCDR.
@@ -135,18 +125,10 @@ class ACE_Export ACE_CDR
135125 static void swap_4 (char const *orig, char *target);
136126 static void swap_8 (char const *orig, char *target);
137127 static void swap_16 (char const *orig, char *target);
138- static void swap_2_array (char const *orig,
139- char *target,
140- size_t length);
141- static void swap_4_array (char const *orig,
142- char *target,
143- size_t length);
144- static void swap_8_array (char const *orig,
145- char *target,
146- size_t length);
147- static void swap_16_array (char const *orig,
148- char *target,
149- size_t length);
128+ static void swap_2_array (char const *orig, char *target, size_t length);
129+ static void swap_4_array (char const *orig, char *target, size_t length);
130+ static void swap_8_array (char const *orig, char *target, size_t length);
131+ static void swap_16_array (char const *orig, char *target, size_t length);
150132
151133 // / Align the message block to ACE_CDR::MAX_ALIGNMENT,
152134 // / set by the CORBA spec at 8 bytes.
@@ -184,11 +166,9 @@ class ACE_Export ACE_CDR
184166 * @retval -1 Failure
185167 * @retval 0 Success.
186168 */
187- static int consolidate (ACE_Message_Block *dst,
188- const ACE_Message_Block *src);
169+ static int consolidate (ACE_Message_Block *dst, const ACE_Message_Block *src);
189170
190- static size_t total_length (const ACE_Message_Block *begin,
191- const ACE_Message_Block *end);
171+ static size_t total_length (const ACE_Message_Block *begin, const ACE_Message_Block *end);
192172
193173 /* *
194174 * @name Basic OMG IDL Types
0 commit comments