FARGOS/VISTA Object Management Environment Core  ..
FARGOS/VISTA Object Management Environment Core Table of Contents
fastLookupTable.hpp
Go to the documentation of this file.
1 #ifndef _FAST_LOOKUP_TABLE_HPP_
2 #define _FAST_LOOKUP_TABLE_HPP_ "$Id: fastLookupTable.hpp 454 2020-07-23 20:22:23Z geoff $";
4 
6 // get definition of BinaryBlock_struct
9 #include <map>
10 
26 namespace FastLookupUtils {
28 // namespace exists to force unique name for function
29 
30 // NOTE: BinaryBlock_struct is taken from implementation in logging_api.hpp
32 struct ltBinaryBlock {
38  bool operator()(const BinaryBlock_struct arg1, const BinaryBlock_struct arg2) const {
39 #if 0
40  /* NOTE: this optimization fails if some form of string pooling is in use
41  * and arg="abcdef" with length 6 and arg2="abcdef" with length 3.
42  */
43  if (OME_EXPECT_FALSE(arg1.dataBfr == arg2.dataBfr)) { // equal since they point at the same element
44  return (false); // so not less-than
45  }
46 #endif
47  /* NOTE: with arbitrary 3 possibilities (<, =, >), we test the
48  * condition that combines 2 first (probability: 2:3 vs. 1:3)
49  */
50  if (arg1.bfrLen >= arg2.bfrLen) { // arg2 equal length or shorter
51  int rc = memcmp(arg1.dataBfr, arg2.dataBfr, arg2.bfrLen);
52  if (rc < 0) { // arg1 is less
53  return (true);
54  }
55  return (false); // arg1 is greater or matches but is equal or longer
56  }
57  // arg1 is shorter or same
58  int rc = memcmp(arg1.dataBfr, arg2.dataBfr, arg1.bfrLen);
59  if (rc <= 0) { // arg1 is less or matches but is shorter
60  return (true);
61  }
62  return (false);
63  }
64 }; // end ltBinaryBlock
65 
66 }; // end namespace FastLookupUtils
67 
68 
114 template <typename RECORD_TYPE, const uint_fast8_t MAX_LOOKAHEAD=4,
115  const unsigned char SMALLEST_CHAR='A', const unsigned char LARGEST_CHAR='Z',
116  typename LT_KEY_COMPARE=FastLookupUtils::ltBinaryBlock> class FastLookupTable {
117 protected:
118  enum { ELEMENT_RANGE = (LARGEST_CHAR - SMALLEST_CHAR) + 1 };
120  RECORD_TYPE *record[ELEMENT_RANGE];
124  std::map<BinaryBlock_struct,RECORD_TYPE *,LT_KEY_COMPARE> outOfBoundEntries;
125 
126  RECORD_TYPE *findRecordInSpillover(const BinaryBlock_struct key) const {
127  typename std::map<BinaryBlock_struct,RECORD_TYPE *,LT_KEY_COMPARE>::const_iterator i = outOfBoundEntries.find(key);
128  if (i == outOfBoundEntries.end()) {
129  return (nullptr);
130  }
131  return (i->second);
132  }
133 
134  RECORD_TYPE *findRecordInSpillover(const unsigned char *key, const uint_fast32_t len) const OME_ALWAYS_INLINE {
135  return (findRecordInSpillover(BinaryBlock_struct(key, len)));
136  }
137 
138  void addRecordToSpillover(const unsigned char *key, const uint_fast32_t keyLen, RECORD_TYPE *rec) OME_ALWAYS_INLINE {
139  outOfBoundEntries.emplace(BinaryBlock_struct(key, keyLen), rec);
140  }
141 
142 public:
154  private:
157  public:
159  int_fast16_t currentCharIndex;
160 
163  } searchState;
164 
165  typename std::map<BinaryBlock_struct,RECORD_TYPE *,LT_KEY_COMPARE>::iterator extra_it;
166 
168  levelPtr = level;
169  currentCharIndex = -1;
171  extra_it = levelPtr->outOfBoundEntries.begin();
172  }
173 
175 
177  }; // end internal class IteratorState
178 
179  IteratorState stateStack[MAX_LOOKAHEAD];
180  int_fast16_t currentLookaheadDepth;
181 
182  public:
189  stateStack[0].reset(level);
191  }
192 
196  inline bool atEnd() const OME_ALWAYS_INLINE {
197  return (stateStack[0].searchState == IteratorState::AT_END);
198  }
199 
204  RECORD_TYPE *nextElement() {
205  // in case called again after reaching end
206  if (OME_EXPECT_FALSE(atEnd())) {
207  return (nullptr);
208  }
209  while (OME_EXPECT_TRUE(currentLookaheadDepth >= 0)) {
210  IteratorState &curState = stateStack[currentLookaheadDepth]; // alias
211  if (curState.searchState != IteratorState::IN_EXTRAS) {
212  // search through range, handling records and children
213  while (curState.currentCharIndex < ELEMENT_RANGE) {
214  if (curState.searchState == IteratorState::FIND_RECORD) {
215  curState.currentCharIndex += 1; // move to next entry
216  if (OME_EXPECT_FALSE(curState.currentCharIndex == ELEMENT_RANGE)) { // at end of symbols
218  } else {
220  if (curState.levelPtr->record[curState.currentCharIndex] != nullptr) { // record at this level
221  return (curState.levelPtr->record[curState.currentCharIndex]);
222  }
223  }
224  }
225  if (curState.searchState == IteratorState::IN_CHILDREN) {
227  if (curState.levelPtr->nextLevel[curState.currentCharIndex] != nullptr) {
229  stateStack[currentLookaheadDepth].reset(curState.levelPtr->nextLevel[curState.currentCharIndex]);
230  RECORD_TYPE *result = nextElement();
231  if (OME_EXPECT_TRUE(result != nullptr)) {
232  return (result);
233  }
234  // This would be very, very, very unexpected
235  // No actual data was provided underneath child node
237  }
238  }
239  } // end while entries in range to examine
240  // exhausted range of characters
241  curState.searchState = IteratorState::IN_EXTRAS; // process exception cases
242  } // end if curState.searchState != IN_EXTRAS
243  // To reach here, must be processing exception cases
244  if (curState.extra_it != curState.levelPtr->outOfBoundEntries.end()) {
245  RECORD_TYPE *result = curState.extra_it->second;
246  ++(curState.extra_it);
247  return (result);
248  }
249  // reached end of all exception cases
251  }
252  currentLookaheadDepth = 0; // reset back to 0
253  stateStack[0].searchState = IteratorState::AT_END; // flag at end
254  return (nullptr);
255  }
256 
262  resetIterator(levelPtr);
263  }
264 
267 
269  RECORD_TYPE *firstElement() {
270  resetIterator(stateStack[0].levelPtr);
271  RECORD_TYPE *result = nextElement();
272  return (result);
273  }
274 
275  }; // end support class FastLookupTableIterator
276 
277 
280  memset(record, 0, sizeof(record));
281  memset(nextLevel, 0, sizeof(nextLevel));
282  }
283 
284  // not really expected to be used via multiple inheritence...but who knows?
285  virtual ~FastLookupTable() {
286  for (unsigned i = 0; i < ELEMENT_RANGE; ++i) {
287  delete nextLevel[i];
288  }
289  }
290 
298  RECORD_TYPE *findRecord(const unsigned char *key, const uint_fast32_t keyLen) const OME_ALWAYS_OPTIMIZE("-O3") {
299  OME_PREFETCH(key, 0, 0); // read-only, only for this period of time
300  LOG_COMPONENT_CERR(app,debug) << "table=" << this << " Find key=\"" << AS_TEXT_BUFFER((const char *) key, keyLen) << "\"" << LOG_ENDLINE;
301  RECORD_TYPE *result;
302  int_fast32_t offsetInKey = 0; // could be only 8 bits
303  const int_fast32_t maxLen = OME_EXPECT_TRUE((keyLen <= MAX_LOOKAHEAD)) ? static_cast<int32_t>(keyLen) - 1 : MAX_LOOKAHEAD - 1;
305 
306  // traverse to either length of key or MAX_LOOKAHEAD
307  while (offsetInKey < maxLen) {
308  int_fast16_t iOffset = static_cast<int_fast16_t>(key[offsetInKey]) - SMALLEST_CHAR;
309  /* It is relatively rare for the character to be outside the bounds
310  * we are tracking.
311  */
312  if (OME_EXPECT_FALSE(iOffset < 0) || OME_EXPECT_FALSE(iOffset >= ELEMENT_RANGE)) {
313  result = levelPtr->findRecordInSpillover(key, keyLen);
314  return (result);
315  }
316 // OME_PREFETCH(&(levelPtr->nextLevel[iOffset]), 0, 3); // read-only, retain
317  levelPtr = levelPtr->nextLevel[iOffset];
318  if (OME_EXPECT_FALSE(levelPtr == nullptr)) {
319  LOG_COMPONENT_CERR(app,debug) << "table=" << this <<
320  " intermediate Record at depth=" << offsetInKey <<
321  " key=\"" << AS_TEXT_BUFFER((const char *) key, keyLen) <<
322  "\"" << " is null" << LOG_ENDLINE;
323  return (nullptr);
324  }
325  offsetInKey += 1;
326  }
327  if (offsetInKey == (static_cast<int_fast32_t>(keyLen) - 1)) { // made it to end of key
328  int_fast16_t iOffset = static_cast<int_fast16_t>(key[offsetInKey]) - SMALLEST_CHAR;
329  // last character in key
330  if (OME_EXPECT_TRUE(iOffset >= 0) && OME_EXPECT_TRUE(iOffset < ELEMENT_RANGE)) {
331  result = levelPtr->record[iOffset];
332  LOG_COMPONENT_CERR(app,debug) << "table=" << this <<
333  " Record at depth=" << offsetInKey <<
334  " key=\"" << AS_TEXT_BUFFER((const char *) key, keyLen) <<
335  "\" is " << result << LOG_ENDLINE;
336  return (result);
337  }
338  }
339  result = levelPtr->findRecordInSpillover(key, keyLen);
340  return (result);
341  }
342 
347  inline RECORD_TYPE *findRecord(const char *key) const OME_ALWAYS_INLINE OME_ALWAYS_OPTIMIZE("-O3") {
348  RECORD_TYPE *result = findRecord(reinterpret_cast<const unsigned char *>(key),
349  (uint_fast32_t) strlen(key));
350  return (result);
351  }
352 
357  inline RECORD_TYPE *findRecord(const std::string &key) const OME_ALWAYS_INLINE OME_ALWAYS_OPTIMIZE("-O3") {
358  RECORD_TYPE *result = findRecord(reinterpret_cast<const unsigned char *>(key.data()),
359  (uint_fast32_t) key.length());
360  return (result);
361  }
362 
378  int addRecord(const unsigned char *key, const uint_fast32_t keyLen, RECORD_TYPE *rec) {
379  LOG_COMPONENT_CERR(app,debug) << "table=" << this << " Add key=\"" << AS_TEXT_BUFFER((const char *) key, keyLen) << "\"" << LOG_ENDLINE;
380  uint_fast32_t offsetInKey = 0;
381  int_fast16_t iOffset = static_cast<int_fast16_t>(key[offsetInKey]) - SMALLEST_CHAR;
382  if (OME_EXPECT_FALSE((iOffset < 0)) || OME_EXPECT_FALSE((iOffset >= ELEMENT_RANGE))) {
383  LOG_COMPONENT_CERR(app,debug) << "table=" << this << " Add to spillover key=\"" << AS_TEXT_BUFFER((const char *) key, keyLen) << "\"" << LOG_ENDLINE;
384  addRecordToSpillover(key, keyLen, rec);
385  return (2);
386  }
388  OME_PREFETCH(&(levelPtr->nextLevel[iOffset]), 1, 3); // probably updated-for-write, retain
389  const uint_fast32_t maxLen = OME_EXPECT_TRUE(keyLen <= MAX_LOOKAHEAD) ? keyLen : MAX_LOOKAHEAD;
390  // traverse to either length of key or MAX_LOOKAHEAD
391  uint_fast32_t nextOffset = 1; // always 1 more than offsetInKey
392  while (nextOffset < maxLen) {
394  if (OME_EXPECT_FALSE(nextLevelPtr == nullptr)) { // create entry for level
396  levelPtr->nextLevel[iOffset] = nextLevelPtr;
397  }
398  levelPtr = nextLevelPtr;
399  offsetInKey = nextOffset;
400  iOffset = static_cast<int_fast16_t>(key[offsetInKey]) - SMALLEST_CHAR;
401  if (OME_EXPECT_FALSE((iOffset < 0)) || OME_EXPECT_FALSE((iOffset >= ELEMENT_RANGE))) {
402  LOG_COMPONENT_CERR(app,debug) << "table=" << this << " Add to spillover key=\"" << AS_TEXT_BUFFER((const char *) key, keyLen) << "\"" << LOG_ENDLINE;
403  levelPtr->addRecordToSpillover(key, keyLen, rec);
404  return (2);
405  }
406  OME_PREFETCH(&(levelPtr->nextLevel[iOffset]), 1, 3); // probably updated-for-write, retain
407  nextOffset += 1;
408  }
409  if (OME_EXPECT_TRUE(nextOffset == keyLen)) { // this was the last character
410  LOG_COMPONENT_CERR(app,debug) << "table=" << this << " Add to record at depth=" << nextOffset << " key=\"" << AS_TEXT_BUFFER((const char *) key, keyLen) << "\"" << LOG_ENDLINE;
411  levelPtr->record[iOffset] = rec;
412  return (1);
413  }
414  LOG_COMPONENT_CERR(app,debug) << "table=" << this << " Add to spillover key=\"" << AS_TEXT_BUFFER((const char *) key, keyLen) << "\"" << LOG_ENDLINE;
415  levelPtr->addRecordToSpillover(key, keyLen, rec);
416  return (3);
417  }
418 
427  inline int addRecord(const char *key, RECORD_TYPE *rec) OME_ALWAYS_INLINE {
428  int result = addRecord(reinterpret_cast<const unsigned char *>(key),
429  (uint_fast32_t) strlen(key), rec);
430  return (result);
431  }
432 
443  int addRecord(const std::string &key, RECORD_TYPE *rec) OME_ALWAYS_INLINE {
444  int result = addRecord(reinterpret_cast<const unsigned char *>(key.data()),
445  (uint_fast32_t) key.length(), rec);
446  return (result);
447  }
448 
452  FastLookupTableIterator it(this);
453  return (it);
454  }
455 
456 }; // end class FastLookupTable<>
457 
461 #endif
462 
463 /* vim: set expandtab shiftwidth=4 tabstop=4: */
FastLookupTable::outOfBoundEntries
std::map< BinaryBlock_struct, RECORD_TYPE *, LT_KEY_COMPARE > outOfBoundEntries
Map to handle entries that do not fit: character out of bounds or too long.
Definition: fastLookupTable.hpp:124
OMEencodeBuffer::condenseIntoString
OMEstring * condenseIntoString(bool includeVersionID)
Serialize all OMEencodeBufferElement items into a single string.
Definition: OMEencode.cpp:75
BinaryBlock_struct::bfrLen
uint_fast32_t bfrLen
Definition: logging_api.hpp:520
OMEnlm::encodeNLM
OMEstring * encodeNLM(const class OMEencodeBuffer *bfr) const
Definition: OMEnlm.h:156
OME_NLM
@ OME_NLM
Definition: OMEmanifests.h:90
FastLookupTable::nextLevel
FastLookupTable< RECORD_TYPE, MAX_LOOKAHEAD, SMALLEST_CHAR, LARGEST_CHAR, LT_KEY_COMPARE > * nextLevel[ELEMENT_RANGE]
pointer to chain of records that had character in this position
Definition: fastLookupTable.hpp:122
OMEset::elementCount
uint32_t elementCount() const OME_ALWAYS_INLINE
Returns the number of elements in the set.
Definition: OMEset.h:213
OME_FLOAT
@ OME_FLOAT
Definition: OMEmanifests.h:82
s
const char s[]
Definition: t.cpp:4
OME_POINTER
@ OME_POINTER
Definition: OMEmanifests.h:92
OMEtype::fixed
class OMEfixed * fixed
Definition: OMEbaseType.h:300
OME_UINT16
@ OME_UINT16
Definition: OMEmanifests.h:98
FastLookupTable::record
RECORD_TYPE * record[ELEMENT_RANGE]
pointer to records that end at this position
Definition: fastLookupTable.hpp:120
FastLookupTable::FastLookupTableIterator::IteratorState::IteratorState
IteratorState()
Definition: fastLookupTable.hpp:174
OMEassoc
Implements associative array of OMEtype elements.
Definition: OMEassoc.h:112
OMEassoc::nextIndex
ASSOC_HASH_KEY_t nextIndex(const ASSOC_HASH_KEY_t currentSubscript) const
Definition: OMEassoc.h:236
OMEuncompressString
OMEstring * OMEuncompressString(const OMEstring &data)
Uncompress a previously compressed string.
Definition: OMEcompress.cpp:61
FastLookupTable::FastLookupTableIterator::resetIterator
void resetIterator(FastLookupTable< RECORD_TYPE, MAX_LOOKAHEAD, SMALLEST_CHAR, LARGEST_CHAR, LT_KEY_COMPARE > *level)
Reset the iterator so that the next call to nextElement() returns the first record.
Definition: fastLookupTable.hpp:188
OMEstring
Implements text and binary string storage.
Definition: OMEstring.h:305
OMEencode.h
OME type encoding routines.
OMEencodeBuffer
Buffer into which OMEtype data is encoded.
Definition: OMEencode.h:54
OMEarray::indexExists
bool indexExists(const uint32_t i) const
Definition: OMEarray.h:202
OMEtype::value
union OMEtype::@26 value
OMEtype
Fundamental ANY type for FARGOS/VISTA Object Management Environment.
Definition: OMEbaseType.h:250
FastLookupTable::FastLookupTableIterator::IteratorState
Internal class for iterator state.
Definition: fastLookupTable.hpp:156
OME_DOUBLE
@ OME_DOUBLE
Definition: OMEmanifests.h:83
FastLookupTable::findRecord
RECORD_TYPE * findRecord(const std::string &key) const OME_ALWAYS_INLINE OME_ALWAYS_OPTIMIZE("-O3")
Convenience interface for working with std::string keys.
Definition: fastLookupTable.hpp:357
OME_ALWAYS_OPTIMIZE
#define OME_ALWAYS_OPTIMIZE(level)
Mark a function to be compiled with a specific level of optimization.
Definition: compiler_hints.h:406
FastLookupTable::findRecord
RECORD_TYPE * findRecord(const unsigned char *key, const uint_fast32_t keyLen) const OME_ALWAYS_OPTIMIZE("-O3")
Find record in mapping table.
Definition: fastLookupTable.hpp:298
OMEtype::oid
class OMEoid * oid
Definition: OMEbaseType.h:297
OMEloadVersion1Encodings
void OMEloadVersion1Encodings()
Definition: encodeVer1.cpp:631
FastLookupTable::FastLookupTableIterator::firstElement
RECORD_TYPE * firstElement()
Return first element in table.
Definition: fastLookupTable.hpp:269
OME_UINT32
@ OME_UINT32
Definition: OMEmanifests.h:96
attach_req
dl_attach_req_t attach_req
Definition: ethers.c:45
FastLookupTable::FastLookupTableIterator::currentLookaheadDepth
int_fast16_t currentLookaheadDepth
Definition: fastLookupTable.hpp:180
OMEtype::s
class OMEstring * s
Definition: OMEbaseType.h:299
buffer
long buffer[MAXDLBUF]
Definition: ethers.c:42
FastLookupTable::FastLookupTableIterator
Iterator for FastLookupTable.
Definition: fastLookupTable.hpp:153
main
main(int argc, argv)
Definition: ethers.c:48
OMEtype::array
class OMEarray * array
Definition: OMEbaseType.h:294
FastLookupTable::addRecord
int addRecord(const unsigned char *key, const uint_fast32_t keyLen, RECORD_TYPE *rec)
Add a record to mapping table.
Definition: fastLookupTable.hpp:378
FastLookupTable::FastLookupTableIterator::~FastLookupTableIterator
~FastLookupTableIterator()
Destructor for FastLookupTable iterator.
Definition: fastLookupTable.hpp:266
FastLookupTable::FastLookupTableIterator::atEnd
bool atEnd() const OME_ALWAYS_INLINE
Returns a Boolean indicator if the end of the table has been seen.
Definition: fastLookupTable.hpp:196
OMEtype::nlm
class OMEnlm * nlm
Definition: OMEbaseType.h:301
FastLookupTable::FastLookupTableIterator::IteratorState::IN_EXTRAS
@ IN_EXTRAS
Definition: fastLookupTable.hpp:162
FastLookupTable::FastLookupTableIterator::IteratorState::reset
void reset(FastLookupTable< RECORD_TYPE, MAX_LOOKAHEAD, SMALLEST_CHAR, LARGEST_CHAR, LT_KEY_COMPARE > *level)
Definition: fastLookupTable.hpp:167
FastLookupTable::FastLookupTableIterator::IteratorState::extra_it
std::map< BinaryBlock_struct, RECORD_TYPE *, LT_KEY_COMPARE >::iterator extra_it
Definition: fastLookupTable.hpp:165
ctl
struct strbuf ctl
Definition: ethers.c:43
FastLookupTable::FastLookupTableIterator::IteratorState::~IteratorState
~IteratorState()
Definition: fastLookupTable.hpp:176
OME_PREFETCH
#define OME_PREFETCH(addr, rw, locality)
Macro to request prefetch.
Definition: compiler_hints.h:362
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
OMEstring::noteCharacterSet
void noteCharacterSet(uint_fast8_t c)
Definition: OMEstring.h:386
OMEassoc::getKeyForIndex
const OMEstring & getKeyForIndex(const ASSOC_HASH_KEY_t i) const
Definition: OMEassoc.h:198
OMEnlm::decodeNLM
static OMEnlm * decodeNLM(uint32_t ver, const OMEstring *encodedData, size_t *offset)
Definition: OMEnlm.cpp:140
OMEset
Implements an ordered list of OMEtype elements.
Definition: OMEset.h:64
phys_addr_req
dl_phys_addr_req_t phys_addr_req
Definition: ethers.c:44
FastLookupTable::FastLookupTableIterator::IteratorState::AT_END
@ AT_END
Definition: fastLookupTable.hpp:162
OMEtype::encode
int encode(class OMEencodeBuffer *) const
Add the encoding of an OMEtype into an OMEencodeBuffer.
Definition: OMEencode.cpp:189
FastLookupTable::FastLookupTableIterator::IteratorState::searchState
enum FastLookupTable::FastLookupTableIterator::IteratorState::SEARCH_STATES searchState
MAXDLBUF
#define MAXDLBUF
Definition: ethers.c:39
OMEencodeBuffer::addEncodedElement
void addEncodedElement(OMEencodeBufferElement *elem)
Append an encoded element to the collection.
Definition: OMEencode.h:84
OME_NIL
@ OME_NIL
Definition: OMEmanifests.h:78
OME_EXPECT_TRUE
#define OME_EXPECT_TRUE(expr)
Annotation macro for conditional expression expected to be true.
Definition: compiler_hints.h:541
FastLookupTable::FastLookupTableIterator::IteratorState::IN_CHILDREN
@ IN_CHILDREN
Definition: fastLookupTable.hpp:162
OME_OID
@ OME_OID
Definition: OMEmanifests.h:84
FastLookupUtils::ltBinaryBlock::operator()
bool operator()(const BinaryBlock_struct arg1, const BinaryBlock_struct arg2) const
Performs less-than comparison on BinaryBlock_struct elements.
Definition: fastLookupTable.hpp:38
OMEtype::f
float f
Definition: OMEbaseType.h:287
OMEtypes_t
OMEtypes_t
Definition: OMEmanifests.h:77
OMEstring::getCharacterSet
uint_fast8_t getCharacterSet() const
Definition: OMEstring.h:396
BinaryBlock_struct
Placeholder structure to reference a block of arbitrary data.
Definition: logging_api.hpp:517
FastLookupTable::findRecord
RECORD_TYPE * findRecord(const char *key) const OME_ALWAYS_INLINE OME_ALWAYS_OPTIMIZE("-O3")
Convenience interface for working with C-string keys.
Definition: fastLookupTable.hpp:347
FastLookupTable
Fast map lookup table.
Definition: fastLookupTable.hpp:116
NULL
#define NULL
Definition: tmp.o.cpp:327
OME_UINT64
@ OME_UINT64
Definition: OMEmanifests.h:97
FastLookupTable::FastLookupTableIterator::stateStack
IteratorState stateStack[MAX_LOOKAHEAD]
Definition: fastLookupTable.hpp:179
app
LogMaskType_t COMPONENT_LOG_MASK() app("app_logMask", &DEFAULT_sharedMemoryVariableManager, COMPONENT_LEVEL(app, defaultMask))
decodeVersion1
OMEtype * decodeVersion1(uint32_t version, const OMEstring *encodedData, size_t *offset)
Definition: encodeVer1.cpp:260
OMEtype.h
OME fundamental type implementation.
FastLookupUtils
Namespace to qualify ltBinaryBlock routine.
Definition: fastLookupTable.hpp:27
OMEcompressString
OMEstring * OMEcompressString(const OMEstring &data)
Compress a string.
Definition: OMEcompress.cpp:28
FastLookupTable::addRecord
int addRecord(const std::string &key, RECORD_TYPE *rec) OME_ALWAYS_INLINE
Convenience interface for working with std::string keys.
Definition: fastLookupTable.hpp:443
FastLookupTable::FastLookupTableIterator::IteratorState::levelPtr
FastLookupTable< RECORD_TYPE, MAX_LOOKAHEAD, SMALLEST_CHAR, LARGEST_CHAR, LT_KEY_COMPARE > * levelPtr
Definition: fastLookupTable.hpp:158
dlpadd
dl_phys_addr_ack_t * dlpadd
Definition: ethers.c:46
BinaryBlock_struct::dataBfr
const void * dataBfr
Definition: logging_api.hpp:519
FastLookupTable::findRecordInSpillover
RECORD_TYPE * findRecordInSpillover(const unsigned char *key, const uint_fast32_t len) const OME_ALWAYS_INLINE
Definition: fastLookupTable.hpp:134
OMEtype::ui
uint32_t ui
Definition: OMEbaseType.h:286
OMEstring::length
size_t length() const
Definition: OMEstring.h:401
FastLookupTable::~FastLookupTable
virtual ~FastLookupTable()
Definition: fastLookupTable.hpp:285
OME_USED
const char srcID[] OME_USED
Definition: tick_time.cpp:24
flags
int flags
Definition: ethers.c:41
FastLookupTable::FastLookupTableIterator::IteratorState::SEARCH_STATES
SEARCH_STATES
Definition: fastLookupTable.hpp:161
OMEarray::elementCount
uint_fast32_t elementCount() const OME_ALWAYS_INLINE
Definition: OMEarray.h:247
OMEoid::decodeOID
static OMEoid * decodeOID(uint32_t ver, const OMEstring *encodedData, size_t *offset)
Definition: OMEoidIntStub.cpp:48
AS_TEXT_BUFFER
#define AS_TEXT_BUFFER(s,...)
Convenience label to enable passing text with known length to output operator<<().
Definition: logging_api.hpp:2087
OME_SET
@ OME_SET
Definition: OMEmanifests.h:89
atomic_values.h
Atomic operations.
ntohl
#define ntohl(x)
Definition: tmp.o.cpp:3101
errno
int errno
Definition: ethers.c:41
FastLookupUtils::ltBinaryBlock
Less-than comparison for BinaryBlock_struct.
Definition: fastLookupTable.hpp:32
OME_EXPECT_FALSE
#define OME_EXPECT_FALSE(expr)
Annotation macro for conditional expression expected to be false.
Definition: compiler_hints.h:540
LOG_COMPONENT_CERR
#define LOG_COMPONENT_CERR(component, lvl)
Convenience macro that uses LOG_COMPONENT_INTO to conditionally log a message to standard error.
Definition: logging_api.hpp:3030
OMEarray::nextIndex
ARRAY_SUBSCRIPT_t nextIndex(const uint32_t currentSubscript) const
Definition: OMEarray.h:217
OME_ALWAYS_INLINE
#define OME_ALWAYS_INLINE
Tell the compiler to alway inline a function, regardless of optimization level.
Definition: compiler_hints.h:364
OMEencodeRoutines
Description for OME encoding routines for a specific encoding version.
Definition: OMEencode.h:118
OME_UINT8
@ OME_UINT8
Definition: OMEmanifests.h:99
FastLookupTable::FastLookupTableIterator::IteratorState::FIND_RECORD
@ FIND_RECORD
Definition: fastLookupTable.hpp:162
OME_FIXED
@ OME_FIXED
Definition: OMEmanifests.h:91
FastLookupTable::FastLookupTableIterator::FastLookupTableIterator
FastLookupTableIterator(FastLookupTable< RECORD_TYPE, MAX_LOOKAHEAD, SMALLEST_CHAR, LARGEST_CHAR, LT_KEY_COMPARE > *levelPtr)
Constructor for FastLookupTable iterator.
Definition: fastLookupTable.hpp:261
FastLookupTable::FastLookupTableIterator::nextElement
RECORD_TYPE * nextElement()
Returns a pointer to the next element located by the iterator.
Definition: fastLookupTable.hpp:204
ppa
int ppa
Definition: ethers.c:41
FastLookupTable::findRecordInSpillover
RECORD_TYPE * findRecordInSpillover(const BinaryBlock_struct key) const
Definition: fastLookupTable.hpp:126
OMEarray
Implements sparse array of OMEtype elements.
Definition: OMEarray.h:75
FastLookupTable::ELEMENT_RANGE
@ ELEMENT_RANGE
Definition: fastLookupTable.hpp:118
LOG_ENDLINE
#define LOG_ENDLINE
Closing clause for text line output using << operators.
Definition: logging_api.hpp:2956
OMEoid
Public interface to an OME Object Identifier.
Definition: OMEoid.h:196
OME_ANY
@ OME_ANY
Definition: OMEmanifests.h:93
OMEoid::encodeOID
OMEstring * encodeOID(const class OMEencodeBuffer *bfr) const
Definition: OMEoid.h:221
FastLookupTable::FastLookupTableIterator::IteratorState::currentCharIndex
int_fast16_t currentCharIndex
Definition: fastLookupTable.hpp:159
FastLookupTable::addRecord
int addRecord(const char *key, RECORD_TYPE *rec) OME_ALWAYS_INLINE
Convenience interface for working with C-string keys.
Definition: fastLookupTable.hpp:427
OMEtype::type
uint32_t type
Definition: OMEbaseType.h:304
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
FastLookupTable::addRecordToSpillover
void addRecordToSpillover(const unsigned char *key, const uint_fast32_t keyLen, RECORD_TYPE *rec) OME_ALWAYS_INLINE
Definition: fastLookupTable.hpp:138
decodeVersion2
OMEtype * decodeVersion2(uint32_t version, const OMEstring *encodedData, size_t *offset)
Definition: encodeVer1.cpp:502
OMEassoc::elementCount
uint_fast32_t elementCount() const OME_ALWAYS_INLINE
Definition: OMEassoc.h:241
OMEencodeBufferElement
Holds data for a single encoded OMEtype element. Multiple OMEencodeBufferElement objects are linked t...
Definition: OMEencode.h:20
OME_ARRAY
@ OME_ARRAY
Definition: OMEmanifests.h:86
OMEarray::ARRAY_SUBSCRIPT_t
OMEarrayStorage::ARRAY_SUBSCRIPT_t ARRAY_SUBSCRIPT_t
Definition: OMEarray.h:90
OMEtype::assoc
class OMEassoc * assoc
Definition: OMEbaseType.h:296
OMEtype
#define OMEtype
Definition: tmp.o.cpp:396
OMEtype::set
class OMEset * set
Definition: OMEbaseType.h:298
_OMEfixedConstant
Internal data type to generate fixed-point constant from floating-point value.
Definition: OMEfixed.h:26
htonl
#define htonl(x)
Definition: tmp.o.cpp:3098
_OMEfixedConstant::d
double d
Definition: OMEfixed.h:27
FastLookupTable::begin
FastLookupTableIterator begin()
Get initial iterator.
Definition: fastLookupTable.hpp:451
OME_ASSOC
@ OME_ASSOC
Definition: OMEmanifests.h:87
fd
int fd
Definition: ethers.c:41
byte_swap64
#define byte_swap64(x)
Definition: encodeVer1.cpp:26
FastLookupTable::FastLookupTable
FastLookupTable()
Construct a FastLookupTable object.
Definition: fastLookupTable.hpp:279
OME_INT32
@ OME_INT32
Definition: OMEmanifests.h:79
OME_INT64
@ OME_INT64
Definition: OMEmanifests.h:81
logging_api.hpp
FARGOS Logging API.
OMEdefineEncodeRoutinesForVersion
void OMEdefineEncodeRoutinesForVersion(OMEencodeRoutines *routines)
Register encoding routines for OMEtype data.
Definition: OMEencode.cpp:121
Generated: Tue Jul 28 2020 16:03:25
Support Information