FARGOS/VISTA Object Management Environment Core  ..
FARGOS/VISTA Object Management Environment Core Table of Contents
compiler_hints.h
Go to the documentation of this file.
1 #ifndef _COMPILER_HINTS_H_
2 #define _COMPILER_HINTS_H_ "$Id: compiler_hints.h 472 2020-07-25 21:03:30Z geoff $"
4 
6 /* Copyright (C) 2001 - 2019 FARGOS Development, LLC
7  * This file is useable by C and C++ programs; avoid C++-specific features
8  * like "//" comments.
9  */
273 #ifdef __cplusplus
274 # include <typeinfo>
275 # include <stdlib.h> /* needed for free() */
276 #endif
277 
278 #ifndef _WIN32
279 # include <unistd.h> /* needed for correct selection of thread yield */
280 #endif
281 #ifndef _MSC_VER /* Not Microsoft Visual C++ */
282 # include <cxxabi.h>
283 #endif
284 #include <string.h>
285 #include <stdint.h>
286 
287 #ifdef _MSC_VER /* Microsoft Visual C++ */
288 # ifndef _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES
289 # define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES 1 /* For Windows, rename standard routines */
290 # endif
291 # ifndef _CRT_SECURE_NO_WARNINGS
292 # define _CRT_SECURE_NO_WARNINGS 1
293 # endif
294 # ifndef _CRT_NONSTDC_NO_WARNINGS
295 # define _CRT_NONSTDC_NO_WARNINGS 1
296 # endif
297 
298 # define OME_FAST_CALL __fastcall
299 
300 # pragma warning(disable : 4996) /* complaints regarding deprecated POSIX routines */
301 
302 #endif
303 
304 #if __clang__ > 0 /* clang */
305 /* clang supports a limited number of gcc attributes
306 */
307 # define OME_DEPRECATED __attribute__((deprecated))
308 # define OME_DEPRECATED_BECAUSE(msg) __attribute__((deprecated(msg)))
309 # define OME_USAGE_WARNING(msg) __attribute__((warning(msg)))
310 # define OME_USAGE_ERROR(msg) __attribute__((error(msg)))
311 # define CONSTEXPR constexpr
312 # define AN_ENUM(x) x
313 /* Could be __Nonnull */
314 # define NONNULL_PARAMETERS(...) __attribute__((nonnull(__VA_ARGS__)))
315 /* flag for now -- "this" pointer is hidden parameter #1 */
316 # define NONNULL_CLASS_PARAMETERS(...) __attribute__((nonnull(__VA_ARGS__)))
317 /* Could be __Nonnull */
318 # define NONNULL_RETURN __attribute__((returns_nonnull))
319 
320 # define OME_USED __attribute__((used))
321 # define OME_ALWAYS_INLINE __attribute__((always_inline))
322 # define OME_INIT_PRIORITY(n) __attribute__((init_priority(n)))
323 # define OME_PURE_FUNCTION __attribute__((pure))
324 # define OME_CONST_FUNCTION __attribute__((const))
325 # define OME_EXPECT(expr, expected) __builtin_expect((expr), expected)
326 
327 # define OME_PREFETCH(addr, rw, locality) __builtin_prefetch(addr, rw, locality)
328 
329 /* not really the effect we want; silences compiler complaints
330  * rather than forcing symbol to be retained */
331 # define OME_UNUSED __attribute__((unused))
332 
333 #elif __GNUC__ > 0 /* GNU C++ Compiler */
334 
335 # define NONNULL_PARAMETERS(...) __attribute__((nonnull(__VA_ARGS__)))
336 /* flag for now -- "this" pointer is hidden parameter #1 */
337 # define NONNULL_CLASS_PARAMETERS(...) __attribute__((nonnull(__VA_ARGS__)))
338 
339 # define NONNULL_RETURN __attribute__((returns_nonnull))
340 
341 # ifdef HAVE_GCCVISIBILITYPATCH
342 # define OME_DLL_EXPORT __attribute__((visibility("default")))
343 # define OME_DLL_LOCAL __attribute__((visibility("hidden")))
344 # endif
345 
346 # ifdef _MSC_VER /* Microsoft Visual C++ */
347 
348 # ifdef BUILDING_DLL
349 # define OME_DLL_EXPORT __declspec(dllexport)
350 # else
351 # define OME_DLL_EXPORT __declspec(dllimport)
352 # endif
353 # define OME_DLL_LOCAL
354 //#define OME_FAST_CALL __fastcall
355 # endif // _MSC_VER
356 
357 /* original check: ifndef __MIPSEL__ and ifndef sun
358  */
359 
360 # define OME_EXPECT(expr, expected) __builtin_expect((expr), expected)
361 
362 # define OME_PREFETCH(addr, rw, locality) __builtin_prefetch(addr, rw, locality)
363 
364 # define OME_ALWAYS_INLINE __attribute__((always_inline))
365 
366 # define OME_NEVER_INLINE __attribute__((noinline))
367 
368 # define OME_ALWAYS_FLATTEN __attribute__((flatten))
369 
370 # define OME_COLD_ROUTINE __attribute__((cold))
371 
372 # define OME_INIT_PRIORITY(n) __attribute__((init_priority(n)))
373 
374 # define OME_DEPRECATED __attribute__((deprecated))
375 
376 # define OME_USAGE_WARNING(msg) __attribute__((warning(msg)))
377 
378 # define OME_USAGE_ERROR(msg) __attribute__((error(msg)))
379 
380 # define OME_USED __attribute__((used))
381 
382 # define OME_UNUSED __attribute__((unused))
383 
386 #define OME_WEAK __attribute__((weak))
387 
388 # define OME_PURE_FUNCTION __attribute__((pure))
389 
390 # define OME_CONST_FUNCTION __attribute__((const))
391 
392 # define AN_ENUM(x) x
393 
394 /* Note: 64-bit API already uses registers rather than the stack, so this
395  * should be inhibited or at least adjusted for 64-bit compilation
396  */
397 # if __LP64__ == 0
398 #if __i386__
399 # define OME_FAST_CALL __attribute__((__cdecl__)) __attribute__((__regparm__(3)))
400 #endif
401 # endif
402 
403 # if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7))
404 # define OME_DEPRECATED_BECAUSE(msg) __attribute__((deprecated(msg)))
405 
406 # define OME_ALWAYS_OPTIMIZE(level) __attribute__((optimize(level)))
407 # else
408 /* compiler is too old... */
409 # define OME_DEPRECATED_BECAUSE(msg) __attribute__((deprecated))
410 # endif
411 
412 #endif /* end GNUC */
413 
414 #ifdef _MSC_VER /* Microsoft Visual C++ */
415 /* override was present in Microsoft Visual C++ 2005 */
416 # if _MSC_VER >= 1400
417 # define VIRTUAL_OVERRIDE override
418 # endif
419 /* constexpr recognized in Visual Studio 2015 */
420 # if _MSV_VER >= 1900
421 # define CONSTEXPR constexpr
422 # endif
423 
424 # define AN_ENUM(x) ((uint32_t)(x))
425 #endif
426 
427 #if __cplusplus >= 201100
428 # ifndef EXPLICIT_CONVERSION
429 # define EXPLICIT_CONVERSION explicit
430 # endif
431 # ifndef CONSTEXPR
432 # define CONSTEXPR constexpr
433 # endif
434 # ifndef VIRTUAL_OVERRIDE
435 # define VIRTUAL_OVERRIDE override
436 # endif
437 # ifndef NOEXCEPT_SPECIFIER
438 # define NOEXCEPT_SPECIFIER noexcept
439 # endif
440 #endif
441 
442 /* If noexcept keyword is not supported, then hide it */
443 #ifndef NOEXCEPT_SPECIFIER
444 # define NOEXCEPT_SPECIFIER
445 #endif
446 /* If override keyword is not supported, then hide it */
447 #ifndef VIRTUAL_OVERRIDE
448 # define VIRTUAL_OVERRIDE
449 #endif
450 /* If explicit keyword is not supported, then hide it */
451 #ifndef EXPLICIT_CONVERSION
452 # define EXPLICIT_CONVERSION
453 #endif
454 /* If constexpr keyword is not supported, then use default or const */
455 #ifndef CONSTEXPR
456 # ifdef _GLIBCXX_USE_CONSTEXPR
457 # define CONSTEXPR _GLIBCXX_USE_CONSTEXPR /* use whatever the config wants */
458 # else
459 # define CONSTEXPR const
460 # endif
461 #endif /* CONSTEXPR */
462 
463 #ifndef OME_DLL_EXPORT
464 # define OME_DLL_EXPORT /* nothing */
465 #endif
466 
467 #ifndef OME_FAST_CALL
468 # define OME_FAST_CALL /* nothing */
469 #endif
470 
471 #ifndef OME_CORE_CALL
472 # define OME_CORE_CALL /* nothing */
473 #endif
474 
475 #ifndef OME_EXPECT
476 # define OME_EXPECT(expr, expected) (expr)
477 #endif
478 #ifndef OME_PREFETCH
479 # define OME_PREFETCH(addr, rw, locality) /* nothing -- make it go away */
480 #endif
481 
482 #ifndef OME_FAST_CALL
483 # define OME_FAST_CALL
484 #endif
485 #ifndef OME_ALWAYS_INLINE
486 # define OME_ALWAYS_INLINE
487 #endif
488 #ifndef OME_NEVER_INLINE
489 # define OME_NEVER_INLINE
490 #endif
491 #ifndef OME_ALWAYS_FLATTEN
492 # define OME_ALWAYS_FLATTEN
493 #endif
494 #ifndef OME_COLD_ROUTINE
495 # define OME_COLD_ROUTINE
496 #endif
497 #ifndef OME_ALWAYS_OPTIMIZE
498 # define OME_ALWAYS_OPTIMIZE(level)
499 #endif
500 #ifndef OME_INIT_PRIORITY
501 # define OME_INIT_PRIORITY(n)
502 #endif
503 #ifndef OME_DEPRECATED
504 # define OME_DEPRECATED
505 #endif
506 #ifndef OME_DEPRECATED_BECAUSE
507 # define OME_DEPRECATED_BECAUSE(msg)
508 #endif
509 #ifndef OME_USAGE_WARNING
510 # define OME_USAGE_WARNING(msg)
511 #endif
512 #ifndef OME_USAGE_ERROR
513 # define OME_USAGE_ERROR(msg)
514 #endif
515 #ifndef OME_USED
516 # define OME_USED
517 #endif
518 #ifndef OME_UNUSED
519 # define OME_UNUSED
520 #endif
521 #ifndef OME_WEAK
522 #define OME_WEAK
523 #endif
524 #ifndef OME_PURE_FUNCTION
525 # define OME_PURE_FUNCTION
526 #endif
527 #ifndef OME_CONST_FUNCTION
528 # define OME_CONST_FUNCTION
529 #endif
530 #ifndef NONNULL_PARAMETERS
531 # define NONNULL_PARAMETERS(...)
532 #endif
533 #ifndef NONNULL_CLASS_PARAMETERS
534 # define NONNULL_CLASS_PARAMETERS(...)
535 #endif
536 #ifndef NONNULL_RETURN
537 # define NONNULL_RETURN
538 #endif
539 
540 #define OME_EXPECT_FALSE(expr) OME_EXPECT(expr, false)
541 #define OME_EXPECT_TRUE(expr) OME_EXPECT(expr, true)
542 
543 #ifdef _WIN32
544 # define OME_YIELD_THREAD() SwitchToThread()
545 #else
546 # ifdef _POSIX_PRIORITY_SCHEDULING
547 # define OME_YIELD_THREAD() sched_yield()
548 # endif /* _POSIX_PRIORITY_SCHEDULING */
549 #endif /* _WIN32 */
550 
551 #ifndef OME_YIELD_THREAD /* not yet defined... */
552 
554 # define OME_YIELD_THREAD() \
555  do { \
556  struct timespec nano_delay = {0, 0}; \
557  nanosleep(&nano_delay, 0); \
558  } while (0)
559 #endif
560 
561 /* If desired to use CPU prefetch instructions, enable the following: */
562 #ifdef __GNUC__ /* GNU C++ Compiler */
563 # define USE_GCC_PREFETCH 1
564 #ifdef MemoryBarrier
565 #undef MemoryBarrier
566 #endif
567 # define MemoryBarrier() __sync_synchronize()
568 #else
569 # define USE_GCC_PREFETCH 0
570 #endif
571 
576 #define CACHE_LINE_LENGTH 64
577 
580 #define MAX_PREFETCH_REQUESTS 8
581 
582 #ifndef DO_PREFETCH
583 # if USE_GCC_PREFETCH == 1
584 /* use CPU prefetch instructions */
585 # define DO_PREFETCH(a) OME_PREFETCH(a, 0, 1)
586 # else
587 /* trigger read of cache line */
588 # define DO_PREFETCH(a) p_fetch += *a
589 # endif
590 
591 # ifndef _MSC_VER
592 # define OME_PREFETCH_OBJECT_VTABLE(obj, relativeFunction) \
593  do { /* open scope */ \
594  unsigned char ***vTablePtr = (unsigned char ***) (obj); /* get hidden v-table pointer */ \
595  unsigned char **vTableBase = *vTablePtr; /* read v-table pointer */ \
596  unsigned char **funcPtrAddr = vTableBase + relativeFunction; \
597  OME_PREFETCH(funcPtrAddr, 0, 3); /* read-only, retain */ \
598  } while (0)
599 # else
600 # define OME_PREFETCH_OBJECT_VTABLE(obj, relativeFunction) \
601  do { \
602  } while (0)
603 # endif
604 
605 extern inline int prefetch_memory_block(const void *addr,
606  const unsigned int len) OME_ALWAYS_INLINE;
607 
625 inline int prefetch_memory_block(const void *addr,
626  const unsigned int len)
627 {
628  enum {
629  CACHE_LINE_LENGTH_IN_WORDS = (CACHE_LINE_LENGTH / sizeof(int_fast32_t))
630  };
631  int cache_bytes = len - sizeof(int_fast32_t);
632  if (cache_bytes <= 0) {
633  return (0); /* not enough to cache */
634  }
635  int cache_lines = cache_bytes / CACHE_LINE_LENGTH;
636  if (cache_lines >= MAX_PREFETCH_REQUESTS) {
637  cache_lines = MAX_PREFETCH_REQUESTS - 1;
638  }
639 
640 # if USE_GCC_PREFETCH == 0
641  int p_fetch = 0;
642 # endif
643  /* cast as integer pointer for speed */
644  const int_fast32_t *a = (const int_fast32_t *)(addr);
645 
646  /* With a switch() statement using a dense set of values, most compilers
647  * should generate an efficient jump table.
648  * The various cases fall through to the subsequent case, which
649  * serves to unroll the loop.
650  */
651  switch (cache_lines) {
652  default:
653  case 7:
654  DO_PREFETCH(a);
656  case 6:
657  DO_PREFETCH(a);
659  case 5:
660  DO_PREFETCH(a);
662  case 4:
663  DO_PREFETCH(a);
665  case 3:
666  DO_PREFETCH(a);
668  case 2:
669  DO_PREFETCH(a);
671  case 1:
672  DO_PREFETCH(a);
674  case 0:
675  DO_PREFETCH(a);
676  }
677 # if USE_GCC_PREFETCH == 1
678  return (0);
679 # else
680  return (p_fetch);
681 # endif
682 }
683 #endif /* #ifndef DO_PREFETCH */
684 
685 
696 #define safe_strcpy(d, s, l) ((memccpy(d, s, 0, (l)) == 0) ? (*(d + (l) -1) = 0) : 1)
697 
698 #ifdef __cplusplus
699 
743 #pragma GCC diagnostic push
744 #pragma GCC diagnostic ignored "-Wmissing-attributes"
745 template <uint_fast8_t N> char *do_copyShortStringUntil(char *bfr, const char *src, const char stopAt = '\0', const char altStopAt = '\0') OME_ALWAYS_INLINE OME_ALWAYS_FLATTEN OME_ALWAYS_OPTIMIZE("-O3") NONNULL_PARAMETERS(1, 2) NONNULL_RETURN;
746 
747 template <> inline char *do_copyShortStringUntil<0>(char *bfr, const char *src, const char stopAt, const char altStopAt) OME_ALWAYS_INLINE OME_ALWAYS_FLATTEN OME_ALWAYS_OPTIMIZE("-O3") NONNULL_PARAMETERS(1, 2) NONNULL_RETURN;
748 
749 // halt recursion with zero length string
750 template <> inline char *do_copyShortStringUntil<0>(char *bfr, const char *src, const char stopAt, const char altStopAt)
751 {
752  return (bfr);
753 }
754 
755 template <uint_fast8_t N> inline char *do_copyShortStringUntil(char *bfr, const char *src, const char stopAt, const char altStopAt)
756 {
757  char c = *src;
758  /* Set expectation bias based upon how close the end we are;
759  * the closer to the end, the higher the probability that one
760  * will have seen a stop character.
761  * For now, evaluate in terms of distance remaining, which will
762  * be ineffective with large buffers. Ideally, determined
763  * based on actual size of buffer, perhaps via second template
764  * argument.
765  */
766  enum { AVE_LEN_LEFT = 2 };
767  if (OME_EXPECT(((c == stopAt) || (c == altStopAt)), (N <= AVE_LEN_LEFT))) {
768  return (bfr);
769  }
770  *bfr = c;
771  return (do_copyShortStringUntil < N - 1 > (bfr + 1, src + 1, stopAt));
772 }
773 
774 #pragma GCC diagnostic pop
775 
802 template <uint_fast8_t N> char *copyShortStringUntil(char *bfr, const char *src, const char stopAt = '\0', const char altStopAt = '\0', const bool truncateIfNeeded = false) OME_ALWAYS_INLINE OME_ALWAYS_FLATTEN OME_ALWAYS_OPTIMIZE("-O3") NONNULL_PARAMETERS(1, 2) NONNULL_RETURN;
803 
804 template <uint_fast8_t N> inline char *copyShortStringUntil(char *bfr, const char *src, const char stopAt, const char altStopAt, const bool truncateIfNeeded)
805 {
806  // expand templated implementation to copy string
807  char *end = do_copyShortStringUntil<N>(bfr, src, stopAt, altStopAt);
808  // NOTE: this test gets dropped if truncateIfNeeded is false at compile time
809  if ((truncateIfNeeded == true) && (end == (bfr + N))) { // copied buffer until full
810  end -= 1;
811  }
812  *end = '\0';
813  return (bfr);
814 }
815 
840 template <uint_fast8_t N> uint_fast32_t copyShortStringUntilAndReturnLength(char *bfr, const char *src, const char stopAt = '\0', const char altStopAt = '\0', const bool truncateIfNeeded = false) OME_ALWAYS_INLINE OME_ALWAYS_FLATTEN OME_ALWAYS_OPTIMIZE("-O3") NONNULL_PARAMETERS(1, 2);
841 
842 template <uint_fast8_t N> inline uint_fast32_t copyShortStringUntilAndReturnLength(char *bfr, const char *src, const char stopAt, const char altStopAt, const bool truncateIfNeeded)
843 {
844  // expand templated implementation to copy string
845  char *end = do_copyShortStringUntil<N>(bfr, src, stopAt, altStopAt);
846  // NOTE: this test gets dropped if truncateIfNeeded is false at compile time
847  if ((truncateIfNeeded == true) && (end == (bfr + N))) { // copied buffer until full
848  end -= 1;
849  }
850  *end = '\0';
851  // compute length and return
852  return (static_cast<uint_fast32_t>(end - bfr));
853 }
854 
855 
865 const char *demangleEncodedTypeName(const char *name, char *bfr, uint32_t bfrLen) NONNULL_PARAMETERS(1, 2) NONNULL_RETURN;
866 inline const char *demangleEncodedTypeName(const char *name, char *bfr, uint32_t bfrLen)
867 {
868 # ifndef _WIN32
869  int result;
870  char *readableName = abi::__cxa_demangle(name, 0, 0, &result);
871  safe_strcpy(bfr, readableName, bfrLen);
872  ::free(readableName);
873 # else
874 # if 0 /* if DbgHelp library is around... */
875  UnDecorateSymbolName(name, bfr, bfrLen, 0);
876 # else
877  safe_strcpy(bfr, name, bfrLen);
878 # endif
879 # endif
880  return (bfr);
881 }
882 
902 template <typename TYPENAME>
903 inline const char *demangledTypeName(char *bfr, uint32_t bfrLen)
904 {
905  return (demangleEncodedTypeName(typeid(TYPENAME).name(), bfr, bfrLen));
906 }
907 
928 #define demangledTypeIdName(typeid_var, bfr) demangleEncodedTypeName((typeid_var).name(), bfr, sizeof(bfr))
929 
930 #endif /* only for C++ */
931 
932 /* vim: set expandtab shiftwidth=4 tabstop=4: */
933 #endif
INIT_DECLARE_clPI
OME_DLL_EXPORT void INIT_DECLARE_clPI()
Definition: clPI.cpp:1790
OMEthread::threadContext
OMEtype threadContext
Definition: OMEthread.h:77
safe_strcpy
#define safe_strcpy(d, s, l)
Safe strcpy() routine that will not copy more than l bytes and always ensures that a null is present ...
Definition: compiler_hints.h:696
OMEcallStack::threadStack
void * threadStack
Definition: OMEthread.h:41
OMEcallStack::thisMethod
OMEtype thisMethod
Definition: OMEthread.h:36
base64ToASCII
int base64ToASCII(OMEthread *thread, OMEtype &result, const OMEtype &source)
Definition: OILmimeDecode.cpp:338
OME_NLM
@ OME_NLM
Definition: OMEmanifests.h:90
OMEtype::initializeAsType
void initializeAsType(const enum OMEtypes_t t)
The fundamental tagged data type used through the FARGOS/VISTA infrastructure.
Definition: OMEtype.cpp:95
DO_PREFETCH
#define DO_PREFETCH(a)
Prefetch an address line for read.
Definition: compiler_hints.h:585
OMEdefineNewClass
OMEclass * OMEdefineNewClass(const OMEstring &nmSpaceArg, const OMEstring &classNameArg, const uint32_t verID, const uint32_t iSize, const bool unique, int *errCode, const CreateInstanceFP csRoutine, const DeleteInstanceFP dsRoutine)
Create new class entry.
Definition: OMEnamespace.cpp:198
OME_ALWAYS_FLATTEN
#define OME_ALWAYS_FLATTEN
Annotation macro to request compiler to always inline body and any called routines.
Definition: compiler_hints.h:368
OMEokToAssignTypes
bool OMEokToAssignTypes(uint32_t srcType, uint32_t targetType, OMEthread *t)
Definition: OMEthread.cpp:1260
prefetch_memory_block
int prefetch_memory_block(const void *addr, const unsigned int len) OME_ALWAYS_INLINE
Prefetch a memory block into the CPU's cache.
Definition: compiler_hints.h:625
compressString
int compressString(OMEthread *thread, OMEtype &result, const OMEtype &data)
Definition: OILencode.cpp:100
OMEthread::returnReply
OME_FAST_CALL int returnReply(const OMEtype &result)
Definition: OMEthread.cpp:730
OMEthread::yieldSlice
void yieldSlice()
Definition: OMEthread.cpp:1112
OMEthread::getThisObject
const OMEtype & getThisObject() const OME_ALWAYS_INLINE
Definition: OMEthread.h:152
OMEthread::callMethodWithSetArgument
OME_FAST_CALL int callMethodWithSetArgument(const OMEtype &methodName, const uint32_t hashIndx, const OMEtype &argSet)
Definition: OMEthread.cpp:678
OMEruntime.h
asciiToBase64
int asciiToBase64(OMEthread *thread, OMEtype &result, const OMEtype &source, const OMEtype &breakIntoLines)
Definition: OILmimeDecode.cpp:318
uncompressString
int uncompressString(OMEthread *thread, OMEtype &result, const OMEtype &data)
Definition: OILencode.cpp:118
encodeData
int encodeData(OMEthread *thread, OMEtype &result, const OMEtype &data, const OMEtype &version)
Definition: OILencode.cpp:26
OMEclass::setStorageDescription
int setStorageDescription(const struct OMEinstanceVarDescr *desc)
Definition: OMEclass.cpp:224
OMEtype::value
union OMEtype::@26 value
OMEtype
Fundamental ANY type for FARGOS/VISTA Object Management Environment.
Definition: OMEbaseType.h:250
OMEthread::noteLineNumber
void noteLineNumber(int line, const char *fileName=nullptr) OME_ALWAYS_INLINE
Definition: OMEthread.h:193
decodeData
int decodeData(OMEthread *thread, OMEtype &result, const OMEtype &data)
Definition: OILencode.cpp:61
OME_DOUBLE
@ OME_DOUBLE
Definition: OMEmanifests.h:83
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
OMEshareConstant
const OMEstring & OMEshareConstant(const OMEstring &stringConstant)
Definition: OMEnamespace.cpp:338
OMEstringInROM
const typedef void * OMEstringInROM
Points to immovable, read-only string data.
Definition: OMEstring.h:68
copyShortStringUntil
char * copyShortStringUntil(char *bfr, const char *src, const char stopAt='\0', const char altStopAt='\0', const bool truncateIfNeeded=false) OME_ALWAYS_INLINE OME_ALWAYS_FLATTEN OME_ALWAYS_OPTIMIZE("-O3") NONNULL_PARAMETERS(1
Templated C++-only variant of safe_strcpy() suitable for handling small-sized strings that are being ...
Definition: compiler_hints.h:804
registerService
OME_CORE_CALL int registerService(class OMEthread *thread, OMEtype &result, const OMEtype &name, const OMEtype &obj, const OMEtype &flag)
Definition: OMEthread.cpp:118
priorIndex
int priorIndex(OMEthread *thread, OMEtype &result, const OMEtype &array, const OMEtype &subscript)
Definition: OILtypeFuncs.cpp:416
OMEcallStack::argv
OMEtype argv
Definition: OMEthread.h:38
NONNULL_PARAMETERS
#define NONNULL_PARAMETERS(...)
Mark parameters to a function as not permitting null pointers.
Definition: compiler_hints.h:335
OMEtype::i
int32_t i
Definition: OMEbaseType.h:285
OMEinstanceVarDescr
Meta data record to describe an instance variable of a class.
Definition: OMEnamespace.h:76
OMEthread::exitRoutine
void exitRoutine()
Definition: OMEthread.cpp:1004
OMEclass
FARGOS/VISTA Object Management Environment class description.
Definition: OMEclass.h:24
getSystemInfo
int getSystemInfo(OMEthread *thread, OMEtype &result)
Definition: OILtime.cpp:31
OMEthread::suspendThread
void suspendThread()
Definition: OMEthread.cpp:1086
CACHE_LINE_LENGTH_IN_WORDS
#define CACHE_LINE_LENGTH_IN_WORDS
Definition: tmp.o.cpp:30
OMEmethodDefinition
Define method implementation.
Definition: OMEnamespace.h:86
OMEclass::resolveLinkages
int resolveLinkages(OMEstring *missingClassName=nullptr, uint32_t *missingClassVersionID=nullptr)
Attempt to resolve inheritance tree.
Definition: OMEclass.cpp:428
OMEthread::replyStillPending
bool replyStillPending() const OME_ALWAYS_INLINE
Definition: OMEthread.h:113
OMEcallStack::argc
OMEtype argc
Definition: OMEthread.h:37
arrayToSet
int arrayToSet(OMEthread *thread, OMEtype &result, const OMEtype &arg)
Definition: OILtypeFuncs.cpp:571
relativePathToAbsolute
int relativePathToAbsolute(OMEthread *thread, OMEtype &result, const OMEtype &currentDir, const OMEtype &path)
Definition: OILhttpFuncs.cpp:186
OME_STRING
@ OME_STRING
Definition: OMEmanifests.h:85
nextIndex
int nextIndex(OMEthread *thread, OMEtype &result, const OMEtype &array, const OMEtype &subscript)
Definition: OILtypeFuncs.cpp:396
do_copyShortStringUntil
char * do_copyShortStringUntil(char *bfr, const char *src, const char stopAt='\0', const char altStopAt='\0') OME_ALWAYS_INLINE OME_ALWAYS_FLATTEN OME_ALWAYS_OPTIMIZE("-O3") NONNULL_PARAMETERS(1
Templated C++-only routine similar to memccpy() that is suitable for handling short strings that are ...
Definition: compiler_hints.h:755
OMEthread::sendMessageWithSetArgument
OME_FAST_CALL int sendMessageWithSetArgument(const OMEtype &methodName, const uint32_t hashIndx, const OMEtype &argSet, const OMEtype &destObj, const OMEtype &fromObj, const int32_t timeout)
Definition: OMEthread.cpp:593
getTicksSinceBoot
int getTicksSinceBoot(OMEthread *thread, OMEtype &result)
Definition: OILtime.cpp:94
CACHE_LINE_LENGTH
#define CACHE_LINE_LENGTH
Definition for target system's cache line length.
Definition: compiler_hints.h:576
INIT_DECLARE
OME_DLL_EXPORT void INIT_DECLARE()
Definition: clTest.cpp:11826
OME_NIL
@ OME_NIL
Definition: OMEmanifests.h:78
OMEthread::getReplyOID
const OMEtype & getReplyOID()
Definition: OMEthread.h:125
OME_OID
@ OME_OID
Definition: OMEmanifests.h:84
getLocalRelativeTime
int getLocalRelativeTime(OMEthread *thread, OMEtype &result)
Definition: OILtime.cpp:76
getRelativeMilliseconds
int getRelativeMilliseconds(OMEthread *thread, OMEtype &result)
Definition: OILtime.cpp:85
OMEdefineNewMethod
int OMEdefineNewMethod(const OMEmethodDefinition &definitionRecord)
Definition: OMEnamespace.cpp:248
pathComponentsToString
int pathComponentsToString(OMEthread *thread, OMEtype &result, const OMEtype &elements, const OMEtype &startIndex, const OMEtype &stopIndex)
Definition: OILhttpFuncs.cpp:237
OMEthread::callStack
OMEcallStack * callStack
Definition: OMEthread.h:74
unregisterService
OME_CORE_CALL int unregisterService(class OMEthread *thread, OMEtype &result, const OMEtype &name, const OMEtype &obj)
Definition: OMEthread.cpp:162
OMEthread::getReplyResult
const OMEtype & getReplyResult() const OME_ALWAYS_INLINE
Definition: OMEthread.h:177
display
int display(OMEthread *thread, OMEtype &result, const OMEtype &argSet)
Definition: OILdebug.cpp:112
typeOf
int typeOf(OMEthread *thread, OMEtype &result, const OMEtype &arg)
Definition: OILtypeFuncs.cpp:127
OME_EXPECT
#define OME_EXPECT(expr, expected)
Annotation macro for conditional expression to indicate expected Boolean outcome.
Definition: compiler_hints.h:360
createNewOIDthatOnlyAllowsOthers
OME_CORE_CALL int createNewOIDthatOnlyAllowsOthers(class OMEthread *thread, OMEtype &result, const OMEtype &args)
Definition: OMEobjACL.cpp:338
OMEthread::fromObject
OMEtype fromObject
Definition: OMEthread.h:78
demangledTypeName
const char * demangledTypeName(char *bfr, uint32_t bfrLen)
Templated convenience function that obtains the demangled type name of a C++ type.
Definition: compiler_hints.h:903
alwaysAllow
int alwaysAllow(OMEthread *thread, OMEtype &result, const OMEtype &methodName)
Definition: OILallow.cpp:20
demangleEncodedTypeName
const char * demangleEncodedTypeName(const char *name, char *bfr, uint32_t bfrLen) NONNULL_PARAMETERS(1
Demangles a C++ encoded type name into its human-readable name.
Definition: compiler_hints.h:866
allow
int allow(OMEthread *thread, OMEtype &result, const OMEtype &methodName)
Definition: OILallow.cpp:5
OME_SET
@ OME_SET
Definition: OMEmanifests.h:89
copyShortStringUntilAndReturnLength
uint_fast32_t copyShortStringUntilAndReturnLength(char *bfr, const char *src, const char stopAt='\0', const char altStopAt='\0', const bool truncateIfNeeded=false) OME_ALWAYS_INLINE OME_ALWAYS_FLATTEN OME_ALWAYS_OPTIMIZE("-O3") NONNULL_PARAMETERS(1
Similar to copyShortStringUntil<>(), but returns the number of bytes before the trailing null....
OME_ALWAYS_INLINE
#define OME_ALWAYS_INLINE
Tell the compiler to alway inline a function, regardless of optimization level.
Definition: compiler_hints.h:364
OMEinvocationData
Record to describe the implementation of the method of an OME class.
Definition: OMEmethod.h:35
parsePathComponents
int parsePathComponents(OMEthread *thread, OMEtype &result, const OMEtype &path)
Definition: OILhttpFuncs.cpp:133
elementCount
int elementCount(OMEthread *thread, OMEtype &result, const OMEtype &arg)
Definition: OILtypeFuncs.cpp:168
OMEthread::setResultPending
void setResultPending() OME_ALWAYS_INLINE
Definition: OMEthread.h:111
OME_DLL_EXPORT
#define OME_DLL_EXPORT
Definition: compiler_hints.h:464
lookupLocalService
OME_CORE_CALL int lookupLocalService(class OMEthread *thread, OMEtype &result, const OMEtype &name)
Definition: OMEthread.cpp:190
MAX_PREFETCH_REQUESTS
#define MAX_PREFETCH_REQUESTS
Maximum number of prefetch requests supported by the hardware.
Definition: compiler_hints.h:580
OMEthread
Public interface to an OME thread.
Definition: OMEthread.h:60
OMEcallStack::programCounter
uint32_t programCounter
Definition: OMEthread.h:39
OMEthread::getInstanceData
OME_FAST_CALL void * getInstanceData() const
Definition: OMEthread.cpp:1036
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
OMEclass::inheritFromClass
int inheritFromClass(const OMEstring &nameSpace, const OMEstring &name, const uint32_t verID=0, const bool unique=false)
Definition: OMEclass.cpp:349
makeDefaultACL
OME_CORE_CALL int makeDefaultACL(class OMEthread *thread, OMEtype &result)
Definition: OMEobjACL.cpp:267
SHA1hash
int SHA1hash(OMEthread *thread, OMEtype &result, const OMEtype &message)
Definition: OILcrypto.cpp:9
createNLM
int createNLM(OMEthread *thread, OMEtype &result, const OMEtype &catName, const OMEtype &messID, const OMEtype &defaultMess, const OMEtype &args, const OMEtype &extras)
Definition: OILtypeFuncs.cpp:810
OMEgetObjectCreatorOID
OMEtype & OMEgetObjectCreatorOID(const OMEtype &userInfo)
Definition: OMEcreate.cpp:117
displayAsHex
int displayAsHex(OMEthread *thread, OMEtype &result, const OMEtype &args)
Definition: OILdebug.cpp:260
INIT_DECLARE
OME_DLL_EXPORT void INIT_DECLARE()
Definition: clPlayWinSound.cpp:697
free
void free(char *block)
Definition: test_malloc.c:553
length
int length(OMEthread *thread, OMEtype &result, const OMEtype &arg)
Definition: OILtypeFuncs.cpp:19
OME_CORE_CALL
#define OME_CORE_CALL
Definition: compiler_hints.h:472
OME_ARRAY
@ OME_ARRAY
Definition: OMEmanifests.h:86
OMEthread::setPC
OME_FAST_CALL void setPC(uint32_t pc) OME_ALWAYS_INLINE
Definition: OMEthread.h:165
_OMEfixedConstant
Internal data type to generate fixed-point constant from floating-point value.
Definition: OMEfixed.h:26
OMEthread::getUserID
const OMEtype & getUserID() const OME_ALWAYS_INLINE
Definition: OMEthread.h:146
NONNULL_RETURN
#define NONNULL_RETURN
Mark a function as never returning a null pointer.
Definition: compiler_hints.h:339
OME_INVOKE_OIL2_NATIVE
#define OME_INVOKE_OIL2_NATIVE
Definition: OMEmethod.h:12
OME_ASSOC
@ OME_ASSOC
Definition: OMEmanifests.h:87
OMEthread::noteObjectModified
void noteObjectModified() OME_ALWAYS_INLINE
Definition: OMEthread.h:191
OME_INT32
@ OME_INT32
Definition: OMEmanifests.h:79
OME_INT64
@ OME_INT64
Definition: OMEmanifests.h:81
Generated: Tue Jul 28 2020 16:03:25
Support Information