Go to the documentation of this file.
2 #define _OME_ASSOC_H "$Id: OMEassoc.h 312 2020-03-21 21:25:35Z geoff $"
43 template <
typename STREAMTYPE>
107 template <
typename STREAMTYPE>
142 if (this->data == arg.
data) {
156 if (data == arg.
data) {
160 return (*data == *arg.
data);
165 if (data == arg.
data) {
169 return (*data != *arg.
data);
188 return ((*data)[key]);
200 return (data->getKeyForIndex(i));
206 return (data->deleteIndex(i));
211 return (data->deleteIndex(i));
217 return (data->deleteIndex(key));
223 return (data->deleteIndex(key));
228 return (data->indexExists(i));
233 return (data->indexExists(key));
238 return (data->nextIndex(currentSubscript));
243 return (data->elementCount());
248 return (data->isEmpty());
269 template <
typename STREAMTYPE>
273 data->outputOnStream(outputStream, indent, includeTypePrefix);
274 return (outputStream);
278 #define OME_ASSOC_SUB(v) static_cast<OMEassoc::ASSOC_HASH_KEY_t>(v)
282 template <
typename STREAMTYPE>
286 return (outputStream);
bool forceDeleteIndex(const ASSOC_HASH_KEY_t i)
Similar to deleteIndex(), but does not ensure a single reference to the array is held.
Definition: OMEassoc.h:209
OME reference count implementation.
bool indexExists(const OMEstring &key) const
Definition: OMEassoc.h:231
ASSOC_HASH_KEY_t nextIndex(const ASSOC_HASH_KEY_t currentSubscript) const
Definition: OMEassoc.cpp:200
void initializeAsType(const enum OMEtypes_t t)
The fundamental tagged data type used through the FARGOS/VISTA infrastructure.
Definition: OMEtype.cpp:95
Holds the string / data tuple for an element of an OMEassoc sparse array.
Definition: OMEassoc.h:22
const char s[]
Definition: t.cpp:4
OMEassoc & operator=(const OMEassoc &arg)
Definition: OMEassoc.h:140
OMEassocKeyPair(OMEstring *k, OMEtype *v)
Definition: OMEassoc.h:30
OME string implementation.
STREAMTYPE & outputOnStream(STREAMTYPE &outputOnStream, int_fast16_t indent=0, uint8_t includeTypePrefix=OME_DEFAULT_COMPLEX_OUTPUT_MODE) const
Definition: OMEoutputOnStream.h:63
bool indexExists(const ASSOC_HASH_KEY_t i) const
Definition: OMEassoc.cpp:182
OMEassoc(OMEassocStorage *s)
Definition: OMEassoc.h:115
bool isEmpty() const OME_ALWAYS_INLINE
Definition: OMEassoc.h:246
Implements associative array of OMEtype elements.
Definition: OMEassoc.h:112
ASSOC_HASH_KEY_t nextIndex(const ASSOC_HASH_KEY_t currentSubscript) const
Definition: OMEassoc.h:236
Implements text and binary string storage.
Definition: OMEstring.h:305
const OMEstring & getKeyForIndex(const ASSOC_HASH_KEY_t i) const
Definition: OMEassoc.cpp:158
#define stderr
Definition: tmp.o.cpp:3115
OMEassoc()
Definition: OMEassoc.h:127
C * data
Definition: OMErefCount.h:82
~OMEassoc()
Definition: OMEassoc.h:151
OME_DLL_EXPORT uint32_t OMEhash(const unsigned char *data, const uint32_t len) NONNULL_PARAMETERS(1)
Fast 32-bit hash over a buffer.
Definition: OMEhash.cpp:13
bool indexExists(const ASSOC_HASH_KEY_t i) const
Definition: OMEassoc.h:226
bool operator!=(const OMEassocKeyPair &arg) const
Definition: OMEassoc.cpp:40
OMEtype & operator[](const ASSOC_HASH_KEY_t)
Definition: OMEassoc.cpp:119
bool operator==(const OMEassoc &arg) const
Definition: OMEassoc.h:154
Reference-counted maintainer of an associative array. Used internally by OMEassoc.
Definition: OMEassoc.h:53
virtual OMEreferenceCount * deepCopy() const override
Definition: OMEassoc.cpp:79
~OMEassocKeyPair()
Definition: OMEassoc.cpp:23
Templated type-specific reference to a reference-counted object.
Definition: OMErefCount.h:79
Base class for reference-counted data.
Definition: OMErefCount.h:31
bool operator!=(const OMEassocStorage &arg) const
Definition: OMEassoc.cpp:407
class OMEstring * key
Definition: OMEassoc.h:27
STREAMTYPE & outputOnStream(STREAMTYPE &outputOnStream, int_fast16_t indent=0, uint8_t includeTypePrefix=OME_DEFAULT_COMPLEX_OUTPUT_MODE) const
Definition: OMEoutputOnStream.h:55
const char srcID[]
Definition: catSym.c:17
const OMEstring & getKeyForIndex(const ASSOC_HASH_KEY_t i) const
Definition: OMEassoc.h:198
STREAMTYPE & operator<<(STREAMTYPE &outputStream, const OMEassoc &data)
Output an OMEassoc object to an output stream.
Definition: OMEassoc.h:283
int aCount
Definition: OMEassoc.cpp:73
_STD map< ASSOC_HASH_KEY_t, OME_KEY_PAIR > AssocArrayType_t
Definition: OMEassoc.h:62
STREAMTYPE & outputOnStream(STREAMTYPE &outputStream, int_fast16_t indent=0, uint8_t includeTypePrefix=OME_DEFAULT_COMPLEX_OUTPUT_MODE) const
Output an OMEassoc object to an output stream.
Definition: OMEassoc.h:270
int deleteIndex(OMEthread *thread, OMEtype &result, const OMEtype &array, const OMEtype &subscript)
Definition: OILtypeFuncs.cpp:452
@ OME_NIL
Definition: OMEmanifests.h:78
bool operator==(const OMEassocKeyPair &arg) const
Definition: OMEassoc.cpp:29
#define _OME_ASSOC_H
Definition: tmp.o.cpp:965
uint32_t ASSOC_HASH_KEY_t
Definition: OMEassoc.h:59
OME associative array implementation.
bool deleteIndex(const ASSOC_HASH_KEY_t)
Definition: OMEassoc.cpp:172
OMEassocStorage::ASSOC_HASH_KEY_t ASSOC_HASH_KEY_t
Definition: OMEassoc.h:125
OME fundamental type implementation.
class OMEtype * value
Definition: OMEassoc.h:28
int getKeyForIndex(OMEthread *thread, OMEtype &result, const OMEtype &array, const OMEtype &subscript)
Definition: OILtypeFuncs.cpp:437
bool forceDeleteIndex(const OMEstring &key)
Similar to deleteIndex(), but does not ensure a single reference to the array is held.
Definition: OMEassoc.h:220
OMEtype & operator[](const ASSOC_HASH_KEY_t i)
Subscript reference !
Definition: OMEassoc.h:172
~OMEassocStorage()
Definition: OMEassoc.cpp:60
const char srcID[] OME_USED
Definition: tick_time.cpp:24
const OMEtype & operator[](const OMEstring &key) const
read-only subscript reference using a string key. !
Definition: OMEassoc.h:191
OMEassocStorage()
Definition: OMEassoc.cpp:56
void addReadOnlyReference()
Definition: OMErefCount.cpp:139
AssocArrayType_t assocArray
Definition: OMEassoc.h:63
@ OME_SET
Definition: OMEmanifests.h:89
OMEassoc(const OMEassoc &org)
Definition: OMEassoc.h:133
#define OME_ALWAYS_INLINE
Tell the compiler to alway inline a function, regardless of optimization level.
Definition: compiler_hints.h:364
const OMEtype & operator[](const ASSOC_HASH_KEY_t i) const
read-only subscript reference !
Definition: OMEassoc.h:178
class OMEassocKeyPair * OME_KEY_PAIR
Definition: OMEassoc.h:48
void dropReference(C *newData=nullptr) OME_ALWAYS_INLINE
Definition: OMErefCount.h:91
void noteDeepCopy()
Definition: OMEassoc.cpp:74
uint_fast32_t elementCount() const OME_ALWAYS_INLINE
Definition: OMEassoc.h:97
#define _STD
Definition: OMEmanifests.h:146
OME debug and profiling interfaces.
OMEassoc * deepCopy() const
Definition: OMEassoc.h:251
void getUniqueReference()
Force unique reference to the data, which will trigger duplication if necessary (copy-on-write).
Definition: OMErefCount.h:127
#define OME_DLL_EXPORT
Definition: compiler_hints.h:464
OMEtype & operator[](const OMEstring &key)
subscript reference using a string key. !
Definition: OMEassoc.h:185
bool isEmpty() const OME_ALWAYS_INLINE
Definition: OMEassoc.h:102
@ OME_DEFAULT_COMPLEX_OUTPUT_MODE
Definition: OMEmanifests.h:116
uint_fast32_t elementCount() const OME_ALWAYS_INLINE
Definition: OMEassoc.h:241
bool deleteIndex(const OMEstring &key)
Definition: OMEassoc.h:214
bool operator!=(const OMEassoc &arg) const
Definition: OMEassoc.h:163
@ OME_ARRAY
Definition: OMEmanifests.h:86
#define OMEtype
Definition: tmp.o.cpp:396
bool deleteIndex(const ASSOC_HASH_KEY_t i)
Definition: OMEassoc.h:203
@ OME_ASSOC
Definition: OMEmanifests.h:87
bool operator==(const OMEassocStorage &arg) const
Definition: OMEassoc.cpp:354