FARGOS/VISTA Object Management Environment Core  ..
FARGOS/VISTA Object Management Environment Core Table of Contents
OMEthread.h
Go to the documentation of this file.
1 #ifndef _OME_THREAD_H
2 #define _OME_THREAD_H "$Id: OMEthread.h 453 2020-07-23 20:20:44Z geoff $"
4 
6 #include <OMEruntime.h>
7 #include <OMEtype.h>
8 #include <OMEmethod.h>
9 #include <OMEclass.h>
10 #include <OMEobject.h>
11 #include <OMEthreadCntrl.h>
12 #include <OMEoid.h>
13 
24 };
25 
26 
30 class OMEcallStack {
31 private:
33 public:
39  uint32_t programCounter;
40  uint32_t stackPointer;
41  void *threadStack;
42  uint32_t stackLength;
44 
45  OMEcallStack(const OMEoid &obj, const OMEinvocationData *routine,
46  int level, const OMEstring &methodNm, const uint32_t srcArgc,
47  const OMEarray &srcArgv);
48 
49  ~OMEcallStack();
50 
51  OME_FAST_CALL const OMEtype &getThisObject() const { return (objectData); }
52 
54 
56 }; // end class OMEcallStack
57 
60 class OMEthread final : public OMEobject {
61 friend class OMEobjectInstance; // for access to constructor
62 friend class OMEthreadExecQueue; // for access to destructor
63 private:
71 public:
72  static void defineOMEthreadClass();
73 
82  // for debugging assistance...
84  const char *sourceFileName;
86 private:
87  // fromThread is used to extract threadContext information...
88  OMEthread(const OMEinvocationData *routine, const int level,
89  const OMEoid &obj,
90  const OMEstring &methodName, const uint32_t srcArgc,
91  const OMEarray &srcArgv, const OMEtype *fromObj = nullptr,
92  const OMEthread *fromThread = nullptr,
93  const OMEoid *notifyObj = nullptr);
94 
95  OMEthread(const OMEstring &user, const OMEstring &pw);
96 
97  virtual ~OMEthread();
98 
99  void createReplyOID();
100 
101  OME_FAST_CALL void setReplyResult(const OMEtype &arg, bool sameThread = false);
102 public:
103 
104  // virtual from OMEobject
105  virtual bool isThread() const override { return (true); }
106 
107  bool inCalledMethod() const OME_PURE_FUNCTION;
108 
110 
112 
113  inline bool replyStillPending() const OME_ALWAYS_INLINE { return (resultPending); }
114 
115  inline void setTickInterval(class OMEtickInterval *interval) OME_ALWAYS_INLINE { tickInterval = interval; }
116 
118 
120 
122 
123  inline int getThreadPriority() const OME_ALWAYS_INLINE { return (threadPriority); }
124 
125  const OMEtype &getReplyOID() {
126  if (OME_EXPECT_FALSE(replyOID == nullptr)) {
127  createReplyOID();
128  }
129  return (*replyOID);
130  }
131 
132  virtual OME_FAST_CALL OMEthread *invokeMethod(int *errRet, const OMEstring &methodName,
133  const uint32_t hashIndx, const OMEoid &objRefData,
134  const uint32_t argc, const OMEarray &argv, const uint32_t signature,
135  const OMEtype *fromObject = nullptr,
136  const OMEthread *fromThread = nullptr,
137  const OMEoid *notify = nullptr, const int inheritanceLevel = -1,
138  const int mustBeAtLevel = -1) override;
139 
140  OME_FAST_CALL void callRoutine(const OMEinvocationData *routine, const int level,
141  const OMEstring &methodName, const int srcArgc,
142  const OMEarray &srcArgv);
143 
144  void exitRoutine();
145 
146  const OMEtype &getUserID() const OME_ALWAYS_INLINE { return (userInfo); }
147 
148  const OMEstring *getUserName() const;
149 
150  OME_FAST_CALL int setUserID(const OMEstring &userID, const OMEstring &pwInfo);
151 
153 
155  return (*(callStack->getThisObject().value.oid));
156  }
157 
158 
160 
162 
163  OME_FAST_CALL void *getInstanceData() const;
164 
167  }
168 
169  uint32_t getPC() const OME_ALWAYS_INLINE {
170  return (callStack->programCounter);
171  }
172 
174 
176 
178 
179  OME_FAST_CALL int returnReply(const OMEtype &result);
180 
181  OME_FAST_CALL int returnReply(const uint32_t result);
182 
183  OME_FAST_CALL int returnReply(const int32_t result);
184 
185  OME_FAST_CALL int returnReply(const float result);
186 
187  OME_FAST_CALL int returnReply(const OMEoid &result);
188 
189  OME_FAST_CALL void threadNowTerminated(uint32_t exitStatus, bool dontDelete = false);
190 
192 
193  inline void noteLineNumber(int line, const char *fileName = nullptr) OME_ALWAYS_INLINE {
194  sourceLineNumber = line;
195  if (OME_EXPECT_TRUE(fileName != nullptr)) {
196  sourceFileName = fileName;
197  }
198  }
199 
200  void setAsPreemptable();
201 
203 
204  void suspendThread();
205 
206  void terminateThread();
207 
208  void yieldSlice();
209 
210  void executeSlice();
211 
212  uint32_t getMethodType() const OME_ALWAYS_INLINE {
213  if (OME_EXPECT_TRUE(threadController != nullptr)) {
215  }
216  return (0); // unknown...
217  }
218 
219  OME_FAST_CALL int sendMessage(const OMEstring &methodName,
220  const uint32_t hashIndx,
221  const uint32_t argc, const OMEarray &argv,
222  const OMEtype &destObj,
223  const OMEtype *fromObj = nullptr) const;
224 
225  // convenience function for use by OIL2 methods
226  OME_FAST_CALL int sendMessage(const OMEtype &methodName,
227  const uint32_t hashIndx, const OMEtype &argv,
228  const OMEtype &destObj, const OMEtype &fromObj,
229  const OMEtype &timeout);
230 
231  OME_FAST_CALL int sendMessageWithSetArgument(const OMEtype &methodName,
232  const uint32_t hashIndx,
233  const OMEtype &argSet, const OMEtype &destObj,
234  const OMEtype &fromObj, const int32_t timeout);
235 
236  OME_FAST_CALL int sendMessageAndWait(const OMEstring &methodName,
237  const uint32_t hashIndx, const uint32_t argc,
238  const OMEarray &argv, const OMEtype &destObj);
239 
240  OME_FAST_CALL int callMethodWithSetArgument(const OMEtype &methodName,
241  const uint32_t hashIndx, const OMEtype &argSet);
242 
243  OME_FAST_CALL int generateException(uint_fast32_t argc, const OMEarray &argv) const;
244 
245  // convenience interfaces...
246  OME_FAST_CALL int generateException(const char *exceptionType) const;
247 
248  OME_FAST_CALL int generateException(const char *exceptionType,
249  const OMEstring &methName) const;
250 
251  void outputOnStream(std::ostream &o=std::cout) const;
252 }; // end class OMEthread
253 
254 typedef OME_CORE_CALL int (*zeroFP)(OMEthread *, OMEtype &);
255 
256 typedef OME_CORE_CALL int (*oneFP)(OMEthread *, OMEtype &, const OMEtype &);
257 
258 typedef OME_CORE_CALL int (*twoFP)(OMEthread *, OMEtype &, const OMEtype &,
259  const OMEtype &);
260 
261 typedef OME_CORE_CALL int (*threeFP)(OMEthread *, OMEtype &, const OMEtype &,
262  const OMEtype &, const OMEtype &);
263 
264 typedef OME_CORE_CALL int (*fourFP)(OMEthread *, OMEtype &, const OMEtype &,
265  const OMEtype &, const OMEtype &, const OMEtype &);
266 
267 typedef OME_CORE_CALL int (*fiveFP)(OMEthread *, OMEtype &, const OMEtype &,
268  const OMEtype &, const OMEtype &, const OMEtype &, const OMEtype &);
269 
270 typedef OME_CORE_CALL int (*sixFP)(OMEthread *, OMEtype &, const OMEtype &,
271  const OMEtype &, const OMEtype &, const OMEtype &, const OMEtype &,
272  const OMEtype &);
273 
274 typedef OME_CORE_CALL int (*sevenFP)(OMEthread *, OMEtype &, const OMEtype &,
275  const OMEtype &, const OMEtype &, const OMEtype &, const OMEtype &,
276  const OMEtype &, const OMEtype &);
277 
278 typedef OME_CORE_CALL int (*eightFP)(OMEthread *, OMEtype &, const OMEtype &,
279  const OMEtype &, const OMEtype &, const OMEtype &, const OMEtype &,
280  const OMEtype &, const OMEtype &, const OMEtype &);
281 
283  const OMEtype &, ...);
284 
288 private:
291 
292  inline void registerFunction() {
293  next = listStart;
294  listStart = this;
295  }
296 public:
297  static OME_FAST_CALL const OMEdefOIL2func *findFunction(const OMEstring &fName);
298 
300  void *function;
301  int argCount;
302 
303  OMEdefOIL2func(const char *funcName, zeroFP f, int args) : functionName(funcName) {
304 // functionName = funcName;
305  function = (void *) f;
306  argCount = args;
308  }
309 
310  OMEdefOIL2func(const char *funcName, oneFP f, int args) : functionName(funcName) {
311 // functionName = funcName;
312  function = (void *) f;
313  argCount = args;
315  }
316 
317  OMEdefOIL2func(const char *funcName, twoFP f, int args) : functionName(funcName) {
318 // functionName = funcName;
319  function = (void *) f;
320  argCount = args;
322  }
323 
324  OMEdefOIL2func(const char *funcName, threeFP f, int args) : functionName(funcName) {
325 // functionName = funcName;
326  function = (void *) f;
327  argCount = args;
329  }
330 
331  OMEdefOIL2func(const char *funcName, fourFP f, int args) : functionName(funcName) {
332 // functionName = funcName;
333  function = (void *) f;
334  argCount = args;
336  }
337 
338  OMEdefOIL2func(const char *funcName, fiveFP f, int args) : functionName(funcName) {
339 // functionName = funcName;
340  function = (void *) f;
341  argCount = args;
343  }
344 
345  OMEdefOIL2func(const char *funcName, sixFP f, int args) : functionName(funcName) {
346 // functionName = funcName;
347  function = (void *) f;
348  argCount = args;
350  }
351 
352  OMEdefOIL2func(const char *funcName, sevenFP f, int args) : functionName(funcName) {
353 // functionName = funcName;
354  function = (void *) f;
355  argCount = args;
357  }
358 
359  OMEdefOIL2func(const char *funcName, eightFP f, int args) : functionName(funcName) {
360 // functionName = funcName;
361  function = (void *) f;
362  argCount = args;
364  }
365 
367 }; // end class OMEdefOIL2func
368 
369 OME_FAST_CALL OMEtype &OMEgetObjectCreatorOID(const OMEtype &userInfo) OME_CONST_FUNCTION; // in OMEcreate.cpp
370 
371 OME_FAST_CALL OMEtype &OILnextIterator(int *rc, OMEtype &setVar); // special runtime
372 
373 OME_FAST_CALL bool OMEokToAssignTypes(uint32_t sourceType, uint32_t targetType, OMEthread *t = nullptr);
374 
375 // call at exit to cleanup
376 void unregisterAllServices();
377 
380 #endif
381 /* vim: set expandtab shiftwidth=4 tabstop=4: */
OMEobject::defaultOID
OMEoid * defaultOID
Definition: OMEobject.h:28
OMEcallStack::next
OMEcallStack * next
Definition: OMEthread.h:43
OMEmakeACL
OMEassoc * OMEmakeACL(const OMEstring &entity, uint_fast32_t defaultPermission, const OMEassoc &methodList)
Definition: OMEobjACL.cpp:164
OMEthread::threadContext
OMEtype threadContext
Definition: OMEthread.h:77
OMEthread::getMethodType
uint32_t getMethodType() const OME_ALWAYS_INLINE
Definition: OMEthread.h:212
doAbort
void doAbort()
Definition: OMEthread.cpp:588
OMEcallStack::threadStack
void * threadStack
Definition: OMEthread.h:41
OMEthread::isThread
virtual bool isThread() const override
Returns a Boolean indicating if the object is representing a thread.
Definition: OMEthread.h:105
OMEcallStack::thisMethod
OMEtype thisMethod
Definition: OMEthread.h:36
OMEdefOIL2func::findFunction
static const OME_FAST_CALL OMEdefOIL2func * findFunction(const OMEstring &fName)
Definition: copyIntrp.cpp:64
OME_THREAD_SUSPEND
@ OME_THREAD_SUSPEND
thread is suspended
Definition: OMEthread.h:20
OMEcallStack::dropThisObjectReference
void dropThisObjectReference()
Definition: OMEthread.cpp:264
OMEthread::sendMessage
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
Definition: OMEthread.cpp:470
OME_THREAD_RUNNING
@ OME_THREAD_RUNNING
thread is active
Definition: OMEthread.h:21
OME_DELETE_OBJECT
#define OME_DELETE_OBJECT(ptr)
Definition: OMEmanifests.h:159
OMEtype::initializeAsType
void initializeAsType(const enum OMEtypes_t t)
The fundamental tagged data type used through the FARGOS/VISTA infrastructure.
Definition: OMEtype.cpp:95
OMEclass::inheritListTotal
uint_fast16_t inheritListTotal() const
Definition: OMEclass.h:111
OMEoid::getObjectACL
const OMEassoc & getObjectACL() const
Definition: OMEoid.h:285
OMEprofileCounter< uint32_t >
OMEthread::noteThreadPriority
void noteThreadPriority(int p) OME_ALWAYS_INLINE
Definition: OMEthread.h:121
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
OMEdefOIL2func::OMEdefOIL2func
OMEdefOIL2func(const char *funcName, sixFP f, int args)
Definition: OMEthread.h:345
s
const char s[]
Definition: t.cpp:4
OMEdebugFlag
SMV_StandaloneNumeric< uint32_t > OMEdebugFlag("debugFlag")
OMEinvocationData::function
NativeMethodFP function
Definition: OMEmethod.h:49
OMEokToAssignTypes
bool OMEokToAssignTypes(uint32_t srcType, uint32_t targetType, OMEthread *t)
Definition: OMEthread.cpp:1260
ARG_IS_INT
#define ARG_IS_INT(x)
Definition: OMEthread.cpp:14
OMEoid::setProxyObject
void setProxyObject(const OMEoid &proxy, const OMEstring &method)
Set object Id of meta/proxy object.
Definition: OMEoid.h:275
OMEcallStack::invocationLevel
int invocationLevel
Definition: OMEthread.h:35
OMEfunctions.h
OME utility functions.
OMEtickInterval
Statistics record to track amount of time used by an OMEthread.
Definition: OMEthreadCntrl.h:118
OMEthreadController::executeSlice
virtual void executeSlice()=0
Execute a time slice for an active thread.
OMEdefOIL2func::OMEdefOIL2func
OMEdefOIL2func(const char *funcName, zeroFP f, int args)
Definition: OMEthread.h:303
OMEthread::returnReply
OME_FAST_CALL int returnReply(const OMEtype &result)
Definition: OMEthread.cpp:730
OMEoid::getProxyObject
const class OMEoid * getProxyObject(const OMEstring **method) const
Get object Id of meta/proxy object.
Definition: OMEoid.h:270
OMEthread::yieldSlice
void yieldSlice()
Definition: OMEthread.cpp:1112
OMEoid.h
OME object identifier implementation.
OMEobjectInstance::findRoutine
const OME_FAST_CALL OMEinvocationData * findRoutine(int *retGraphLevel, const OMEstring &methodName, const uint32_t hashIndx, const uint32_t argc, const OMEarray &argv, const uint32_t signature=0, const int inheritanceLevel=-1, const int mustBeAtLevel=-1)
Locate a method implementation.
Definition: OMEobject.cpp:542
OMEinvocationData::invocationMode
uint32_t invocationMode
Definition: OMEmethod.h:47
OMEthread::modifiedObject
bool modifiedObject
Definition: OMEthread.h:68
OMEthread::getThisObject
const OMEtype & getThisObject() const OME_ALWAYS_INLINE
Definition: OMEthread.h:152
OME_INVOKE_TRIVIAL_NATIVE
#define OME_INVOKE_TRIVIAL_NATIVE
Definition: OMEmethod.h:14
oneFP
OME_CORE_CALL int(* oneFP)(OMEthread *, OMEtype &, const OMEtype &)
Definition: OMEthread.h:256
OMEthread::getThreadState
OMEthreadStates getThreadState() const OME_ALWAYS_INLINE
Definition: OMEthread.h:119
OME_THREAD_TERMINATED
@ OME_THREAD_TERMINATED
thread is terminated
Definition: OMEthread.h:23
OMEthread::callMethodWithSetArgument
OME_FAST_CALL int callMethodWithSetArgument(const OMEtype &methodName, const uint32_t hashIndx, const OMEtype &argSet)
Definition: OMEthread.cpp:678
OMEruntime.h
OMEcallStack::validReferenceToObject
bool validReferenceToObject()
Definition: OMEthread.h:55
OMEthread::createReplyOID
void createReplyOID()
Definition: OMEthread.cpp:328
OMEassoc
Implements associative array of OMEtype elements.
Definition: OMEassoc.h:112
OMEthread::getThisOID
const OMEoid & getThisOID() const OME_ALWAYS_INLINE
Definition: OMEthread.h:154
INCREMENT_COUNTER32_BY
#define INCREMENT_COUNTER32_BY(v, amt)
Definition: OMEthread.cpp:17
OMEthread::notifyWhenDead
OMEoid * notifyWhenDead
Definition: OMEthread.h:66
OMEstring
Implements text and binary string storage.
Definition: OMEstring.h:305
OMEthread::~OMEthread
virtual ~OMEthread()
Definition: OMEthread.cpp:409
OILnextIterator
OMEtype & OILnextIterator(int *rc, OMEtype &setVar)
Definition: OMEthread.cpp:1243
OMEcheckACL
bool OMEcheckACL(const OMEassoc &acl, const OMEstring &methodName, const OMEthread *threadData)
Definition: OMEobjACL.cpp:173
OMEthread::validReferenceToObject
bool validReferenceToObject() OME_ALWAYS_INLINE
Definition: OMEthread.h:161
OMEtickInterval::stopInterval
void stopInterval()
Definition: OMEthreadCntrl.h:135
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
twoFP
OME_CORE_CALL int(* twoFP)(OMEthread *, OMEtype &, const OMEtype &, const OMEtype &)
Definition: OMEthread.h:258
OMEhash
OME_DLL_EXPORT uint32_t OMEhash(const unsigned char *data, const uint32_t len) NONNULL_PARAMETERS(1)
Fast 32-bit hash over a buffer.
Definition: OMEhash.cpp:13
OMEobject
Base class and abstract interface for an object within a FARGOS/VISTA Object Management Environment.
Definition: OMEobject.h:22
oidIsExternal
int oidIsExternal(OMEthread *thread, OMEtype &result, const OMEtype &obj)
Definition: OMEthread.cpp:70
OMEthread::getPC
uint32_t getPC() const OME_ALWAYS_INLINE
Definition: OMEthread.h:169
OMEtickInterval::startInterval
void startInterval() OME_ALWAYS_INLINE
Definition: OMEthreadCntrl.h:129
eightFP
OME_CORE_CALL int(* eightFP)(OMEthread *, OMEtype &, const OMEtype &, const OMEtype &, const OMEtype &, const OMEtype &, const OMEtype &, const OMEtype &, const OMEtype &, const OMEtype &)
Definition: OMEthread.h:278
OMEdebugExceptions
#define OMEdebugExceptions
Definition: OMEdebugInfo.h:24
fourFP
OME_CORE_CALL int(* fourFP)(OMEthread *, OMEtype &, const OMEtype &, const OMEtype &, const OMEtype &, const OMEtype &)
Definition: OMEthread.h:264
OMEshareConstant
const OMEstring & OMEshareConstant(const OMEstring &stringConstant)
Definition: OMEnamespace.cpp:338
OMEtype::oid
class OMEoid * oid
Definition: OMEbaseType.h:297
OMEstringInROM
const typedef void * OMEstringInROM
Points to immovable, read-only string data.
Definition: OMEstring.h:68
OMEdebugMethodInvocations
#define OMEdebugMethodInvocations
Definition: OMEdebugInfo.h:18
OMEmethod.h
LOG_COUT
#define LOG_COUT(lvl)
Convenience macro that uses LOG_INTO() to conditionally log a message to standard output.
Definition: logging_api.hpp:3007
OMEtype::s
class OMEstring * s
Definition: OMEbaseType.h:299
registerService
int registerService(OMEthread *thread, OMEtype &result, const OMEtype &name, const OMEtype &obj, const OMEtype &flag)
Definition: OMEthread.cpp:118
OMEobjACL.h
OMEcallStack::argv
OMEtype argv
Definition: OMEthread.h:38
OMEarray::outputOnStream
STREAMTYPE & outputOnStream(STREAMTYPE &outputStream, int_fast16_t indent=0, uint8_t includeTypePrefix=OME_DEFAULT_COMPLEX_OUTPUT_MODE) const
Output an OMEarray to an output stream.
Definition: OMEarray.h:275
OMEdefOIL2func::next
OMEdefOIL2func * next
Definition: OMEthread.h:290
OMEcore.h
threeFP
OME_CORE_CALL int(* threeFP)(OMEthread *, OMEtype &, const OMEtype &, const OMEtype &, const OMEtype &)
Definition: OMEthread.h:261
NativeMethodFP
OME_CORE_CALL int(* NativeMethodFP)(class OMEthread *)
Typedef of a native method.
Definition: OMEmethod.h:20
OMEtype::i
int32_t i
Definition: OMEbaseType.h:285
OMEtype::array
class OMEarray * array
Definition: OMEbaseType.h:294
OMEthread::releaseThread
OMEthread * releaseThread()
Definition: OMEthread.cpp:1126
OMEobject::instanceID
uint32_t instanceID
Definition: OMEobject.h:33
OMEthread::outputOnStream
void outputOnStream(std::ostream &o=std::cout) const
Definition: OMEthread.cpp:1172
OMEthread::sourceFileName
const char * sourceFileName
Definition: OMEthread.h:84
OMEthread::exitRoutine
void exitRoutine()
Definition: OMEthread.cpp:1004
OME_INVOKE_OIL2_INTERPRET
#define OME_INVOKE_OIL2_INTERPRET
Definition: OMEmethod.h:11
OMEdefOIL2func::functionName
OMEstring functionName
Definition: OMEthread.h:299
OMEclass
FARGOS/VISTA Object Management Environment class description.
Definition: OMEclass.h:24
OMEthread::suspendThread
void suspendThread()
Definition: OMEthread.cpp:1086
OMEobjectInstance::noteThreadTerminated
OME_FAST_CALL void noteThreadTerminated(class OMEthread *, bool modified, uint32_t exitStatus, bool wasPreemptable)
Definition: OMEobject.cpp:763
zeroFP
OME_CORE_CALL int(* zeroFP)(OMEthread *, OMEtype &)
Definition: OMEthread.h:254
OMEthreadController::suspendThread
virtual void suspendThread()=0
Suspend an active thread.
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
OMEcallStack::stackLength
uint32_t stackLength
Definition: OMEthread.h:42
OMEcallStack::stackPointer
uint32_t stackPointer
Definition: OMEthread.h:40
OME_THREAD_KILLED
@ OME_THREAD_KILLED
thread has been killed
Definition: OMEthread.h:22
atLeastOneFP
OME_CORE_CALL int(* atLeastOneFP)(OMEthread *, OMEtype &, const OMEtype &,...)
Definition: OMEthread.h:282
OMEthread::replyStillPending
bool replyStillPending() const OME_ALWAYS_INLINE
Definition: OMEthread.h:113
OMEthread::noteThreadState
void noteThreadState(const OMEthreadStates s) OME_ALWAYS_INLINE
Definition: OMEthread.h:117
OMEobject::getDefaultOID
const OMEoid & getDefaultOID()
Returns read-only reference to object's default object Id.
Definition: OMEobject.cpp:113
OMEcallStack::argc
OMEtype argc
Definition: OMEthread.h:37
OMEthread::replyResult
OMEtype replyResult
Definition: OMEthread.h:79
OMEmethodDefinition::signature
uint32_t signature
Definition: OMEnamespace.h:91
OME_TypeCheck::typesAreAssignable
static uint32_t typesAreAssignable(uint32_t srcType, uint32_t targetType) OME_CONST_FUNCTION
Definition: OMEbaseType.h:114
OME_ERROR_NO_SUCH_METHOD
#define OME_ERROR_NO_SUCH_METHOD
Definition: OMEerror.h:17
OMEclass::hashIndex
uint32_t hashIndex
OMEhash(className)
Definition: OMEclass.h:57
inCalledMethod
int inCalledMethod(OMEthread *thread, OMEtype &result)
Definition: OMEthread.cpp:1028
OMEobject.h
OMEmethodDefinition::data
void * data
Definition: OMEnamespace.h:97
srcID
const char srcID[]
Definition: catSym.c:17
OME_STRING
@ OME_STRING
Definition: OMEmanifests.h:85
OMEobject::invokeMethodAndWaitForReply
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.
Definition: OMEobject.cpp:156
OMEdebugLogLevel3
#define OMEdebugLogLevel3
Definition: OMEdebugInfo.h:35
OMEdefOIL2func::OMEdefOIL2func
OMEdefOIL2func(const char *funcName, threeFP f, int args)
Definition: OMEthread.h:324
OMEthread::inCalledMethod
bool inCalledMethod() const OME_PURE_FUNCTION
Definition: OMEthread.cpp:1017
OMEthread::generateException
OME_FAST_CALL int generateException(uint_fast32_t argc, const OMEarray &argv) const
Definition: OMEthread.cpp:1197
OMEthreadController::releaseThread
virtual void releaseThread()=0
Release a suspended thread.
OMEthread::executeSlice
void executeSlice()
Definition: OMEthread.cpp:1119
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
OMEthread::terminateThread
void terminateThread()
Definition: OMEthread.cpp:1094
OMEthread::sourceLineNumber
int sourceLineNumber
Definition: OMEthread.h:83
OMEmillisecondsSinceBoot
int64_t OMEmillisecondsSinceBoot()
Obtain the number of milliseconds since boot of local FARGOS/VISTA Object Management Environment proc...
Definition: OMEprocInfo.cpp:93
OMEdebugIncludeArguments
#define OMEdebugIncludeArguments
Definition: OMEdebugInfo.h:22
OMEinvocationData::stackSize
uint32_t stackSize
Definition: OMEmethod.h:46
OMEobjectInstance::dropActiveThreadReference
void dropActiveThreadReference()
Definition: OMEobject.cpp:793
OMEthread::callRoutine
OME_FAST_CALL void callRoutine(const OMEinvocationData *routine, const int level, const OMEstring &methodName, const int srcArgc, const OMEarray &srcArgv)
Definition: OMEthread.cpp:995
OMEcallStack::~OMEcallStack
~OMEcallStack()
Definition: OMEthread.cpp:272
OMEthread::threadNowTerminated
OME_FAST_CALL void threadNowTerminated(uint32_t exitStatus, bool dontDelete=false)
Definition: OMEthread.cpp:1051
OMEcallStack
Call record for OMEthread.
Definition: OMEthread.h:30
OMEthread.h
OMEthread::setErrorCode
void setErrorCode(OMEtype &rc) OME_ALWAYS_INLINE
Definition: OMEthread.h:173
OMEthread::setTickInterval
void setTickInterval(class OMEtickInterval *interval) OME_ALWAYS_INLINE
Definition: OMEthread.h:115
OME_NIL
@ OME_NIL
Definition: OMEmanifests.h:78
OMEdefOIL2func::OMEdefOIL2func
OMEdefOIL2func(const char *funcName, oneFP f, int args)
Definition: OMEthread.h:310
OMEclass.h
OME_EXPECT_TRUE
#define OME_EXPECT_TRUE(expr)
Annotation macro for conditional expression expected to be true.
Definition: compiler_hints.h:541
OMEthread::getReplyOID
const OMEtype & getReplyOID()
Definition: OMEthread.h:125
SIMPLE_INCREMENT_COUNTER32_BY
#define SIMPLE_INCREMENT_COUNTER32_BY(v, amt)
Definition: OMEthread.cpp:19
OME_OID
@ OME_OID
Definition: OMEmanifests.h:84
OMEinvocationData::deleteStackRoutine
DeleteStackFP deleteStackRoutine
Definition: OMEmethod.h:53
OMEobject::getOIDdata
OME_FAST_CALL void getOIDdata(OMEoidID *idInfo) const
Definition: OMEobject.cpp:105
OMEdefineNewMethod
int OMEdefineNewMethod(const OMEmethodDefinition &definitionRecord)
Definition: OMEnamespace.cpp:248
OMEobject::classInfo
const OMEclass * classInfo
Pointer to class description.
Definition: OMEobject.h:37
OMEthread::callStack
OMEcallStack * callStack
Definition: OMEthread.h:74
unregisterService
int unregisterService(OMEthread *thread, OMEtype &result, const OMEtype &name, const OMEtype &obj)
Definition: OMEthread.cpp:162
OMEthread::getThreadPriority
int getThreadPriority() const OME_ALWAYS_INLINE
Definition: OMEthread.h:123
OMEthread::getReplyResult
const OMEtype & getReplyResult() const OME_ALWAYS_INLINE
Definition: OMEthread.h:177
OMEdefOIL2func::listStart
static OMEdefOIL2func * listStart
Definition: OMEthread.h:289
OMEstring::nullOMEstring
static const OMEstring nullOMEstring
Definition: OMEstring.h:317
INIT_DECLARE_OMEthread
OME_DLL_EXPORT void INIT_DECLARE_OMEthread()
Definition: OMEthread.cpp:1276
OMEthread::getErrorCode
OMEtype & getErrorCode() OME_ALWAYS_INLINE
Definition: OMEthread.h:175
OMEthreadController::terminateThread
virtual void terminateThread()=0
Terminate a thread.
OMEthread::threadPriority
int threadPriority
Definition: OMEthread.h:76
OMEtype.h
OME fundamental type implementation.
OMEthread::getUserName
const OMEstring * getUserName() const
Definition: OMEobjACL.cpp:460
NOTE_DEFAULT_NLM
#define NOTE_DEFAULT_NLM(s)
Declare the default message within a DEFINE_NLM_MESSAGE() block.
Definition: OMEdebugInfo.h:314
OMEthread::invokeMethod
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.
Definition: OMEthread.cpp:915
OMEdefOIL2func::OMEdefOIL2func
OMEdefOIL2func(const char *funcName, fourFP f, int args)
Definition: OMEthread.h:331
OMEerror.h
OME error codes.
OMEthread::resultPending
bool resultPending
Definition: OMEthread.h:70
OMEthreadController
Abstract interface for an OME thread controller.
Definition: OMEthreadCntrl.h:22
OMEinvocationData::createStackRoutine
CreateStackFP createStackRoutine
Definition: OMEmethod.h:52
DEFINE_NLM_MESSAGE
#define DEFINE_NLM_MESSAGE(Lvl, MessID, AppName)
Define an Native Language Message.
Definition: OMEdebugInfo.h:318
unregisterAllServices
void unregisterAllServices()
Definition: OMEthread.cpp:109
OMEthread::fromObject
OMEtype fromObject
Definition: OMEthread.h:78
OMEthread::userInfo
OMEtype userInfo
Definition: OMEthread.h:67
OME_USED
const char srcID[] OME_USED
Definition: tick_time.cpp:24
OMEthreadNativeOIL2
Implementation of OME threads for compiled OIL2 source.
Definition: OMEthreadCntrl.h:52
OMEdefOIL2func::OMEdefOIL2func
OMEdefOIL2func(const char *funcName, eightFP f, int args)
Definition: OMEthread.h:359
OMEthread::clearResultPending
void clearResultPending() OME_ALWAYS_INLINE
Definition: OMEthread.h:109
OMEcallStack::OMEcallStack
OMEcallStack(const OMEoid &obj, const OMEinvocationData *routine, int level, const OMEstring &methodNm, const uint32_t srcArgc, const OMEarray &srcArgv)
Definition: OMEthread.cpp:241
OMEobjectInstance
Subclass of OMEobject that provides access to a local object.
Definition: OMEobject.h:135
OME_ERROR_NO_SUCH_OBJECT
#define OME_ERROR_NO_SUCH_OBJECT
Definition: OMEerror.h:19
OMEobject::getTickCount
OME_FAST_CALL int64_t getTickCount() const OME_ALWAYS_INLINE
Return number of elapsed time in ticks spent executing object's methods.
Definition: OMEobject.h:94
OMEthread::sendMessageAndWait
OME_FAST_CALL int sendMessageAndWait(const OMEstring &methodName, const uint32_t hashIndx, const uint32_t argc, const OMEarray &argv, const OMEtype &destObj)
Definition: OMEthread.cpp:827
OMEcallStack::objectData
OMEtype objectData
Definition: OMEthread.h:32
sevenFP
OME_CORE_CALL int(* sevenFP)(OMEthread *, OMEtype &, const OMEtype &, const OMEtype &, const OMEtype &, const OMEtype &, const OMEtype &, const OMEtype &, const OMEtype &)
Definition: OMEthread.h:274
OME_THREAD_INIT
@ OME_THREAD_INIT
thread is being initialized
Definition: OMEthread.h:19
OMEarray::elementCount
uint_fast32_t elementCount() const OME_ALWAYS_INLINE
Definition: OMEarray.h:247
OME_CONST_FUNCTION
#define OME_CONST_FUNCTION
Mark as an idempotent function that only accesses arguments – no global data.
Definition: compiler_hints.h:390
OMEclass::className
OMEstring className
Definition: OMEclass.h:55
OME_INVOKE_KERNEL_THREAD
#define OME_INVOKE_KERNEL_THREAD
Definition: OMEmethod.h:13
OMEthread::fromThreadInstance
OMEthread * fromThreadInstance
Definition: OMEthread.h:80
OME_SET
@ OME_SET
Definition: OMEmanifests.h:89
NEXT_NLM_PARAM
#define NEXT_NLM_PARAM
Define value for next positional parameter.
Definition: OMEdebugInfo.h:337
atomic_values.h
Atomic operations.
OMEtickInterval::addIntervalCounts
void addIntervalCounts(const OMEinvocationData *method)
Definition: OMEthreadCntrl.cpp:41
OMEthread::tickInterval
class OMEtickInterval * tickInterval
Definition: OMEthread.h:85
OMEdefOIL2func::~OMEdefOIL2func
~OMEdefOIL2func()
Definition: OMEthread.h:366
OMEdefOIL2func
Record to define the implementation of an OIL2 function.
Definition: OMEthread.h:287
OMEthreadStates
OMEthreadStates
Definition: OMEthread.h:18
OME_TypeCheck::CAN_ASSIGN
@ CAN_ASSIGN
can assign into type
Definition: OMEbaseType.h:63
OMEdefOIL2func::OMEdefOIL2func
OMEdefOIL2func(const char *funcName, twoFP f, int args)
Definition: OMEthread.h:317
OME_EXPECT_FALSE
#define OME_EXPECT_FALSE(expr)
Annotation macro for conditional expression expected to be false.
Definition: compiler_hints.h:540
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
OMEmethodDefinition::methodName
const char * methodName
Definition: OMEnamespace.h:90
OMEdefOIL2func::OMEdefOIL2func
OMEdefOIL2func(const char *funcName, fiveFP f, int args)
Definition: OMEthread.h:338
OMEthreadExecQueue
Implements thread queues with multiple levels of priority.
Definition: OMEexecQueue.h:21
OMEthreadNative
Implementation of OME thread controller for native threads.
Definition: OMEthreadCntrl.h:89
OMEtype::outputOnStream
STREAMTYPE & outputOnStream(STREAMTYPE &outputOnStream, int_fast16_t indent=0, uint8_t includeTypePrefix=OUTPUT_TYPENAME) const
Definition: OMEoutputOnStream.h:311
OMErouteEntry.h
OME_FAST_CALL
#define OME_FAST_CALL
Definition: compiler_hints.h:468
OMEthread::preemptable
bool preemptable
Definition: OMEthread.h:69
listRegisteredServices
int listRegisteredServices(OMEthread *, OMEtype &result, const OMEtype &flag)
Definition: OMEthread.cpp:212
OMEdefOIL2func::argCount
int argCount
Definition: OMEthread.h:301
OMEthread::setResultPending
void setResultPending() OME_ALWAYS_INLINE
Definition: OMEthread.h:111
OMEdefOIL2func::registerFunction
void registerFunction()
Definition: OMEthread.h:292
_STD
#define _STD
Definition: OMEmanifests.h:146
OMEset::nextElement
OMEtype * nextElement()
Iterate over a set by retrieving the next element.
Definition: OMEset.cpp:280
OMEdebugInfo.h
OME debug and profiling interfaces.
OMEoid::isExternal
bool isExternal() const OME_ALWAYS_INLINE
Definition: OMEoid.h:300
fiveFP
OME_CORE_CALL int(* fiveFP)(OMEthread *, OMEtype &, const OMEtype &, const OMEtype &, const OMEtype &, const OMEtype &, const OMEtype &)
Definition: OMEthread.h:267
OMEobject::invokeMethod
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)=0
Invoke method against an object.
OME_DLL_EXPORT
#define OME_DLL_EXPORT
Definition: compiler_hints.h:464
lookupLocalService
int lookupLocalService(OMEthread *thread, OMEtype &result, const OMEtype &name)
Definition: OMEthread.cpp:190
OMEarray
Implements sparse array of OMEtype elements.
Definition: OMEarray.h:75
OMEreferenceCount::dropReference
int_fast32_t dropReference()
Definition: OMErefCount.cpp:144
OMEnamespace.h
OMEthreadController::controllerType
virtual const char * controllerType() const OME_CONST_FUNCTION=0
Return label identifying the type of the thread controller.
OMEthread
Public interface to an OME thread.
Definition: OMEthread.h:60
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
OMEthread::setAsPreemptable
void setAsPreemptable()
Definition: OMEthread.cpp:450
OMEcallStack::programCounter
uint32_t programCounter
Definition: OMEthread.h:39
OMEthread::setUserID
OME_FAST_CALL int setUserID(const OMEstring &userID, const OMEstring &pwInfo)
Definition: OMEobjACL.cpp:437
OMEthread::dropThisObjectReference
void dropThisObjectReference() OME_ALWAYS_INLINE
Definition: OMEthread.h:159
OMEthread::getInstanceData
OME_FAST_CALL void * getInstanceData() const
Definition: OMEthread.cpp:1036
OMEtype::type
uint32_t type
Definition: OMEbaseType.h:304
OME_DEFAULT_COMPLEX_OUTPUT_MODE
@ OME_DEFAULT_COMPLEX_OUTPUT_MODE
Definition: OMEmanifests.h:116
OMEcallStack::getThisObject
const OME_FAST_CALL OMEtype & getThisObject() const
Definition: OMEthread.h:51
OME_ERROR_NOT_AUTHORIZED
#define OME_ERROR_NOT_AUTHORIZED
Definition: OMEerror.h:18
OMEgetObjectCreatorOID
OME_FAST_CALL OMEtype & OMEgetObjectCreatorOID(const OMEtype &userInfo) OME_CONST_FUNCTION
Definition: OMEcreate.cpp:117
sixFP
OME_CORE_CALL int(* sixFP)(OMEthread *, OMEtype &, const OMEtype &, const OMEtype &, const OMEtype &, const OMEtype &, const OMEtype &, const OMEtype &)
Definition: OMEthread.h:270
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
OMEtype
#define OMEtype
Definition: tmp.o.cpp:396
OMEset::resetIterator
void resetIterator()
Reset the internal iterator to the beginning of the list.
Definition: OMEset.cpp:264
OMEtype::set
class OMEset * set
Definition: OMEbaseType.h:298
AND_OUTPUT_NLM
#define AND_OUTPUT_NLM(o, t)
Render NLM data to an output stream.
Definition: OMEdebugInfo.h:327
OMEoid::refersTo
bool refersTo(const class OMEobject *obj) const OME_ALWAYS_INLINE
Definition: OMEoid.h:295
OMEthread::threadErrorCode
OMEtype threadErrorCode
Definition: OMEthread.h:81
OMEthread::getUserID
const OMEtype & getUserID() const OME_ALWAYS_INLINE
Definition: OMEthread.h:146
OMEfindGatewayToDestination
const OMEoid * OMEfindGatewayToDestination(const OMEoid *remoteObj)
Lookup the gateway object to be used to send a messsage to a particular object identifier.
Definition: OMErouteEntry.cpp:18
OMEthread::threadState
OMEthreadStates threadState
Definition: OMEthread.h:75
OMEinvocationData::code
union OMEinvocationData::@30 code
OMEthread::defineOMEthreadClass
static void defineOMEthreadClass()
Definition: OMEthread.cpp:315
OMEdefOIL2func::OMEdefOIL2func
OMEdefOIL2func(const char *funcName, sevenFP f, int args)
Definition: OMEthread.h:352
yieldSlice
int yieldSlice(OMEthread *thread, OMEtype &result)
Definition: OMEthread.cpp:61
OMEoidID
Fundamental elements of an OME object identifier.
Definition: OMEoid.h:27
OME_INVOKE_OIL2_NATIVE
#define OME_INVOKE_OIL2_NATIVE
Definition: OMEmethod.h:12
OMEoid::getInstanceInMemory
const class OMEobject * getInstanceInMemory() const
Return object information record.
Definition: OMEoid.h:280
OME_ASSOC
@ OME_ASSOC
Definition: OMEmanifests.h:87
OMEobject::totalInvocations
uint32_t totalInvocations
Definition: OMEobject.h:32
OMEthreadInterpretOIL2
Specialization of OMEthreadNativeOIL2 for OIL2 source compiled to OIL2 Architecture Native Format.
Definition: OMEthreadCntrl.h:70
OMEcallStack::methodBody
const OMEinvocationData * methodBody
Definition: OMEthread.h:34
OMEthread::threadController
OMEthreadController * threadController
Definition: OMEthread.h:65
OMEthread::setReplyResult
OME_FAST_CALL void setReplyResult(const OMEtype &arg, bool sameThread=false)
Definition: OMEthread.cpp:439
OMEthread::noteObjectModified
void noteObjectModified() OME_ALWAYS_INLINE
Definition: OMEthread.h:191
OME_PURE_FUNCTION
#define OME_PURE_FUNCTION
Mark as an idempotent function that can access global variables.
Definition: compiler_hints.h:388
OMEobjectInstance::getInstanceDataAtLevel
OME_FAST_CALL void * getInstanceDataAtLevel(uint_fast16_t lvl) const OME_ALWAYS_INLINE
Return pointer to instance variables.
Definition: OMEobject.h:187
OMEthreadController::yieldSlice
virtual void yieldSlice()=0
Yield time slice currently being used by an active thread.
OMEthread::OMEthread
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)
Definition: OMEthread.cpp:346
LOG_CERR
#define LOG_CERR(lvl)
Convenience macro that uses LOG_INTO() to conditionally log a message to standard error.
Definition: logging_api.hpp:3014
OMEthread::replyOID
OMEtype * replyOID
Definition: OMEthread.h:64
logging_api.hpp
FARGOS Logging API.
OMEthreadCntrl.h
Generated: Fri Jul 31 2020 18:19:15
Support Information