XBinder  Version 2.6.x
rtxGenValueType.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016-2016 by Objective Systems, Inc.
3  *
4  * This software is furnished under a license and may be used and copied
5  * only in accordance with the terms of such license and with the
6  * inclusion of the above copyright notice. This software or any other
7  * copies thereof may not be provided or otherwise made available to any
8  * other person. No title to and ownership of the software is hereby
9  * transferred.
10  *
11  * The information in this software is subject to change without notice
12  * and should not be construed as a commitment by Objective Systems, Inc.
13  *
14  * PROPRIETARY NOTICE
15  *
16  * This software is an unpublished work subject to a confidentiality agreement
17  * and is protected by copyright and trade secret law. Unauthorized copying,
18  * redistribution or other use of this work is prohibited.
19  *
20  * The above notice of copyright on this source code product does not indicate
21  * any actual or intended publication of such source code.
22  *
23  *****************************************************************************/
29 #ifndef _RTXGENVALUETYPE_H_
30 #define _RTXGENVALUETYPE_H_
31 
32 #include "rtxsrc/rtxContext.h"
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
38 /* Generic data value type */
39 typedef enum {
40  OSRTDataType_UnsignedInt,
41  OSRTDataType_SignedInt,
42  OSRTDataType_ByteArray,
43  OSRTDataType_CharStr,
44  OSRTDataType_Array,
45  OSRTDataType_Map,
46  OSRTDataType_Bool,
47  OSRTDataType_Float
48 } OSRTDataType;
49 
50 typedef struct _OSRTGenPtrArray {
51  OSSIZE nitems;
52  struct _OSRTGenValue** values;
53 } OSRTGenPtrArray;
54 
55 typedef struct _OSRTGenKeyValuePair {
56  struct _OSRTGenValue* key;
57  struct _OSRTGenValue* value;
58 } OSRTGenKeyValuePair;
59 
60 typedef struct _OSRTGenValueMap {
61  OSSIZE nitems;
62  OSRTGenKeyValuePair* values;
63 } OSRTGenValueMap;
64 
65 typedef struct _OSRTGenValue {
66  OSRTDataType t;
67  union {
68  /* Unsigned and signed integer values */
69 #ifndef _NO_INT64_SUPPORT
70  OSUINT64 uintval;
71  OSINT64 intval;
72 #else
73  OSUINT32 uintval;
74  OSINT32 intval;
75 #endif
76  /* Byte string value */
77  OSDynOctStr64 bytestr;
78 
79  /* UTF-8 string value */
80  const char* utf8str;
81 
82  /* Array */
83  OSRTGenPtrArray array;
84 
85  /* Map */
86  OSRTGenValueMap map;
87 
88  /* Boolean */
89  OSBOOL boolval;
90 
91  /* Floating point */
92  OSDOUBLE fltval;
93  } u;
94 } OSRTGenValue;
95 
108 EXTERNRT int rtxGenValueCompare
109 (OSCTXT* pctxt, const OSRTGenValue* pvalue1, const OSRTGenValue* pvalue2);
110 
118 EXTERNRT const char* rtxGenValueGetIdent (OSRTDataType id);
119 
120 #ifdef __cplusplus
121 }
122 #endif
123 
124 #endif
EXTERNRT int rtxGenValueCompare(OSCTXT *pctxt, const OSRTGenValue *pvalue1, const OSRTGenValue *pvalue2)
This function compares two generic values for equality.
EXTERNRT const char * rtxGenValueGetIdent(OSRTDataType id)
This function returns a textual identifier for the given enumerated value type.
Common run-time context definitions.
Run-time context structure.
Definition: rtxContext.h:185