FARGOS/VISTA Object Management Environment Core  ..
FARGOS/VISTA Object Management Environment Core Table of Contents
OMEtype.h
Go to the documentation of this file.
1 #ifndef _OME_TYPE_H
2 # define _OME_TYPE_H "$Id: OMEtype.h 312 2020-03-21 21:25:35Z geoff $"
3 
11 # include <OMEmanifests.h>
12 # include <OMEarray.h>
13 # include <OMEassoc.h>
14 # include <OMEoid.h>
15 # include <OMEset.h>
16 # include <OMEstring.h>
17 # include <OMEfixed.h>
18 # include <OMEnlm.h>
19 
20 /*
21 #define OME_NIL 0
22 #define OME_INT 1
23 #define OME_INT32 1
24 #define OME_INT64 2
25 #define OME_FLOAT 3
26 #define OME_DOUBLE 4
27 #define OME_OID 5
28 #define OME_STRING 6
29 #define OME_ARRAY 7
30 #define OME_ASSOC 8
31 // 9 NOT YET USED
32 #define OME_SET 10
33 #define OME_NLM 11
34 #define OME_FIXED 12
35 #define OME_POINTER 13
36 #define OME_ANY 14
37 */
38 
39 # define OME_SIMPLE_TYPE 1
40 # define OME_EXTENDED_TYPE 2
41 # define OME_REFERENCE_TYPE 3
42 
43 
46  uint8_t typeClass;
47  uint8_t basicType; // int, float
48  char typeName[17];
49  char enumName[12];
50 };
51 
52 extern const _OMEtypeDescription _OMEtypeTable[]; // hidden type table
53 
54 #define OMEtypeClass(t) (_OMEtypeTable[(t) & 0x1f].typeClass)
55 #define OMEfundamentalType(t) (_OMEtypeTable[(t) & 0x1f].basicType)
56 
57 typedef class OMEbaseType *OMEbaseTypeP;
58 typedef const class OMEbaseType &READ_ONLY_OMEtype;
59 
60 
61 
62 #include <OMEbaseType.h>
63 
64 #include <OMEoutputOnStream.h>
65 
66 # if 0
67 // simple chained operators...
68 # include <OMEtypeHdr3.genh>
69 # include <OMEtypeHdr4.genh>
70 
71 uint32_t operator+(const uint32_t, const OMEbaseType &);
72 uint32_t operator+(const float, const OMEbaseType &);
73 uint32_t operator+(const OMEbaseType &, const uint32_t);
74 uint32_t operator-(const uint32_t, const OMEbaseType &);
75 uint32_t operator-(const float, const OMEbaseType &);
76 uint32_t operator-(const OMEbaseType &, const uint32_t);
77 uint32_t operator*(const uint32_t, const OMEbaseType &);
78 uint32_t operator*(const float, const OMEbaseType &);
79 uint32_t operator*(const OMEbaseType &, const uint32_t);
80 uint32_t operator/(const uint32_t, const OMEbaseType &);
81 uint32_t operator/(const float, const OMEbaseType &);
82 uint32_t operator/(const OMEbaseType &, const uint32_t);
83 
84 uint32_t operator%(const OMEbaseType &, const uint32_t);
85 
86 uint32_t operator&(const uint32_t, const OMEbaseType &);
87 uint32_t operator&(const OMEbaseType &, const uint32_t);
88 uint32_t operator|(const uint32_t, const OMEbaseType &);
89 uint32_t operator|(const OMEbaseType &, const uint32_t);
90 uint32_t operator^(const uint32_t, const OMEbaseType &);
91 uint32_t operator^(const OMEbaseType &, const uint32_t);
92 
93 
94 bool operator==(const int32_t, const OMEbaseType &);
95 bool operator==(const uint32_t, const OMEbaseType &);
96 bool operator!=(const int32_t, const OMEbaseType &);
97 bool operator!=(const uint32_t, const OMEbaseType &);
98 bool operator<=(const int32_t, const OMEbaseType &);
99 bool operator<=(const uint32_t, const OMEbaseType &);
100 bool operator>=(const int32_t, const OMEbaseType &);
101 bool operator>=(const uint32_t, const OMEbaseType &);
102 bool operator<(const int32_t, const OMEbaseType &);
103 bool operator<(const uint32_t, const OMEbaseType &);
104 bool operator>(const int32_t, const OMEbaseType &);
105 bool operator>(const uint32_t, const OMEbaseType &);
106 # endif
107 
108 
109 OME_FAST_CALL int stringToArrayOfTokens(OMEtype &result, const OMEstring &source,
110  const char *delimeterList = nullptr, const int convertFlag = 0);
111 
113  const char *source, const int srcLen,
114  const char *delimeterList = nullptr, const int convertFlag = 0,
115  const int charSet = OME_CHARSET_UNDEFINED);
116 
117 OME_FAST_CALL void OMEconvertString(OMEtype &result, OMEstring *source,
118  const uint_fast16_t forceBase = 10,
119  const bool discard = false);
120 
121 # define OME_FLAG_SORT_ASCENDING 0
122 # define OME_FLAG_SORT_DESCENDING 1
123 # define OME_FLAG_SORT_BY_KEY 2
124 # define OME_FLAG_SORT_CASE_INSENSITIVE 4
125 
126 OME_FAST_CALL int subscriptsInOrder(OMEtype &result, const OMEtype &list, uint_fast8_t descending = OME_FLAG_SORT_ASCENDING);
127 
128 
129 extern int OMEabortOnError;
130 
134 #endif
135 
136 /* vim: set expandtab shiftwidth=4 tabstop=4: */
OME_FLAG_SORT_ASCENDING
#define OME_FLAG_SORT_ASCENDING
Sort ascending.
Definition: OMEtype.h:121
OMEbaseType.h
OME fundamental data type implementation.
_OMEtypeDescription::typeName
char typeName[17]
Definition: OMEtype.h:48
POWER_OF_2_TYPE_TABLE_SIZE
#define POWER_OF_2_TYPE_TABLE_SIZE
Definition: OMEtype.cpp:38
OME_NLM
@ OME_NLM
Definition: OMEmanifests.h:90
operator!=
bool operator!=(const OMEtype &lArg, const OMEtype &rArg)
Definition: OMEtype_operators.cpp:5508
OMEconvertRFC1123date
int OMEconvertRFC1123date(OMEtype &result, const OMEtype &timeString)
Convert a text string in RFC 1123 format into an OME absolute time reference.
Definition: OMEtime.cpp:342
OME_FLOAT
@ OME_FLOAT
Definition: OMEmanifests.h:82
OMEtype::initializeAsType
void initializeAsType(const enum OMEtypes_t t)
The fundamental tagged data type used through the FARGOS/VISTA infrastructure.
Definition: OMEtype.cpp:95
OMEoutputOnStream.h
OME stream output functions.
_OMEtypeDescription::typeClass
uint8_t typeClass
Definition: OMEtype.h:46
OME_POINTER
@ OME_POINTER
Definition: OMEmanifests.h:92
EXTENDED_IF_32BIT
#define EXTENDED_IF_32BIT
Definition: OMEtype.cpp:41
operator/
OMEtype operator/(const OMEtype &lArg, const OMEtype &rArg)
Definition: OMEtype_operators.cpp:40694
OMEoid.h
OME object identifier implementation.
OME_UINT16
@ OME_UINT16
Definition: OMEmanifests.h:98
OMEstring.h
OME string implementation.
_OME_MANIFESTS_H
#define _OME_MANIFESTS_H
Definition: tmp.o.cpp:968
OMEassoc
Implements associative array of OMEtype elements.
Definition: OMEassoc.h:112
OMEstring
Implements text and binary string storage.
Definition: OMEstring.h:305
OME_REFERENCE_TYPE
#define OME_REFERENCE_TYPE
A complex, reference counted type.
Definition: OMEtype.h:41
OMEtype::value
union OMEtype::@26 value
OMEtype
Fundamental ANY type for FARGOS/VISTA Object Management Environment.
Definition: OMEbaseType.h:250
OME_DOUBLE
@ OME_DOUBLE
Definition: OMEmanifests.h:83
operator<
bool operator<(const OMEtype &lArg, const OMEtype &rArg)
Definition: OMEtype_operators.cpp:10983
_OMEtypeDescription::enumName
char enumName[12]
Definition: OMEtype.h:49
OME_UINT32
@ OME_UINT32
Definition: OMEmanifests.h:96
OMEtype::s
class OMEstring * s
Definition: OMEbaseType.h:299
OMEtypeClass
#define OMEtypeClass(t)
Definition: OMEtype.h:54
OME_EXTENDED_TYPE
#define OME_EXTENDED_TYPE
An extended native type.
Definition: OMEtype.h:40
OMEnlm.h
OME native language message implementation.
OMEset.h
OME set implementation.
OMEfixed.h
OME fixed point number implementation.
operator|
OMEtype operator|(const OMEtype &lArg, const OMEtype &rArg)
Definition: OMEtype_operators.cpp:43769
OME_SIMPLE_TYPE
#define OME_SIMPLE_TYPE
A simple native type.
Definition: OMEtype.h:39
operator&
OMEtype operator&(const OMEtype &lArg, const OMEtype &rArg)
Definition: OMEtype_operators.cpp:42937
OMEiso8601Date
int OMEiso8601Date(OMEtype &result, const OMEtype &argData)
Format an OME absolute time reference as a date and time in ISO 8601 format.
Definition: OMEtime.cpp:273
_OMEtypeTable
const _OMEtypeDescription _OMEtypeTable[POWER_OF_2_TYPE_TABLE_SIZE]
Definition: OMEtype.cpp:48
makeUnique
int makeUnique(OMEthread *thread, OMEtype &result, const OMEtype &arg)
Definition: OILdebug.cpp:357
OMEnlm
Public interface to an OME Native Language Message.
Definition: OMEnlm.h:98
srcID
const char srcID[]
Definition: catSym.c:17
OME_STRING
@ OME_STRING
Definition: OMEmanifests.h:85
_OMEtypeDescription
Internal structure to describe OME fundamental types.
Definition: OMEtype.h:45
OME_INT
@ OME_INT
Definition: OMEmanifests.h:80
OMEconvertLocalRelativeTimeToAbsolute
int OMEconvertLocalRelativeTimeToAbsolute(OMEtype &result, uint32_t tArg, int asGMT)
Convert a local relative time to an OME absolute time reference.
Definition: OMEtime.cpp:89
OMEset
Implements an ordered list of OMEtype elements.
Definition: OMEset.h:64
_OME_TYPE_H
#define _OME_TYPE_H
Definition: OMEtype.h:2
OME_NIL
@ OME_NIL
Definition: OMEmanifests.h:78
stringToArrayOfTokens
OME_FAST_CALL int stringToArrayOfTokens(OMEtype &result, const OMEstring &source, const char *delimeterList=nullptr, const int convertFlag=0)
Tokenizes a string and saves the parsed tokens as individual elements of an array.
Definition: utils.cpp:139
OME_OID
@ OME_OID
Definition: OMEmanifests.h:84
OMEtypes_t
OMEtypes_t
Definition: OMEmanifests.h:77
OME_UINT64
@ OME_UINT64
Definition: OMEmanifests.h:97
OMEassoc.h
OME associative array implementation.
OMEtype.h
OME fundamental type implementation.
OMEconvertAbsoluteToLocalRelativeTime
uint32_t OMEconvertAbsoluteToLocalRelativeTime(const OMEtype &tData)
Convert an OME absolute time reference to a local relative time.
Definition: OMEtime.cpp:152
OMEconvertString
OME_FAST_CALL void OMEconvertString(OMEtype &result, OMEstring *source, const uint_fast16_t forceBase=10, const bool discard=false)
Converts text strings into numeric values.
Definition: utils.cpp:24
OME_USED
const char srcID[] OME_USED
Definition: tick_time.cpp:24
TIMEZONE_NAME
#define TIMEZONE_NAME(ptr)
Definition: OMEtime.cpp:25
operator+
OMEtype operator+(const OMEtype &lArg, const OMEtype &rArg)
Definition: OMEtype_operators.cpp:33691
operator-
OMEtype operator-(const OMEtype &lArg, const OMEtype &rArg)
Definition: OMEtype_operators.cpp:36699
subscriptsInOrder
OME_FAST_CALL int subscriptsInOrder(OMEtype &result, const OMEtype &list, uint_fast8_t descending=OME_FLAG_SORT_ASCENDING)
Examines an array (either sparse or associative) and returns a list of subscripts that allow the elem...
Definition: utils.cpp:333
OME_SET
@ OME_SET
Definition: OMEmanifests.h:89
operator<=
bool operator<=(const OMEtype &lArg, const OMEtype &rArg)
Definition: OMEtype_operators.cpp:13657
OMEmanifests.h
OME constants and typedefs.
OMEfixed
Public interface to OME fixed-point type.
Definition: OMEfixed.h:85
OMEbaseTypeP
class OMEtype * OMEbaseTypeP
Definition: OMEtype.h:57
OME_UINT8
@ OME_UINT8
Definition: OMEmanifests.h:99
OME_FAST_CALL
#define OME_FAST_CALL
Definition: compiler_hints.h:468
OMEarray.h
OME sparse array implementation.
OME_FIXED
@ OME_FIXED
Definition: OMEmanifests.h:91
OMErfc1123Date
int OMErfc1123Date(OMEtype &result, const OMEtype &argData)
Format an OME absolute time reference as a data and time in RFC 1123 format.
Definition: OMEtime.cpp:218
OMEarray
Implements sparse array of OMEtype elements.
Definition: OMEarray.h:75
OMEoid
Public interface to an OME Object Identifier.
Definition: OMEoid.h:196
OME_ANY
@ OME_ANY
Definition: OMEmanifests.h:93
operator*
OMEtype operator*(const OMEtype &lArg, const OMEtype &rArg)
Definition: OMEtype_operators.cpp:39283
OMEtype::type
uint32_t type
Definition: OMEbaseType.h:304
operator>=
bool operator>=(const OMEtype &lArg, const OMEtype &rArg)
Definition: OMEtype_operators.cpp:19005
READ_ONLY_OMEtype
const class OMEtype & READ_ONLY_OMEtype
A convenience typedef for performing read-only access to sparse and associative arrays....
Definition: OMEtype.h:58
_OMEtypeDescription::basicType
uint8_t basicType
Definition: OMEtype.h:47
LOCALtime
#define LOCALtime(arg)
Definition: OMEtime.cpp:15
OMEtimeDifference
int OMEtimeDifference(const OMEtype &time1, const OMEtype &time2)
Compute difference between two OME absolute time references.
Definition: OMEtime.cpp:529
OMEextendedType
Storage record for large-sized elements on 32-bit hardware.
Definition: OMEbaseType.h:28
OME_ARRAY
@ OME_ARRAY
Definition: OMEmanifests.h:86
GMT_OFFSET
#define GMT_OFFSET(ptr)
Definition: OMEtime.cpp:24
operator>
bool operator>(const OMEtype &lArg, const OMEtype &rArg)
Definition: OMEtype_operators.cpp:16331
OMEtype::assoc
class OMEassoc * assoc
Definition: OMEbaseType.h:296
OME_CHARSET_UNDEFINED
@ OME_CHARSET_UNDEFINED
Definition: OMEstring.h:24
OMEbadTypeOp
void OMEbadTypeOp()
Definition: OMEtype.cpp:31
operator%
OMEtype operator%(const OMEtype &lArg, const OMEtype &rArg)
Definition: OMEtype_operators.cpp:42105
operator^
OMEtype operator^(const OMEtype &lArg, const OMEtype &rArg)
Definition: OMEtype_operators.cpp:44601
OMEabortOnError
int OMEabortOnError
If non-zero, abort() called on type error.
Definition: OMEtype_operators.cpp:9
OME_ASSOC
@ OME_ASSOC
Definition: OMEmanifests.h:87
operator==
bool operator==(const OMEtype &lArg, const OMEtype &rArg)
Definition: OMEtype_operators.cpp:33
OME_INT32
@ OME_INT32
Definition: OMEmanifests.h:79
OME_INT64
@ OME_INT64
Definition: OMEmanifests.h:81
Generated: Fri Jul 31 2020 18:19:15
Support Information