C++ TargetRTS
Loading...
Searching...
No Matches
RTEncoding.h
1/*
2 * Licensed Materials - Property of HCL and/or IBM
3 * Copyright HCL Technologies Ltd. 2016, 2021. All Rights Reserved.
4 * Copyright IBM Corporation 1999, 2016. All Rights Reserved.
5 *
6 * U.S. Government Users Restricted Rights - Use, duplication or
7 * disclosure restricted by GSA ADP Schedule.
8 */
9
10#ifndef __RTEncoding_h__
11#define __RTEncoding_h__ included
12
13#ifdef PRAGMA
14#pragma interface
15#endif
16
17#ifndef __RTConfig_h__
18#include <RTConfig.h>
19#endif
20
21#if OBJECT_ENCODE
22
24struct RTObject_class;
25
27{
28public:
29 RTEncoding( void );
30 virtual ~RTEncoding( void );
31
32 virtual int flush( void ) = 0;
33
34 virtual int put( const void *, const RTObject_class * ) = 0;
35
36 // basic data types
37 virtual int put_address ( const void * ) = 0;
38 virtual int put_bool ( bool ) = 0;
39 virtual int put_char ( char ) = 0;
40#if RTUseFloatingPoint
41 virtual int put_double ( double ) = 0;
42 virtual int put_float ( float ) = 0;
43#endif
44 virtual int put_int ( int ) = 0;
45 virtual int put_long ( long ) = 0;
46 virtual int put_long_long( long long ) = 0;
47 virtual int put_short ( short ) = 0;
48 virtual int put_uchar ( unsigned char ) = 0;
49 virtual int put_unsigned( unsigned ) = 0;
50 virtual int put_ulong ( unsigned long ) = 0;
51 virtual int put_ushort ( unsigned short ) = 0;
52 virtual int put_unsignedint( unsigned int ) = 0;
53 virtual int put_unsignedlong( unsigned long ) = 0;
54 virtual int put_unsignedlonglong( unsigned long long ) = 0;
55 virtual int put_unsignedshort( unsigned short ) = 0;
56 virtual int put_unsignedchar( unsigned char ) = 0;
57
58 // a nul-terminated string
59 virtual int put_string( const char * ) = 0;
60
61 // zero or more raw bytes
62 virtual int put_opaque( int, const char * ) = 0;
63
64 // an enumerated value
65 virtual int put_enum( int value,
66 int numChoices,
67 const RTFieldDescriptor * choices ) = 0;
68
69 // a homogeneous array of objects
70 virtual int put_array( const void * array_base,
71 int numElements,
72 const RTObject_class * elementType ) = 0;
73
74 // an indirect object
75 virtual int put_indirect( const void * pointer,
76 const RTObject_class * targetType ) = 0;
77
78 // a structure
79 virtual int put_struct( const void * record,
80 const RTObject_class * recordType ) = 0;
81
82 // Utility for writing an arbitrary string into the encoding. Useful when implementing custom encode functions.
83 // Default implementation does nothing.
84 virtual int write_string( const char* );
85
86private:
87 // unavailable methods
88 RTEncoding( const RTEncoding & );
89 RTEncoding & operator=( const RTEncoding & );
90};
91#endif // OBJECT_ENCODE
92
93#endif // __RTEncoding_h__
Definition: RTEncoding.h:27
Definition: RTFieldDescriptor.h:40
A type descriptor providing information about a type.
Definition: RTObject_class.h:64