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 virtual int put_longdouble( long double ) = 0;
44#endif
45 virtual int put_int ( int ) = 0;
46 virtual int put_long ( long ) = 0;
47 virtual int put_long_long( long long ) = 0;
48 virtual int put_short ( short ) = 0;
49 virtual int put_uchar ( unsigned char ) = 0;
50 virtual int put_unsigned( unsigned ) = 0;
51 virtual int put_ulong ( unsigned long ) = 0;
52 virtual int put_ushort ( unsigned short ) = 0;
53 virtual int put_unsignedint( unsigned int ) = 0;
54 virtual int put_unsignedlong( unsigned long ) = 0;
55 virtual int put_unsignedlonglong( unsigned long long ) = 0;
56 virtual int put_unsignedshort( unsigned short ) = 0;
57 virtual int put_unsignedchar( unsigned char ) = 0;
58
59 // a nul-terminated string
60 virtual int put_string( const char * ) = 0;
61
62 // zero or more raw bytes
63 virtual int put_opaque( int, const char * ) = 0;
64
65 // an enumerated value
66 virtual int put_enum( int value,
67 int numChoices,
68 const RTFieldDescriptor * choices ) = 0;
69
70 // a homogeneous array of objects
71 virtual int put_array( const void * array_base,
72 int numElements,
73 const RTObject_class * elementType ) = 0;
74
75 // an indirect object
76 virtual int put_indirect( const void * pointer,
77 const RTObject_class * targetType ) = 0;
78
79 // a structure
80 virtual int put_struct( const void * record,
81 const RTObject_class * recordType ) = 0;
82
83 // Utility for writing an arbitrary string into the encoding. Useful when implementing custom encode functions.
84 // Default implementation does nothing.
85 virtual int write_string( const char* );
86
87private:
88 // unavailable methods
89 RTEncoding( const RTEncoding & );
90 RTEncoding & operator=( const RTEncoding & );
91};
92#endif // OBJECT_ENCODE
93
94#endif // __RTEncoding_h__
Definition: RTEncoding.h:27
Definition: RTFieldDescriptor.h:40
A type descriptor providing information about a type.
Definition: RTObject_class.h:64