Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / tao / AnyTypeCode / Marshal.h
blob6c6bee37e03fc98aa29eb38804f3d7ef341c8817
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file Marshal.h
7 * Classes that marshal various IDL data types.
9 * @author Aniruddha S. Gokhale
11 //=============================================================================
14 #ifndef TAO_MARSHAL_H
15 #define TAO_MARSHAL_H
17 #include /**/ "ace/pre.h"
19 #include "tao/Basic_Types.h"
21 #if !defined (ACE_LACKS_PRAGMA_ONCE)
22 # pragma once
23 #endif /* ACE_LACKS_PRAGMA_ONCE */
25 #include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h"
27 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
29 namespace CORBA
31 class TypeCode;
32 typedef TypeCode *TypeCode_ptr;
35 class TAO_OutputCDR;
36 class TAO_InputCDR;
38 // = Forward declarations.
39 class TAO_Marshal_Object;
40 class TAO_Marshal_Primitive;
41 class TAO_Marshal_Any;
42 class TAO_Marshal_TypeCode;
43 class TAO_Marshal_Principal;
44 class TAO_Marshal_ObjRef;
45 class TAO_Marshal_Struct;
46 class TAO_Marshal_Union;
47 class TAO_Marshal_String;
48 class TAO_Marshal_Sequence;
49 class TAO_Marshal_Array;
50 class TAO_Marshal_Alias;
51 class TAO_Marshal_Except;
52 class TAO_Marshal_WString;
53 class TAO_Marshal_Value;
55 namespace TAO
57 enum traverse_status
59 TRAVERSE_STOP,
60 TRAVERSE_CONTINUE
64 /**
65 * @class TAO_Marshal_Object
67 * @brief TAO_Marshal_Object
69 * The Marshaling object that provides a common interface to the
70 * CDR object for marshaling different IDL data types
71 * Provides a set of virtual methods for appending and skipping
72 * data over a CDR stream.
74 class TAO_AnyTypeCode_Export TAO_Marshal_Object
76 public:
77 /// constructor
78 TAO_Marshal_Object ();
80 /// destructor
81 virtual ~TAO_Marshal_Object ();
83 /// skip entry point, it allocates the right kind of Marshal_Object
84 /// and invokes skip on it.
85 static TAO::traverse_status perform_skip (CORBA::TypeCode_ptr tc,
86 TAO_InputCDR *context);
88 /// skip operation
89 virtual TAO::traverse_status skip (CORBA::TypeCode_ptr tc,
90 TAO_InputCDR *context) = 0;
92 /// append entry point, it allocates the right kind of Marshal_Object
93 /// and invokes skip on it.
94 static TAO::traverse_status perform_append (CORBA::TypeCode_ptr tc,
95 TAO_InputCDR *src,
96 TAO_OutputCDR *dest);
98 /// append operation
99 virtual TAO::traverse_status append (CORBA::TypeCode_ptr tc,
100 TAO_InputCDR *src,
101 TAO_OutputCDR *dest) = 0;
105 * @class TAO_Marshal_Primitive:
107 * @brief TAO_Marshal_Primitive
109 * marshaling primitives
111 class TAO_AnyTypeCode_Export TAO_Marshal_Primitive: public TAO_Marshal_Object
113 public:
114 TAO_Marshal_Primitive ();
116 /// skip operation
117 virtual TAO::traverse_status skip (CORBA::TypeCode_ptr tc,
118 TAO_InputCDR *context);
120 /// append operation
121 virtual TAO::traverse_status append (CORBA::TypeCode_ptr tc,
122 TAO_InputCDR *src,
123 TAO_OutputCDR *dest);
127 * @class TAO_Marshal_Any:
129 * @brief TAO_Marshal_Any
131 * Marshal an Any
133 class TAO_AnyTypeCode_Export TAO_Marshal_Any: public TAO_Marshal_Object
135 public:
136 TAO_Marshal_Any ();
138 /// skip operation
139 virtual TAO::traverse_status skip (CORBA::TypeCode_ptr tc,
140 TAO_InputCDR *context);
142 /// append operation
143 virtual TAO::traverse_status append (CORBA::TypeCode_ptr tc,
144 TAO_InputCDR *src,
145 TAO_OutputCDR *dest);
149 * @class TAO_Marshal_TypeCode
151 * @brief TAO_Marshal_TypeCode
153 * marshal a typecode
155 class TAO_AnyTypeCode_Export TAO_Marshal_TypeCode: public TAO_Marshal_Object
157 public:
158 TAO_Marshal_TypeCode ();
160 /// skip operation
161 virtual TAO::traverse_status skip (CORBA::TypeCode_ptr tc,
162 TAO_InputCDR *context);
164 /// append operation
165 virtual TAO::traverse_status append (CORBA::TypeCode_ptr tc,
166 TAO_InputCDR *src,
167 TAO_OutputCDR *dest);
171 * @class TAO_Marshal_Principal
173 * @brief TAO_Marshal_Principal
175 * marshal a principal
177 class TAO_AnyTypeCode_Export TAO_Marshal_Principal: public TAO_Marshal_Object
179 public:
180 TAO_Marshal_Principal ();
182 /// skip operation
183 virtual TAO::traverse_status skip (CORBA::TypeCode_ptr tc,
184 TAO_InputCDR *context);
186 /// append operation
187 virtual TAO::traverse_status append (CORBA::TypeCode_ptr tc,
188 TAO_InputCDR *src,
189 TAO_OutputCDR *dest);
193 * @class TAO_Marshal_ObjRef
195 * @brief TAO_Marshal_ObjRef
197 * marshal an object reference
199 class TAO_AnyTypeCode_Export TAO_Marshal_ObjRef: public TAO_Marshal_Object
201 public:
202 TAO_Marshal_ObjRef ();
204 /// skip operation
205 virtual TAO::traverse_status skip (CORBA::TypeCode_ptr tc,
206 TAO_InputCDR *context);
208 /// append operation
209 virtual TAO::traverse_status append (CORBA::TypeCode_ptr tc,
210 TAO_InputCDR *src,
211 TAO_OutputCDR *dest);
215 * @class TAO_Marshal_Struct
217 * @brief TAO_Marshal_Struct
219 * marshal a struct
221 class TAO_AnyTypeCode_Export TAO_Marshal_Struct : public TAO_Marshal_Object
223 public:
224 TAO_Marshal_Struct ();
226 /// skip operation
227 virtual TAO::traverse_status skip (CORBA::TypeCode_ptr tc,
228 TAO_InputCDR *context);
230 /// append operation
231 virtual TAO::traverse_status append (CORBA::TypeCode_ptr tc,
232 TAO_InputCDR *src,
233 TAO_OutputCDR *dest);
237 * @class TAO_Marshal_Union
239 * @brief TAO_Marshal_Union
241 * marshal a union
243 class TAO_AnyTypeCode_Export TAO_Marshal_Union: public TAO_Marshal_Object
245 public:
246 TAO_Marshal_Union ();
248 /// skip operation
249 virtual TAO::traverse_status skip (CORBA::TypeCode_ptr tc,
250 TAO_InputCDR *context);
252 /// append operation
253 virtual TAO::traverse_status append (CORBA::TypeCode_ptr tc,
254 TAO_InputCDR *src,
255 TAO_OutputCDR *dest);
259 * @class TAO_Marshal_String
261 * @brief TAO_Marshal_String
263 * marshal a string
265 class TAO_AnyTypeCode_Export TAO_Marshal_String: public TAO_Marshal_Object
267 public:
268 TAO_Marshal_String ();
270 /// skip operation
271 virtual TAO::traverse_status skip (CORBA::TypeCode_ptr tc,
272 TAO_InputCDR *context);
274 /// append operation
275 virtual TAO::traverse_status append (CORBA::TypeCode_ptr tc,
276 TAO_InputCDR *src,
277 TAO_OutputCDR *dest);
281 * @class TAO_Marshal_Sequence
283 * @brief TAO_Marshal_Sequence
285 * marshal a sequence
287 class TAO_AnyTypeCode_Export TAO_Marshal_Sequence: public TAO_Marshal_Object
289 public:
290 TAO_Marshal_Sequence ();
292 /// skip operation
293 virtual TAO::traverse_status skip (CORBA::TypeCode_ptr tc,
294 TAO_InputCDR *context);
296 /// append operation
297 virtual TAO::traverse_status append (CORBA::TypeCode_ptr tc,
298 TAO_InputCDR *src,
299 TAO_OutputCDR *dest);
303 * @class TAO_Marshal_Array
305 * @brief TAO_Marshal_Array
307 * marshal an array
309 class TAO_AnyTypeCode_Export TAO_Marshal_Array: public TAO_Marshal_Object
311 public:
312 TAO_Marshal_Array ();
314 /// skip operation
315 virtual TAO::traverse_status skip (CORBA::TypeCode_ptr tc,
316 TAO_InputCDR *context);
318 /// append operation
319 virtual TAO::traverse_status append (CORBA::TypeCode_ptr tc,
320 TAO_InputCDR *src,
321 TAO_OutputCDR *dest);
325 * @class TAO_Marshal_Alias
327 * @brief TAO_Marshal_Alias
329 * marshal an alias
331 class TAO_AnyTypeCode_Export TAO_Marshal_Alias: public TAO_Marshal_Object
333 public:
334 TAO_Marshal_Alias ();
336 /// skip operation
337 virtual TAO::traverse_status skip (CORBA::TypeCode_ptr tc,
338 TAO_InputCDR *context);
340 /// append operation
341 virtual TAO::traverse_status append (CORBA::TypeCode_ptr tc,
342 TAO_InputCDR *src,
343 TAO_OutputCDR *dest);
347 * @class TAO_Marshal_Except
349 * @brief TAO_Marshal_Except
351 * marshal an exception
353 class TAO_AnyTypeCode_Export TAO_Marshal_Except: public TAO_Marshal_Object
355 public:
356 TAO_Marshal_Except ();
358 /// skip operation
359 virtual TAO::traverse_status skip (CORBA::TypeCode_ptr tc,
360 TAO_InputCDR *context);
362 /// append operation
363 virtual TAO::traverse_status append (CORBA::TypeCode_ptr tc,
364 TAO_InputCDR *src,
365 TAO_OutputCDR *dest);
369 * @class TAO_Marshal_WString
371 * @brief TAO_Marshal_WString
373 * marshal a wide string
375 class TAO_AnyTypeCode_Export TAO_Marshal_WString : public TAO_Marshal_Object
377 public:
378 TAO_Marshal_WString ();
380 /// skip operation
381 virtual TAO::traverse_status skip (CORBA::TypeCode_ptr tc,
382 TAO_InputCDR *context);
384 /// append operation
385 virtual TAO::traverse_status append (CORBA::TypeCode_ptr tc,
386 TAO_InputCDR *src,
387 TAO_OutputCDR *dest);
391 * @class TAO_Marshal_Value
393 * @brief TAO_Marshal_Value
395 * marshal a valuetype
397 class TAO_AnyTypeCode_Export TAO_Marshal_Value: public TAO_Marshal_Object
399 public:
400 TAO_Marshal_Value ();
402 /// skip operation
403 virtual TAO::traverse_status skip (CORBA::TypeCode_ptr tc,
404 TAO_InputCDR *context);
406 /// append operation
407 virtual TAO::traverse_status append (CORBA::TypeCode_ptr tc,
408 TAO_InputCDR *src,
409 TAO_OutputCDR *dest);
411 private:
412 CORBA::Boolean nested_processing_;
415 TAO_END_VERSIONED_NAMESPACE_DECL
417 #if defined (__ACE_INLINE__)
418 # include "tao/AnyTypeCode/Marshal.inl"
419 #endif /* __ACE_INLINE__ */
421 #include /**/ "ace/post.h"
422 #endif /* TAO_MARSHAL_H */