FARGOS/VISTA Object Management Environment Core
..
|
Utility functions for the FARGOS/VISTA Object Management Environment and attached applications. More...
Classes | |
class | OMEentityID |
Identifies an instance of an OME process. More... | |
class | OMEthisProcessInfo |
Uniquely identifies an OME process. More... | |
Macros | |
#define | OME_MUTEX_TYPE pthread_mutex_t |
#define | OME_CONDITION_TYPE pthread_cond_t |
#define | OME_MAX_CPUS_PERMITTED 128 |
#define | OMEgetCPUticks() get_CPU_ticks() |
Typedefs | |
typedef void *(* | OMEnativeTaskFP) (void *) |
Functions | |
OME_DLL_EXPORT uint32_t | OMEhash (const unsigned char *data, const uint32_t len) NONNULL_PARAMETERS(1) |
Fast 32-bit hash over a buffer. More... | |
OME_DLL_EXPORT uint32_t | OMEhash (const OMEstring &data) |
Fast 32-bit hash of an OMEstring. More... | |
OME_DLL_EXPORT uint32_t | OMEmethodSignature (const int argc, const uint32_t types[], uint32_t *anyMask=nullptr) |
Compute 32-bit signature of a method's arguments. More... | |
OME_DLL_EXPORT OMEstring * | OMEfindFileInPathSpec (const OMEstring &fileName, const OMEstring &path) |
Search for a file located within a set of directories specified by a string path. More... | |
OME_DLL_EXPORT OMEstring * | OMEfindFileInDirectory (const OMEstring &fileName, const OMEarray &dirList) |
Search for a file located within a list of directories specified as elements of an OMEarray. More... | |
OME_DLL_EXPORT OMEarray * | OMEparsePathSpecification (const OMEstring &pathSpec) |
Parse a list of directories specified by a string path into an sequence of OMEarray elements. More... | |
OME_DLL_EXPORT OMEarray * | OMElistDirectory (const OMEstring &dirName, int *errRet=nullptr) |
List all files within a filesystem directory. More... | |
OME_DLL_EXPORT int | OMEconvertLocalRelativeTimeToAbsolute (OMEtype &result, uint32_t tArg, int asGMT) |
Convert a local relative time to an OME absolute time reference. More... | |
OME_DLL_EXPORT uint32_t | OMEconvertAbsoluteToLocalRelativeTime (const OMEtype &tData) |
Convert an OME absolute time reference to a local relative time. More... | |
OME_DLL_EXPORT int | OMErfc1123Date (OMEtype &result, const OMEtype &argData) |
Format an OME absolute time reference as a data and time in RFC 1123 format. More... | |
OME_DLL_EXPORT int | OMEiso8601Date (OMEtype &result, const OMEtype &argData) |
Format an OME absolute time reference as a date and time in ISO 8601 format. More... | |
OME_DLL_EXPORT int | OMEconvertRFC1123date (OMEtype &result, const OMEtype &timeString) |
Convert a text string in RFC 1123 format into an OME absolute time reference. More... | |
OME_DLL_EXPORT int | OMEtimeDifference (const OMEtype &time1, const OMEtype &time2) |
Compute difference between two OME absolute time references. More... | |
OME_DLL_EXPORT int | OMEtransportToSockaddr (union sockBigEnough *sock, uint_fast16_t *sockLen, int *sockMode, const char *url, uint_fast16_t urlLen) NONNULL_PARAMETERS(1 |
OME_DLL_EXPORT int OME_DLL_EXPORT OMEstring * | OMEdisplayableAddress (const struct sockaddr *sock, const int len, const uint32_t openMode) NONNULL_PARAMETERS(1) |
Convert sockaddr data into a text string. More... | |
OME_DLL_EXPORT int | OMEgetInterfaces (OMEtype &result) |
OME_DLL_EXPORT void | OMEstartCriticalSection (eOMEcriticalSectionLabel regionID) |
OME_DLL_EXPORT void | OMEendCriticalSection (eOMEcriticalSectionLabel regionID) |
OME_DLL_EXPORT bool | OMEinitStandardCriticalSectionMutexes () |
OME_DLL_EXPORT bool | OMEinitCriticalSectionMutex (OME_MUTEX_TYPE *, bool recursive=false) NONNULL_PARAMETERS(1) |
OME_DLL_EXPORT int | OMEdestroyCriticalSectionMutex (OME_MUTEX_TYPE *) NONNULL_PARAMETERS(1) |
OME_DLL_EXPORT uint32_t | OMEgetMiscellaneousMutex () OME_CONST_FUNCTION |
OME_DLL_EXPORT int | OMEinitConditionVariable (OME_CONDITION_TYPE *) |
OME_DLL_EXPORT int | OMEdestroyConditionVariable (OME_CONDITION_TYPE *) NONNULL_PARAMETERS(1) |
OME_DLL_EXPORT int | OMEwaitForCondition (OME_CONDITION_TYPE *, eOMEcriticalSectionLabel mutexId) NONNULL_PARAMETERS(1) |
OME_DLL_EXPORT int | OMEsetConditionVariable (OME_CONDITION_TYPE *) NONNULL_PARAMETERS(1) |
OME_DLL_EXPORT uint64_t | OMEcallWithNativeThread (OMEnativeTaskFP func, void *functionArg) |
OME_DLL_EXPORT int | OMEwaitForNativeThread (uint64_t pid, void **retValue) |
template<typename STREAMTYPE > | |
STREAMTYPE & | operator<< (STREAMTYPE &outputStream, const OMEentityID &data) |
OME_DLL_EXPORT OMEstring * | OMEgetUserName () |
Return the name of the user associated with the process. More... | |
OME_DLL_EXPORT int64_t | OMErelativeMilliseconds () |
Return a monotonically-increasing count of elapsed milliseconds. More... | |
OME_DLL_EXPORT int64_t | OMEmillisecondsSinceBoot () |
Obtain the number of milliseconds since boot of local FARGOS/VISTA Object Management Environment process. More... | |
OME_DLL_EXPORT int64_t | OMEticksSinceBoot () |
Obtain the number of CPU ticks since boot of local FARGOS/VISTA Object Management Environment process. More... | |
Variables | |
OME_DLL_EXPORT OMEthisProcessInfo | OMEcurrentProcessInfo |
Automatic instantiation of OMEthisProcessInfo. When properly linked, the C++ static constructor mechanism enables the automatic creation of the OMEcurrentProcessInfo variable within applications that link against the FARGOS/VISTA types library. More... | |
Utility functions for the FARGOS/VISTA Object Management Environment and attached applications.
#define OME_CONDITION_TYPE pthread_cond_t |
#define OME_MAX_CPUS_PERMITTED 128 |
#define OME_MUTEX_TYPE pthread_mutex_t |
#define OMEgetCPUticks | ( | ) | get_CPU_ticks() |
typedef void*(* OMEnativeTaskFP) (void *) |
OME_DLL_EXPORT uint64_t OMEcallWithNativeThread | ( | OMEnativeTaskFP | func, |
void * | functionArg | ||
) |
References NULL.
OME_DLL_EXPORT uint32_t OMEconvertAbsoluteToLocalRelativeTime | ( | const OMEtype & | tData | ) |
Convert an OME absolute time reference to a local relative time.
tData | specifies the OME absolute time reference. |
~0 | indicates an invalid absolute data was specified. |
References OMEtype::assoc, GMT_OFFSET, LOCALtime, OME_ASSOC, OMEtype::type, and OMEtype::value.
Referenced by convertAbsoluteToLocalRelativeTime(), and OMEtimeDifference().
OME_DLL_EXPORT int OMEconvertLocalRelativeTimeToAbsolute | ( | OMEtype & | result, |
uint32_t | tArg, | ||
int | asGMT | ||
) |
Convert a local relative time to an OME absolute time reference.
result | will hold the converted OME absolute time reference. |
tArg | specifies the local relative time. |
asGMT | is a Boolean flag that indicates if the absolute time reference should be in GMT or the local time zone. |
References GMT_OFFSET, OMEtype::initializeAsType(), LOCALtime, OME_ASSOC, and TIMEZONE_NAME.
Referenced by convertLocalRelativeTimeToAbsolute(), and main().
OME_DLL_EXPORT int OMEconvertRFC1123date | ( | OMEtype & | result, |
const OMEtype & | timeString | ||
) |
Convert a text string in RFC 1123 format into an OME absolute time reference.
result | will hold the converted absolute time reference. |
timeString | specifies a time and date in RFC 1123 format. |
References OME_STRING, OMEtype::s, OMEtype::type, and OMEtype::value.
Referenced by convertRFC1123date().
OME_DLL_EXPORT int OMEdestroyConditionVariable | ( | OME_CONDITION_TYPE * | ) |
OME_DLL_EXPORT int OMEdestroyCriticalSectionMutex | ( | OME_MUTEX_TYPE * | ) |
OME_DLL_EXPORT int OME_DLL_EXPORT OMEstring* OMEdisplayableAddress | ( | const struct sockaddr * | sock, |
const int | len, | ||
const uint32_t | openMode | ||
) |
Convert sockaddr data into a text string.
sock | points to the sockaddr structure |
len | indicates the length of the sockaddr data. |
openMode | is a bit mask indicating special attributes. OME_IO_RAW and OME_IO_DATAGRAM are the flags currently tested. |
References if_indextoname(), ntohs, OME_IO_DATAGRAM, OME_IO_RAW, OUR_sockaddr_in6, and sock.
Referenced by OMEsocketDescriptor::getLocalAddress(), OMEsocketDescriptor::getPeerAddress(), OMEgetInterfaces(), and OMEsocketDescriptor::openSocket().
OME_DLL_EXPORT void OMEendCriticalSection | ( | eOMEcriticalSectionLabel | regionID | ) |
Referenced by OMEobject::addOIDref(), OMEthreadExecQueue::addThreadToQueue(), OMEobjectInstance::allowMethod(), OMEobjectInstance::dropActiveThreadReference(), OMEthreadExecQueue::getNextThreads(), OMEobjectInstance::invokeMethod(), OMEobjectInstance::noteThreadTerminated(), OMEwaitForCondition(), OMEobject::removeOIDref(), OMEthreadExecQueue::removeSpecificThreadFromQueue(), OMEthreadExecQueue::terminateThreadsOnObject(), OMEreferenceCount::unlockMe(), unlockMEM(), and OMEobject::~OMEobject().
OME_DLL_EXPORT OMEstring* OMEfindFileInDirectory | ( | const OMEstring & | fileName, |
const OMEarray & | dirNames | ||
) |
Search for a file located within a list of directories specified as elements of an OMEarray.
fileName | specifies the base name of the file. |
dirNames | specifies a list of directories to be searched. |
0 | indicates the file was not found. |
References OMEstring::determineCharacterSet(), OMEarray::indexExists(), OMEstring::length(), NATIVE_DIR_SEP, OME_STRING, OMEtype::s, OMEtype::type, and OMEtype::value.
Referenced by OMEnlmCatalog::findCatalogFile(), OMEfindFileInPathSpec(), and OMEreadLicenseFile().
OME_DLL_EXPORT OMEstring* OMEfindFileInPathSpec | ( | const OMEstring & | fileName, |
const OMEstring & | path | ||
) |
Search for a file located within a set of directories specified by a string path.
Directory names can be separated by colon (":") or semi-colon (";") characters, which are the respective conventions for Unix and Microsoft Windows systems. The colon-separated paths can be used in conjunction with drive letters without concern. For example, the following path specifications will be correctly parsed:
* /bin:/usr/bin:/usr/local/bin * C:\Program Files\VISTA:D:\HOME\user\bin * /bin;/usr/bin;/usr/local/bin * C:\Program Files\VISTA;D:\HOME\user\bin *
0 | indicates the file was not found. |
References OMEfindFileInDirectory(), and OMEparsePathSpecification().
OME_DLL_EXPORT int OMEgetInterfaces | ( | OMEtype & | result | ) |
References flags, OMEassoc::getKeyForIndex(), OMEtype::initializeAsType(), lifconf, lifreq, OMEassoc::nextIndex(), OME_ARRAY, OME_ASSOC, OMEdisplayableAddress(), s, safe_strcpy, SIOCGLIFADDR, SIOCGLIFBRDADDR, SIOCGLIFCONF, SIOCGLIFDSTADDR, SIOCGLIFFLAGS, SIOCGLIFINDEX, SIOCGLIFMTU, SIOCGLIFNETMASK, and sock.
Referenced by listInterfaces(), and main().
OME_DLL_EXPORT uint32_t OMEgetMiscellaneousMutex | ( | ) |
References OME_CRITICAL_SECTION_OMETYPE_REF.
Referenced by OMEreferenceCount::OMEreferenceCount().
OME_DLL_EXPORT OMEstring* OMEgetUserName | ( | ) |
Return the name of the user associated with the process.
Referenced by main(), OMEconnection::OMEconnection(), OMEgetLicenseAttribute(), OMEgetLocalizedData(), and OMEreadLicenseFile().
OME_DLL_EXPORT uint32_t OMEhash | ( | const OMEstring & | key | ) |
Fast 32-bit hash of an OMEstring.
key | holds the data to be hashed. |
References OMEstring::length(), and OMEhash().
OME_DLL_EXPORT uint32_t OMEhash | ( | const unsigned char * | key, |
const uint32_t | len | ||
) |
Fast 32-bit hash over a buffer.
key | points to the buffer to be hashed. |
len | indicates the length of the buffer. |
Referenced by OMEnameSpaceGroup::addClass(), OMEclass::addMethodName(), OMEassocStorage::deleteIndex(), OMEnameSpaceGroup::findClass(), OMEclass::findMethod(), OMEassocStorage::indexExists(), OMEapi::OMEapi(), OMEgetSigningFile(), OMEhash(), and OMEassocStorage::operator[]().
OME_DLL_EXPORT int OMEinitConditionVariable | ( | OME_CONDITION_TYPE * | ) |
References NULL.
OME_DLL_EXPORT bool OMEinitCriticalSectionMutex | ( | OME_MUTEX_TYPE * | , |
bool | recursive = false |
||
) |
References PTHREAD_MUTEX_RECURSIVE.
OME_DLL_EXPORT bool OMEinitStandardCriticalSectionMutexes | ( | ) |
OME_DLL_EXPORT int OMEiso8601Date | ( | OMEtype & | result, |
const OMEtype & | argData | ||
) |
Format an OME absolute time reference as a date and time in ISO 8601 format.
result | will hold the resulting formatted string. |
argData | holds the OME absolute time reference. |
References OMEtype::assoc, OME_ASSOC, OMEtype::type, and OMEtype::value.
Referenced by iso8601Date().
OME_DLL_EXPORT OMEarray* OMElistDirectory | ( | const OMEstring & | dirName, |
int * | errRet | ||
) |
List all files within a filesystem directory.
dirName | specifies the name of the directory. |
errRet | points to an integer storage location into which an error code will be stored. If a null pointer is provided (the default) then no error code will be made available. |
0 | indicates an error, almost always a result of the directory being unreadable. Most probably this is because the indicated directory did not exist; however, lack of permission can also be the cause. |
References OMEstring::length().
Referenced by listDirectory().
OME_DLL_EXPORT uint32_t OMEmethodSignature | ( | const int | argc, |
const uint32_t | types[], | ||
uint32_t * | maskPtr | ||
) |
Compute 32-bit signature of a method's arguments.
argc | indicates the number of arguments in the types array. |
types | holds type information for each argument. |
maskPtr | is an optional pointer to an 32-bit storage location into which the mask of any arguments whose type was declared as ANY will be placed. |
References OME_ANY.
Referenced by OMEobjectInstance::findRoutine().
OME_DLL_EXPORT int64_t OMEmillisecondsSinceBoot | ( | ) |
Obtain the number of milliseconds since boot of local FARGOS/VISTA Object Management Environment process.
References OMErelativeMilliseconds().
Referenced by OMEthread::callMethodWithSetArgument(), and OMEobjectInstance::invokeMethod().
OME_DLL_EXPORT OMEarray* OMEparsePathSpecification | ( | const OMEstring & | spec | ) |
Parse a list of directories specified by a string path into an sequence of OMEarray elements.
spec | specifies a set of directory names. |
Directory names can be separated by colon (":") or semi-colon (";") characters, which are the respective conventions for Unix and Microsoft Windows systems. The colon-separated paths can be used in conjunction with drive letters without concern. For example, the following path specifications will be correctly parsed:
* /bin:/usr/bin:/usr/local/bin * C:\Program Files\VISTA:D:\HOME\user\bin * /bin;/usr/bin;/usr/local/bin * C:\Program Files\VISTA;D:\HOME\user\bin *
References ALT_DIR_SEP, OMEstring::determineCharacterSet(), OMEstring::length(), NATIVE_DIR_SEP, and s.
Referenced by OMEnlmCatalog::findCatalogFile(), OMEfindFileInPathSpec(), and OMEreadLicenseFile().
OME_DLL_EXPORT int64_t OMErelativeMilliseconds | ( | ) |
Return a monotonically-increasing count of elapsed milliseconds.
Referenced by getRelativeMilliseconds(), and OMEmillisecondsSinceBoot().
OME_DLL_EXPORT int OMErfc1123Date | ( | OMEtype & | result, |
const OMEtype & | argData | ||
) |
Format an OME absolute time reference as a data and time in RFC 1123 format.
result | will hold the resulting formatted string. |
argData | holds the OME absolute time reference. |
References OMEtype::assoc, OME_ASSOC, OMEtype::type, and OMEtype::value.
Referenced by rfc1123Date().
OME_DLL_EXPORT int OMEsetConditionVariable | ( | OME_CONDITION_TYPE * | ) |
OME_DLL_EXPORT void OMEstartCriticalSection | ( | eOMEcriticalSectionLabel | regionID | ) |
References OME_EXPECT_FALSE.
Referenced by OMEoidStorage::addLink(), OMEobject::addOIDref(), OMEthreadExecQueue::addThreadToQueue(), OMEobjectInstance::allowMethod(), OMEioEvent::deselectIOevent(), OMEobjectInstance::dropActiveThreadReference(), OMEthreadExecQueue::getNextThreads(), OMEobjectInstance::invokeMethod(), OMEreferenceCount::lockMe(), OMEobjectInstance::noteThreadTerminated(), OMEregisterIOscheme(), OMEstopLoiterThreads(), OMEwaitForCondition(), OMEoidStorage::removeLink(), OMEobject::removeOIDref(), OMEthreadExecQueue::removeSpecificThreadFromQueue(), OMEioEvent::selectIOevent(), OMEthreadExecQueue::terminateThreadsOnObject(), and OMEobject::~OMEobject().
OME_DLL_EXPORT int64_t OMEticksSinceBoot | ( | ) |
Obtain the number of CPU ticks since boot of local FARGOS/VISTA Object Management Environment process.
References OMEgetCPUticks.
Referenced by getTicksSinceBoot().
OME_DLL_EXPORT int OMEtimeDifference | ( | const OMEtype & | time1, |
const OMEtype & | time2 | ||
) |
Compute difference between two OME absolute time references.
time1 | is an absolute time reference. |
time2 | is an absolute time reference. |
References OMEconvertAbsoluteToLocalRelativeTime().
Referenced by timeDifference().
OME_DLL_EXPORT int OMEtransportToSockaddr | ( | union sockBigEnough * | sock, |
uint_fast16_t * | sockLen, | ||
int * | sockMode, | ||
const char * | url, | ||
uint_fast16_t | urlLen | ||
) |
OME_DLL_EXPORT int OMEwaitForCondition | ( | OME_CONDITION_TYPE * | , |
eOMEcriticalSectionLabel | mutexId | ||
) |
References NULL, OMEendCriticalSection(), and OMEstartCriticalSection().
OME_DLL_EXPORT int OMEwaitForNativeThread | ( | uint64_t | pid, |
void ** | retValue | ||
) |
|
inline |
References OMEentityID::outputOnStream().
OME_DLL_EXPORT OMEthisProcessInfo OMEcurrentProcessInfo |
Automatic instantiation of OMEthisProcessInfo. When properly linked, the C++ static constructor mechanism enables the automatic creation of the OMEcurrentProcessInfo variable within applications that link against the FARGOS/VISTA types library.
Referenced by main(), OMEapi::OMEapi(), OMEgetLicenseAttribute(), OMEgetLocalizedData(), OMEgetSigningFile(), OMEobject::OMEobject(), OMEreadLicenseFile(), and OMEobject::~OMEobject().
![]() | Generated: Tue Jul 28 2020 16:03:26
Support Information |