FARGOS/VISTA Object Management Environment Core
..
|
Public interface to an OME thread. More...
#include <OMEthread.h>
Public Member Functions | |
virtual bool | isThread () const override |
Returns a Boolean indicating if the object is representing a thread. More... | |
bool | inCalledMethod () const OME_PURE_FUNCTION |
void | clearResultPending () OME_ALWAYS_INLINE |
void | setResultPending () OME_ALWAYS_INLINE |
bool | replyStillPending () const OME_ALWAYS_INLINE |
void | setTickInterval (class OMEtickInterval *interval) OME_ALWAYS_INLINE |
void | noteThreadState (const OMEthreadStates s) OME_ALWAYS_INLINE |
OMEthreadStates | getThreadState () const OME_ALWAYS_INLINE |
void | noteThreadPriority (int p) OME_ALWAYS_INLINE |
int | getThreadPriority () const OME_ALWAYS_INLINE |
const OMEtype & | getReplyOID () |
virtual OME_FAST_CALL OMEthread * | invokeMethod (int *errRet, const OMEstring &methodName, const uint32_t hashIndx, const OMEoid &objRefData, const uint32_t argc, const OMEarray &argv, const uint32_t signature, const OMEtype *fromObject=nullptr, const OMEthread *fromThread=nullptr, const OMEoid *notify=nullptr, const int inheritanceLevel=-1, const int mustBeAtLevel=-1) override |
Invoke method against an object. More... | |
OME_FAST_CALL void | callRoutine (const OMEinvocationData *routine, const int level, const OMEstring &methodName, const int srcArgc, const OMEarray &srcArgv) |
void | exitRoutine () |
const OMEtype & | getUserID () const OME_ALWAYS_INLINE |
const OMEstring * | getUserName () const |
OME_FAST_CALL int | setUserID (const OMEstring &userID, const OMEstring &pwInfo) |
const OMEtype & | getThisObject () const OME_ALWAYS_INLINE |
const OMEoid & | getThisOID () const OME_ALWAYS_INLINE |
void | dropThisObjectReference () OME_ALWAYS_INLINE |
bool | validReferenceToObject () OME_ALWAYS_INLINE |
OME_FAST_CALL void * | getInstanceData () const |
OME_FAST_CALL void | setPC (uint32_t pc) OME_ALWAYS_INLINE |
uint32_t | getPC () const OME_ALWAYS_INLINE |
void | setErrorCode (OMEtype &rc) OME_ALWAYS_INLINE |
OMEtype & | getErrorCode () OME_ALWAYS_INLINE |
const OMEtype & | getReplyResult () const OME_ALWAYS_INLINE |
OME_FAST_CALL int | returnReply (const OMEtype &result) |
OME_FAST_CALL int | returnReply (const uint32_t result) |
OME_FAST_CALL int | returnReply (const int32_t result) |
OME_FAST_CALL int | returnReply (const float result) |
OME_FAST_CALL int | returnReply (const OMEoid &result) |
OME_FAST_CALL void | threadNowTerminated (uint32_t exitStatus, bool dontDelete=false) |
void | noteObjectModified () OME_ALWAYS_INLINE |
void | noteLineNumber (int line, const char *fileName=nullptr) OME_ALWAYS_INLINE |
void | setAsPreemptable () |
OMEthread * | releaseThread () |
void | suspendThread () |
void | terminateThread () |
void | yieldSlice () |
void | executeSlice () |
uint32_t | getMethodType () const OME_ALWAYS_INLINE |
OME_FAST_CALL int | sendMessage (const OMEstring &methodName, const uint32_t hashIndx, const uint32_t argc, const OMEarray &argv, const OMEtype &destObj, const OMEtype *fromObj=nullptr) const |
OME_FAST_CALL int | sendMessage (const OMEtype &methodName, const uint32_t hashIndx, const OMEtype &argv, const OMEtype &destObj, const OMEtype &fromObj, const OMEtype &timeout) |
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) |
OME_FAST_CALL int | sendMessageAndWait (const OMEstring &methodName, const uint32_t hashIndx, const uint32_t argc, const OMEarray &argv, const OMEtype &destObj) |
OME_FAST_CALL int | callMethodWithSetArgument (const OMEtype &methodName, const uint32_t hashIndx, const OMEtype &argSet) |
OME_FAST_CALL int | generateException (uint_fast32_t argc, const OMEarray &argv) const |
OME_FAST_CALL int | generateException (const char *exceptionType) const |
OME_FAST_CALL int | generateException (const char *exceptionType, const OMEstring &methName) const |
void | outputOnStream (std::ostream &o=std::cout) const |
![]() | |
OME_FAST_CALL void | getOIDdata (OMEoidID *idInfo) const |
const OMEoid & | getDefaultOID () |
Returns read-only reference to object's default object Id. More... | |
OME_FAST_CALL void | setMetaObject (const OMEoid *obj) |
Attach an meta object to the object. More... | |
OME_FAST_CALL OMEthread * | invokeMethodAndWaitForReply (int *errRet, const OMEstring &methodName, const uint32_t hashIndx, const OMEoid &objRefData, const uint32_t argc, const OMEarray &argv, const uint32_t signature, OMEthread *fromThread, const int inheritanceLevel=-1) |
Perform RPC-style method invocation against an object. More... | |
OME_FAST_CALL void | addTickCount (const int64_t tickCount) const OME_ALWAYS_INLINE |
Add tick counts to per-object statistics. More... | |
OME_FAST_CALL int64_t | getTickCount () const OME_ALWAYS_INLINE |
Return number of elapsed time in ticks spent executing object's methods. More... | |
OME_FAST_CALL uint32_t | getSliceCount () const OME_ALWAYS_INLINE |
Return number of time slices allocated to object's methods. More... | |
OME_FAST_CALL uint32_t | getInvocationCount () const OME_ALWAYS_INLINE |
Return number of methods invoked against object. More... | |
![]() | |
OMEreferenceCount () | |
virtual | ~OMEreferenceCount () |
void | addReadOnlyReference () |
int_fast32_t | dropReference () |
virtual OMEreferenceCount * | deepCopy () const |
OMEreferenceCount * | getUniqueReference () |
int_fast32_t | totalReferences () const OME_ALWAYS_INLINE |
Static Public Member Functions | |
static void | defineOMEthreadClass () |
Public Attributes | |
OMEcallStack * | callStack |
OMEthreadStates | threadState |
int | threadPriority |
OMEtype | threadContext |
OMEtype | fromObject |
OMEtype | replyResult |
OMEthread * | fromThreadInstance |
OMEtype | threadErrorCode |
int | sourceLineNumber |
const char * | sourceFileName |
class OMEtickInterval * | tickInterval |
![]() | |
const OMEclass * | classInfo |
Pointer to class description. More... | |
OMEoid * | metaObject |
Pointer to meta-object. More... | |
Private Member Functions | |
OMEthread (const OMEinvocationData *routine, const int level, const OMEoid &obj, const OMEstring &methodName, const uint32_t srcArgc, const OMEarray &srcArgv, const OMEtype *fromObj=nullptr, const OMEthread *fromThread=nullptr, const OMEoid *notifyObj=nullptr) | |
OMEthread (const OMEstring &user, const OMEstring &pw) | |
virtual | ~OMEthread () |
void | createReplyOID () |
OME_FAST_CALL void | setReplyResult (const OMEtype &arg, bool sameThread=false) |
Private Attributes | |
OMEtype * | replyOID |
OMEthreadController * | threadController |
OMEoid * | notifyWhenDead |
OMEtype | userInfo |
bool | modifiedObject |
bool | preemptable |
bool | resultPending |
Friends | |
class | OMEobjectInstance |
class | OMEthreadExecQueue |
Additional Inherited Members | |
![]() | |
OMEobject (OMEclass *classData) | |
virtual | ~OMEobject () |
![]() | |
void | lockMe () |
void | unlockMe () |
![]() | |
uint32_t | totalInvocations |
uint32_t | instanceID |
OMEentityID * | entityID |
OMEoidStorageInternal * | oidReferences |
![]() | |
int32_t | references |
int32_t | mutexID |
Public interface to an OME thread.
Logical thread within FARGOS/VISTA Object Management Environment.
|
private |
|
privatevirtual |
References OMEobject::getOIDdata(), INCREMENT_COUNTER32_BY, LOG_COUT, and LOG_ENDLINE.
int OMEthread::callMethodWithSetArgument | ( | const OMEtype & | methodName, |
const uint32_t | hashIndx, | ||
const OMEtype & | argSet | ||
) |
References callRoutine(), callStack, OMEobject::classInfo, OMEinvocationData::code, OMEobjectInstance::findRoutine(), OMEinvocationData::function, generateException(), OMEoid::getInstanceInMemory(), getThisOID(), OMEclass::hashIndex, OMEobject::instanceID, LOG_CERR, LOG_COUT, LOG_ENDLINE, OMEmethodDefinition::methodName, OMEset::nextElement(), OME_EXPECT_FALSE, OME_EXPECT_TRUE, OME_SET, OME_STRING, OMEdebugFlag, OMEdebugIncludeArguments, OMEdebugMethodInvocations, OMEmillisecondsSinceBoot(), OMEtype::outputOnStream(), OMEset::resetIterator(), OMEtype::set, sourceFileName, sourceLineNumber, OMEcallStack::thisMethod, OMEtype::type, and OMEtype::value.
void OMEthread::callRoutine | ( | const OMEinvocationData * | routine, |
const int | level, | ||
const OMEstring & | methodName, | ||
const int | srcArgc, | ||
const OMEarray & | srcArgv | ||
) |
References callStack, getThisOID(), and OMEcallStack::next.
Referenced by callMethodWithSetArgument().
|
inline |
References resultPending.
|
private |
References getUserName(), OME_EXPECT_TRUE, OME_NIL, OMEmakeACL(), OMEtype, and replyOID.
Referenced by getReplyOID().
|
static |
References OMEshareConstant(), and OMEstringInROM.
|
inline |
References callStack, and OMEcallStack::dropThisObjectReference().
void OMEthread::executeSlice | ( | ) |
References OMEthreadController::executeSlice(), and threadController.
Referenced by OMEthreadExecQueue::executeSlices().
void OMEthread::exitRoutine | ( | ) |
References callStack, OMEcallStack::next, OME_EXPECT_TRUE, and terminateThread().
Referenced by OMEoil2Interpreter(), and returnReply().
int OMEthread::generateException | ( | const char * | exceptionType | ) | const |
References generateException().
int OMEthread::generateException | ( | const char * | exceptionType, |
const OMEstring & | methName | ||
) | const |
References generateException().
int OMEthread::generateException | ( | uint_fast32_t | argc, |
const OMEarray & | argv | ||
) | const |
References getThisObject(), LOG_CERR, LOG_ENDLINE, OME_EXPECT_FALSE, OMEdebugExceptions, OMEdebugFlag, OMEdebugLogLevel3, outputOnStream(), sendMessage(), sourceFileName, and sourceLineNumber.
Referenced by callMethodWithSetArgument(), generateException(), invokeMethod(), OMEobjectInstance::invokeMethod(), OMEokToAssignTypes(), openURL(), sendMessage(), and sendMessageWithSetArgument().
|
inline |
References threadErrorCode.
void * OMEthread::getInstanceData | ( | ) | const |
References callStack, OMEobject::classInfo, OMEmethodDefinition::data, OMEobjectInstance::getInstanceDataAtLevel(), OMEoid::getInstanceInMemory(), getThisOID(), OMEclass::inheritListTotal(), OMEcallStack::invocationLevel, LOG_CERR, LOG_ENDLINE, and OME_EXPECT_FALSE.
Referenced by OMEobjectInstance::Object_delete(), and OMEoil2Interpreter().
|
inline |
|
inline |
References callStack, and OMEcallStack::programCounter.
Referenced by OMEoil2Interpreter(), and yieldSlice().
|
inline |
References createReplyOID(), OME_EXPECT_FALSE, and replyOID.
Referenced by OMEobject::invokeMethodAndWaitForReply().
|
inline |
References replyResult.
|
inline |
References callStack, and OMEcallStack::getThisObject().
Referenced by generateException(), outputOnStream(), and threadNowTerminated().
|
inline |
References callStack, OMEcallStack::getThisObject(), OMEtype::oid, and OMEtype::value.
Referenced by allow(), alwaysAllow(), callMethodWithSetArgument(), callRoutine(), getInstanceData(), makeOIDwithACL(), setAsPreemptable(), and OMEthreadExecQueue::terminateThreadsOnObject().
|
inline |
References threadPriority.
Referenced by OMEthreadExecQueue::addThreadToQueue().
|
inline |
|
inline |
References userInfo.
Referenced by getUserName(), and OMEobjectInstance::invokeMethod().
const OMEstring * OMEthread::getUserName | ( | ) | const |
References getUserID(), LOG_CERR, LOG_ENDLINE, OME_STRING, OMEtype::s, OMEtype::type, and OMEtype::value.
Referenced by createACLthatAllowsOthers(), createACLthatDisallowsOthers(), createReplyOID(), makeDefaultACL(), makePermitEveryoneACL(), OMEcheckACL(), and OMEcheckResourceAccess().
bool OMEthread::inCalledMethod | ( | ) | const |
References callStack, OMEcallStack::next, and OME_EXPECT_TRUE.
Referenced by inCalledMethod().
|
overridevirtual |
Invoke method against an object.
Implements OMEobject.
References OMEobject::classInfo, OMEclass::className, generateException(), OMEoid::getObjectACL(), OMEobject::getTickCount(), OMEclass::hashIndex, OMEobject::instanceID, LOG_CERR, LOG_COUT, LOG_ENDLINE, OMEmethodDefinition::methodName, OME_ERROR_NO_SUCH_METHOD, OME_ERROR_NOT_AUTHORIZED, OME_EXPECT_FALSE, OMEcheckACL(), OMEdebugFlag, OMEdebugIncludeArguments, OMEdebugMethodInvocations, OMEarray::outputOnStream(), releaseThread(), returnReply(), setAsPreemptable(), setReplyResult(), SIMPLE_INCREMENT_COUNTER32_BY, suspendThread(), terminateThread(), and OMEobject::totalInvocations.
|
inlineoverridevirtual |
Returns a Boolean indicating if the object is representing a thread.
Indicates if entity is an object or thread.
0 | indicates an object. |
1 | indicates a thread. |
Reimplemented from OMEobject.
|
inline |
References OME_EXPECT_TRUE, sourceFileName, and sourceLineNumber.
|
inline |
References modifiedObject.
Referenced by OMEoil2Interpreter().
|
inline |
References threadPriority.
|
inline |
References s, and threadState.
Referenced by OMEthreadNativeOIL2::releaseThread(), and OMEthreadNativeOIL2::suspendThread().
void OMEthread::outputOnStream | ( | std::ostream & | o = std::cout | ) | const |
References OMEcallStack::argc, OMEcallStack::argv, callStack, OMEthreadController::controllerType(), fromObject, OMEobject::getDefaultOID(), getThisObject(), OME_DEFAULT_COMPLEX_OUTPUT_MODE, OME_EXPECT_TRUE, OMEtype::outputOnStream(), OMEcallStack::programCounter, sourceFileName, sourceLineNumber, OMEcallStack::stackPointer, OMEcallStack::thisMethod, threadController, and threadErrorCode.
Referenced by generateException(), and OMEthreadExecQueue::terminateThreadsOnObject().
OMEthread * OMEthread::releaseThread | ( | ) |
References OMEtickInterval::addIntervalCounts(), callStack, OMEinvocationData::code, OMEinvocationData::function, OMEinvocationData::invocationMode, LOG_CERR, LOG_ENDLINE, OMEcallStack::methodBody, OME_EXPECT_FALSE, OME_INVOKE_KERNEL_THREAD, OME_INVOKE_OIL2_INTERPRET, OME_INVOKE_OIL2_NATIVE, OME_INVOKE_TRIVIAL_NATIVE, OMEthreadController::releaseThread(), OMEtickInterval::startInterval(), OMEtickInterval::stopInterval(), threadController, threadNowTerminated(), and tickInterval.
Referenced by OMEobjectInstance::allowMethod(), OMEobjectInstance::dropActiveThreadReference(), invokeMethod(), OMEobjectInstance::invokeMethod(), and setReplyResult().
|
inline |
References resultPending.
int OMEthread::returnReply | ( | const float | result | ) |
References returnReply().
int OMEthread::returnReply | ( | const int32_t | result | ) |
References returnReply().
int OMEthread::returnReply | ( | const OMEoid & | result | ) |
References returnReply().
int OMEthread::returnReply | ( | const OMEtype & | result | ) |
References callStack, exitRoutine(), fromObject, fromThreadInstance, LOG_CERR, LOG_COUT, LOG_ENDLINE, OMEcallStack::next, OMEtype::oid, OME_EXPECT_FALSE, OME_EXPECT_TRUE, OME_NIL, OME_OID, OMEdebugFlag, OMEdebugMethodInvocations, OMEoid::refersTo(), sendMessage(), setReplyResult(), sourceFileName, sourceLineNumber, OMEcallStack::thisMethod, OMEtype::type, and OMEtype::value.
Referenced by invokeMethod(), and returnReply().
int OMEthread::returnReply | ( | const uint32_t | result | ) |
References returnReply().
int OMEthread::sendMessage | ( | const OMEstring & | methodName, |
const uint32_t | hashIndx, | ||
const uint32_t | argc, | ||
const OMEarray & | argv, | ||
const OMEtype & | destObj, | ||
const OMEtype * | fromObj = nullptr |
||
) | const |
References _STD, OMEtype::oid, OME_EXPECT_TRUE, OME_OID, OME_STRING, OMEtype::type, and OMEtype::value.
Referenced by generateException(), returnReply(), sendMessage(), sendMessageWithSetArgument(), and threadNowTerminated().
int OMEthread::sendMessageAndWait | ( | const OMEstring & | methodName, |
const uint32_t | hashIndx, | ||
const uint32_t | argc, | ||
const OMEarray & | argv, | ||
const OMEtype & | destObj | ||
) |
References _STD, OMEtype::oid, OME_OID, OME_STRING, OMEtype::type, and OMEtype::value.
int OMEthread::sendMessageWithSetArgument | ( | const OMEtype & | methodName, |
const uint32_t | hashIndx, | ||
const OMEtype & | argSet, | ||
const OMEtype & | destObj, | ||
const OMEtype & | fromObj, | ||
const int32_t | timeout | ||
) |
References doAbort(), generateException(), LOG_CERR, LOG_COUT, LOG_ENDLINE, OMEmethodDefinition::methodName, OMEset::nextElement(), OMEtype::oid, OME_EXPECT_FALSE, OME_EXPECT_TRUE, OME_NIL, OME_OID, OME_SET, OME_STRING, OMEset::resetIterator(), sendMessage(), OMEtype::set, OMEtype::type, and OMEtype::value.
void OMEthread::setAsPreemptable | ( | ) |
References OMEobjectInstance::dropActiveThreadReference(), OMEoid::getInstanceInMemory(), getThisOID(), LOG_COUT, LOG_ENDLINE, preemptable, and validReferenceToObject().
Referenced by invokeMethod().
|
inline |
References threadErrorCode.
|
inline |
References callStack, and OMEcallStack::programCounter.
Referenced by OMEoil2Interpreter().
|
private |
References OME_EXPECT_TRUE, OME_THREAD_SUSPEND, releaseThread(), replyResult, resultPending, and threadState.
Referenced by invokeMethod(), and returnReply().
|
inline |
References resultPending.
|
inline |
References tickInterval.
Referenced by OMEtickInterval::OMEtickInterval().
References OMEstring::length(), and userInfo.
Referenced by becomePseudoUser(), and becomeUser().
void OMEthread::suspendThread | ( | ) |
References OME_EXPECT_TRUE, OME_THREAD_SUSPEND, OMEthreadController::suspendThread(), threadController, and threadState.
Referenced by invokeMethod(), OMEobject::invokeMethodAndWaitForReply(), and OMEoil2Interpreter().
void OMEthread::terminateThread | ( | ) |
void OMEthread::threadNowTerminated | ( | uint32_t | exitStatus, |
bool | dontDelete = false |
||
) |
References getThisObject(), notifyWhenDead, OME_EXPECT_FALSE, OME_THREAD_TERMINATED, sendMessage(), and threadState.
Referenced by OMEthreadNativeOIL2::executeSlice(), releaseThread(), OMEthreadNativeOIL2::terminateThread(), and terminateThread().
|
inline |
References callStack, and OMEcallStack::validReferenceToObject().
Referenced by setAsPreemptable().
void OMEthread::yieldSlice | ( | ) |
References threadController, and OMEthreadController::yieldSlice().
Referenced by OMEoil2Interpreter(), and yieldSlice().
|
friend |
|
friend |
OMEcallStack* OMEthread::callStack |
Referenced by callMethodWithSetArgument(), callRoutine(), OMEobjectInstance::dropActiveThreadReference(), dropThisObjectReference(), OMEthreadNativeOIL2::executeSlice(), OMEthreadExecQueue::executeSlices(), exitRoutine(), getInstanceData(), getMethodType(), getPC(), getThisObject(), getThisOID(), inCalledMethod(), OMEobjectInstance::noteThreadTerminated(), OMEoil2Interpreter(), outputOnStream(), releaseThread(), returnReply(), setPC(), OMEthreadNativeOIL2::terminateThread(), OMEthreadNative::terminateThread(), OMEobjectInstance::threadAllowed(), and validReferenceToObject().
OMEtype OMEthread::fromObject |
Referenced by outputOnStream(), and returnReply().
OMEthread* OMEthread::fromThreadInstance |
Referenced by returnReply().
|
private |
Referenced by noteObjectModified().
|
private |
Referenced by threadNowTerminated().
|
private |
Referenced by setAsPreemptable().
|
private |
Referenced by createReplyOID(), and getReplyOID().
OMEtype OMEthread::replyResult |
Referenced by getReplyResult(), and setReplyResult().
|
private |
Referenced by clearResultPending(), replyStillPending(), setReplyResult(), and setResultPending().
const char* OMEthread::sourceFileName |
int OMEthread::sourceLineNumber |
OMEtype OMEthread::threadContext |
Referenced by debugDisplay(), display(), getApplicationVariable(), and logOutput().
|
private |
Referenced by executeSlice(), getMethodType(), outputOnStream(), releaseThread(), suspendThread(), terminateThread(), and yieldSlice().
OMEtype OMEthread::threadErrorCode |
Referenced by getErrorCode(), getFileInfo(), OILcreateObject(), openURL(), outputOnStream(), and setErrorCode().
int OMEthread::threadPriority |
Referenced by getThreadPriority(), and noteThreadPriority().
OMEthreadStates OMEthread::threadState |
Referenced by getThreadState(), noteThreadState(), setReplyResult(), suspendThread(), terminateThread(), and threadNowTerminated().
class OMEtickInterval* OMEthread::tickInterval |
|
private |
Referenced by getUserID(), and setUserID().
![]() | Generated: Tue Jul 28 2020 16:03:27
Support Information |