1 #ifndef NDPluginDriver_H 2 #define NDPluginDriver_H 5 #include <epicsTypes.h> 6 #include <epicsMessageQueue.h> 7 #include <epicsThread.h> 33 #define NDPluginDriverArrayPortString "NDARRAY_PORT" 34 #define NDPluginDriverArrayAddrString "NDARRAY_ADDR" 35 #define NDPluginDriverPluginTypeString "PLUGIN_TYPE" 36 #define NDPluginDriverDroppedArraysString "DROPPED_ARRAYS" 37 #define NDPluginDriverQueueSizeString "QUEUE_SIZE" 38 #define NDPluginDriverQueueFreeString "QUEUE_FREE" 39 #define NDPluginDriverMaxThreadsString "MAX_THREADS" 40 #define NDPluginDriverNumThreadsString "NUM_THREADS" 41 #define NDPluginDriverSortModeString "SORT_MODE" 42 #define NDPluginDriverSortTimeString "SORT_TIME" 43 #define NDPluginDriverSortSizeString "SORT_SIZE" 44 #define NDPluginDriverSortFreeString "SORT_FREE" 45 #define NDPluginDriverDisorderedArraysString "DISORDERED_ARRAYS" 46 #define NDPluginDriverDroppedOutputArraysString "DROPPED_OUTPUT_ARRAYS" 47 #define NDPluginDriverEnableCallbacksString "ENABLE_CALLBACKS" 48 #define NDPluginDriverBlockingCallbacksString "BLOCKING_CALLBACKS" 49 #define NDPluginDriverProcessPluginString "PROCESS_PLUGIN" 50 #define NDPluginDriverExecutionTimeString "EXECUTION_TIME" 51 #define NDPluginDriverMinCallbackTimeString "MIN_CALLBACK_TIME" 53 #define NDPluginDriverMaxByteRateString "MAX_BYTE_RATE" 55 class epicsShareClass NDPluginDriver : public asynNDArrayDriver, public epicsThreadRunable { 57 NDPluginDriver(
const char *portName,
int queueSize,
int blockingCallbacks,
58 const char *NDArrayPort,
int NDArrayAddr,
int maxAddr,
59 int maxBuffers,
size_t maxMemory,
int interfaceMask,
int interruptMask,
60 int asynFlags,
int autoConnect,
int priority,
int stackSize,
int maxThreads,
61 bool compressionAware =
false);
65 virtual asynStatus writeInt32(asynUser *pasynUser, epicsInt32
value);
66 virtual asynStatus writeFloat64(asynUser *pasynUser, epicsFloat64
value);
67 virtual asynStatus writeOctet(asynUser *pasynUser,
const char *
value,
size_t maxChars,
69 virtual asynStatus readInt32Array(asynUser *pasynUser, epicsInt32 *
value,
70 size_t nElements,
size_t *nIn);
73 virtual void driverCallback(asynUser *pasynUser,
void *genericPointer);
74 virtual void run(
void);
75 virtual asynStatus start(
void);
79 virtual void processCallbacks(
NDArray *pArray) = 0;
80 virtual void beginProcessCallbacks(
NDArray *pArray);
81 virtual asynStatus endProcessCallbacks(
NDArray *pArray,
bool copyArray=
false,
bool readAttributes=
true);
82 virtual asynStatus connectToArrayPort(
void);
83 virtual asynStatus setArrayInterrupt(
int connect);
86 int NDPluginDriverArrayPort;
87 #define FIRST_NDPLUGIN_PARAM NDPluginDriverArrayPort 88 int NDPluginDriverArrayAddr;
89 int NDPluginDriverPluginType;
90 int NDPluginDriverDroppedArrays;
91 int NDPluginDriverQueueSize;
92 int NDPluginDriverQueueFree;
93 int NDPluginDriverMaxThreads;
94 int NDPluginDriverNumThreads;
95 int NDPluginDriverSortMode;
96 int NDPluginDriverSortTime;
97 int NDPluginDriverSortSize;
98 int NDPluginDriverSortFree;
99 int NDPluginDriverDisorderedArrays;
100 int NDPluginDriverDroppedOutputArrays;
101 int NDPluginDriverEnableCallbacks;
102 int NDPluginDriverBlockingCallbacks;
103 int NDPluginDriverProcessPlugin;
104 int NDPluginDriverExecutionTime;
105 int NDPluginDriverMinCallbackTime;
106 int NDPluginDriverMaxByteRate;
113 asynStatus createCallbackThreads();
114 asynStatus startCallbackThreads();
115 asynStatus deleteCallbackThreads();
116 asynStatus createSortingThread();
119 void *asynGenericPointerInterruptPvt_;
124 bool firstOutputArray_;
125 asynUser *pasynUserGenericPointer_;
126 void *asynGenericPointerPvt_;
127 asynGenericPointer *pasynGenericPointer_;
128 bool connectedToArrayPort_;
129 std::vector<epicsThread*>pThreads_;
130 epicsMessageQueue *pToThreadMsgQ_;
131 epicsMessageQueue *pFromThreadMsgQ_;
132 std::multiset<sortedListElement> sortedNDArrayList_;
134 epicsThreadId sortingThreadId_;
135 epicsTimeStamp lastProcessTime_;
137 bool compressionAware_;
Class from which actual plugin drivers are derived; derived from asynNDArrayDriver.
Definition: NDPluginDriver.h:56
Definition: NDPluginDriver.h:23
epicsTimeStamp insertionTime_
Definition: NDPluginDriver.h:30
#define ND_ARRAY_MAX_DIMS
NDArray.h.
Definition: NDArray.h:25
list value
Definition: makeDbAndEdl.py:234
friend bool operator<(const sortedListElement &lhs, const sortedListElement &rhs)
Definition: NDPluginDriver.h:26
Definition: throttler.h:6
int uniqueId
A number that must be unique for all NDArrays produced by a driver after is has started.
Definition: NDArray.h:114
sortedListElement(NDArray *pArray, epicsTimeStamp time)
Definition: NDPluginDriver.cpp:52
NDArray * pArray_
Definition: NDPluginDriver.h:29
N-dimensional array class; each array has a set of dimensions, a data type, pointer to data,...
Definition: NDArray.h:92