FARGOS/VISTA Object Management Environment Core  ..
FARGOS/VISTA Object Management Environment Core Table of Contents
OMEmethod.h
Go to the documentation of this file.
1 #ifndef _OME_METHOD_H
2 #define _OME_METHOD_H "$Id: OMEmethod.h 452 2020-07-23 20:19:23Z geoff $"
4 
10 // Invocation Modes
11 #define OME_INVOKE_OIL2_INTERPRET 1
12 #define OME_INVOKE_OIL2_NATIVE 2
13 #define OME_INVOKE_KERNEL_THREAD 3
14 #define OME_INVOKE_TRIVIAL_NATIVE 4
15 
16 #include <OMEtype.h>
18 
20 typedef OME_CORE_CALL int (*NativeMethodFP)(class OMEthread *);
22 typedef OME_CORE_CALL void *(*CreateStackFP)(const class OMEinvocationData *mInfo);
24 typedef OME_CORE_CALL void (*DeleteStackFP)(const class OMEinvocationData *mInfo, void *data);
25 
27 extern OME_CORE_CALL void *OMEdefaultStackCreate(const class OMEinvocationData *mInfo);
29 extern OME_CORE_CALL void OMEdefaultStackDelete(const class OMEinvocationData *mInfo, void *data);
30 
31 
36 private:
39  mutable uint64_t totalTicks;
40  mutable uint32_t totalSlices;
41 public:
42  mutable uint32_t totalInvocations;
44  uint32_t signature;
45  uint32_t anyMask; // precomputed value
46  uint32_t stackSize;
47  uint32_t invocationMode;
48  union {
49  NativeMethodFP function;
50  void *data;
51  } code;
56 
57 
59 
60  explicit OMEinvocationData(const OMEinvocationData &);
61 
63 
64  int setStorageDescription(const struct OMEinstanceVarDescr *desc);
65 
66  int setStorageDescription(const OMEarray &oil2Data);
67 
68  OME_FAST_CALL void addTickCount(const int64_t tickCount) const OME_ALWAYS_INLINE {
69  atomicIncrement_uint64(&totalTicks, tickCount);
70  atomicIncrement_uint32(&totalSlices, 1);
71  }
72 
73  OME_FAST_CALL int64_t getTickCount() const { return (totalTicks); }
74 
75  OME_FAST_CALL uint32_t getSliceCount() const { return (totalSlices); }
76 
77  OME_FAST_CALL uint32_t getInvocationCount() const { return (totalInvocations); }
78 }; // end class OMEinvocationData
79 
82 class OMEmethod final : public OMEreferenceCount {
83 private:
85 public:
87 
88  OMEmethod(const OMEstring &nm, OMEinvocationData *impl);
89 
90  ~OMEmethod();
91 
93 
94  void addImplementation(OMEmethod *oldRec);
95 
97 
98  OME_FAST_CALL uint_fast32_t listMethodInfo(OMEarray &result, const uint_fast32_t count=0) const;
99 
100 }; // end class OMEmethod
101 
103 
104 
107 #endif
108 
109 /* vim: set expandtab shiftwidth=4 tabstop=4: */
OMEprofileCounter< uint32_t >
OMEinvocationData::varDescRec
const struct OMEinstanceVarDescr * varDescRec
Definition: OMEmethod.h:37
OMEinvocationData::function
NativeMethodFP function
Definition: OMEmethod.h:49
OMEmethodP
OMEmethod * OMEmethodP
Definition: OMEmethod.h:102
OMEinvocationData::signature
uint32_t signature
Definition: OMEmethod.h:44
OMEinvocationData::invocationMode
uint32_t invocationMode
Definition: OMEmethod.h:47
OMEdefaultStackCreate
OME_CORE_CALL void * OMEdefaultStackCreate(const class OMEinvocationData *mInfo)
Default stack creation routine for a native method.
OMEinvocationData::data
void * data
Definition: OMEmethod.h:50
OMEassoc
Implements associative array of OMEtype elements.
Definition: OMEassoc.h:112
OMEstring
Implements text and binary string storage.
Definition: OMEstring.h:305
OME_DELETE_OBJECT_VECTOR
#define OME_DELETE_OBJECT_VECTOR(ptr)
Definition: OMEmanifests.h:160
OMEmethod::findImplementationWithSignature
OME_FAST_CALL OMEinvocationData * findImplementationWithSignature(const uint32_t sig) const
Definition: OMEmethod.cpp:123
OMEtype
Fundamental ANY type for FARGOS/VISTA Object Management Environment.
Definition: OMEbaseType.h:250
OMEinvocationData::variableDescriptions
OMEarray variableDescriptions
Definition: OMEmethod.h:38
OMEmethod
Description of an OME method.
Definition: OMEmethod.h:82
OMEmethod.h
OMEinvocationData::setStorageDescription
int setStorageDescription(const struct OMEinstanceVarDescr *desc)
Definition: OMEmethod.cpp:69
OMEmethod::methodName
OMEstring methodName
Definition: OMEmethod.h:86
OMEcore.h
NativeMethodFP
OME_CORE_CALL int(* NativeMethodFP)(class OMEthread *)
Typedef of a native method.
Definition: OMEmethod.h:20
OMEinvocationData::addTickCount
OME_FAST_CALL void addTickCount(const int64_t tickCount) const OME_ALWAYS_INLINE
Definition: OMEmethod.h:68
OMEinstanceVarDescr
Meta data record to describe an instance variable of a class.
Definition: OMEnamespace.h:76
OME_INVOKE_OIL2_INTERPRET
#define OME_INVOKE_OIL2_INTERPRET
Definition: OMEmethod.h:11
OMEinvocationData::localGlobals
OMEarray localGlobals
Definition: OMEmethod.h:55
OMEreferenceCount
Base class for reference-counted data.
Definition: OMErefCount.h:31
OMEinvocationData::~OMEinvocationData
~OMEinvocationData()
Definition: OMEmethod.cpp:61
CreateStackFP
OME_CORE_CALL void *(* CreateStackFP)(const class OMEinvocationData *mInfo)
Typedef for stack creation routine associated with a native method.
Definition: OMEmethod.h:22
OMEinvocationData::constantTable
OMEarray constantTable
Definition: OMEmethod.h:54
OMEinvocationData::anyMask
uint32_t anyMask
Definition: OMEmethod.h:45
srcID
const char srcID[]
Definition: catSym.c:17
OMEinvocationData::getTickCount
OME_FAST_CALL int64_t getTickCount() const
Definition: OMEmethod.h:73
OMEinvocationData::stackSize
uint32_t stackSize
Definition: OMEmethod.h:46
OMEmethod::implementationList
OMEinvocationData * implementationList
Definition: OMEmethod.h:84
OMEclass.h
OME_EXPECT_TRUE
#define OME_EXPECT_TRUE(expr)
Annotation macro for conditional expression expected to be true.
Definition: compiler_hints.h:541
OMEinvocationData::deleteStackRoutine
DeleteStackFP deleteStackRoutine
Definition: OMEmethod.h:53
OMEtype.h
OME fundamental type implementation.
OMEinvocationData::createStackRoutine
CreateStackFP createStackRoutine
Definition: OMEmethod.h:52
OMEmethod::listMethodInfo
OME_FAST_CALL uint_fast32_t listMethodInfo(OMEarray &result, const uint_fast32_t count=0) const
Definition: OMEmethod.cpp:166
OME_USED
const char srcID[] OME_USED
Definition: tick_time.cpp:24
OMEinvocationData::OMEinvocationData
OMEinvocationData()
Definition: OMEmethod.cpp:30
DeleteStackFP
OME_CORE_CALL void(* DeleteStackFP)(const class OMEinvocationData *mInfo, void *data)
Typedef for stack delete routine associated with a native method.
Definition: OMEmethod.h:24
OMEinvocationData::getInvocationCount
OME_FAST_CALL uint32_t getInvocationCount() const
Definition: OMEmethod.h:77
atomic_values.h
Atomic operations.
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
OMEmethod::addImplementation
void addImplementation(OMEinvocationData *impl)
Definition: OMEmethod.cpp:96
OME_FAST_CALL
#define OME_FAST_CALL
Definition: compiler_hints.h:468
OMEmethod::~OMEmethod
~OMEmethod()
Definition: OMEmethod.cpp:147
OMEdebugInfo.h
OME debug and profiling interfaces.
OMEinvocationData::totalInvocations
uint32_t totalInvocations
Definition: OMEmethod.h:42
OMEarray
Implements sparse array of OMEtype elements.
Definition: OMEarray.h:75
OMEthread
Public interface to an OME thread.
Definition: OMEthread.h:60
OMEinvocationData::getSliceCount
OME_FAST_CALL uint32_t getSliceCount() const
Definition: OMEmethod.h:75
OMEinvocationData::totalTicks
uint64_t totalTicks
Definition: OMEmethod.h:39
OMEinvocationData::totalSlices
uint32_t totalSlices
Definition: OMEmethod.h:40
OMEdefaultStackDelete
OME_CORE_CALL void OMEdefaultStackDelete(const class OMEinvocationData *mInfo, void *data)
Default stack delete routine for a native method.
OMEinvocationData::next
class OMEinvocationData * next
Definition: OMEmethod.h:43
OMEdefaultStackCreate
void * OMEdefaultStackCreate(const OMEinvocationData *mInfo)
Definition: OMEmethod.cpp:14
OME_CORE_CALL
#define OME_CORE_CALL
Definition: compiler_hints.h:472
OMEtype
#define OMEtype
Definition: tmp.o.cpp:396
OMEmethod::OMEmethod
OMEmethod(const OMEstring &nm, OMEinvocationData *impl)
Definition: OMEmethod.cpp:85
OMEconvertToStorageDescription
uint_fast16_t OMEconvertToStorageDescription(OMEarray &varDesc, const OMEinstanceVarDescr *desc)
Definition: OMEclass.cpp:188
OMEinvocationData::code
union OMEinvocationData::@30 code
OMEdefaultStackDelete
void OMEdefaultStackDelete(const OMEinvocationData *mInfo, void *data)
Definition: OMEmethod.cpp:24
Generated: Fri Jul 31 2020 18:19:14
Support Information