1#ifndef NDPluginDriver_H
2#define NDPluginDriver_H
6#include <epicsMessageQueue.h>
7#include <epicsThread.h>
35#define NDPluginDriverArrayPortString "NDARRAY_PORT"
36#define NDPluginDriverArrayAddrString "NDARRAY_ADDR"
37#define NDPluginDriverPluginTypeString "PLUGIN_TYPE"
38#define NDPluginDriverDroppedArraysString "DROPPED_ARRAYS"
39#define NDPluginDriverQueueSizeString "QUEUE_SIZE"
40#define NDPluginDriverQueueFreeString "QUEUE_FREE"
41#define NDPluginDriverMaxThreadsString "MAX_THREADS"
42#define NDPluginDriverNumThreadsString "NUM_THREADS"
43#define NDPluginDriverSortModeString "SORT_MODE"
44#define NDPluginDriverSortTimeString "SORT_TIME"
45#define NDPluginDriverSortSizeString "SORT_SIZE"
46#define NDPluginDriverSortFreeString "SORT_FREE"
47#define NDPluginDriverDisorderedArraysString "DISORDERED_ARRAYS"
48#define NDPluginDriverDroppedOutputArraysString "DROPPED_OUTPUT_ARRAYS"
49#define NDPluginDriverEnableCallbacksString "ENABLE_CALLBACKS"
50#define NDPluginDriverBlockingCallbacksString "BLOCKING_CALLBACKS"
51#define NDPluginDriverProcessPluginString "PROCESS_PLUGIN"
52#define NDPluginDriverExecutionTimeString "EXECUTION_TIME"
53#define NDPluginDriverMinCallbackTimeString "MIN_CALLBACK_TIME"
55#define NDPluginDriverMaxByteRateString "MAX_BYTE_RATE"
59 NDPluginDriver(
const char *portName,
int queueSize,
int blockingCallbacks,
60 const char *NDArrayPort,
int NDArrayAddr,
int maxAddr,
61 int maxBuffers,
size_t maxMemory,
int interfaceMask,
int interruptMask,
62 int asynFlags,
int autoConnect,
int priority,
int stackSize,
int maxThreads,
63 bool compressionAware =
false);
67 virtual asynStatus
writeInt32(asynUser *pasynUser, epicsInt32 value);
68 virtual asynStatus writeFloat64(asynUser *pasynUser, epicsFloat64 value);
69 virtual asynStatus
writeOctet(asynUser *pasynUser,
const char *value,
size_t maxChars,
71 virtual asynStatus readInt32Array(asynUser *pasynUser, epicsInt32 *value,
72 size_t nElements,
size_t *nIn);
75 virtual void driverCallback(asynUser *pasynUser,
void *genericPointer);
76 virtual void run(
void);
77 virtual asynStatus start(
void);
82 virtual void beginProcessCallbacks(
NDArray *pArray);
83 virtual asynStatus endProcessCallbacks(
NDArray *pArray,
bool copyArray=
false,
bool readAttributes=
true);
84 virtual asynStatus connectToArrayPort(
void);
85 virtual asynStatus setArrayInterrupt(
int connect);
89 #define FIRST_NDPLUGIN_PARAM NDPluginDriverArrayPort
111 bool throttled(
NDArray *pArray);
115 asynStatus createCallbackThreads();
116 asynStatus startCallbackThreads();
117 asynStatus deleteCallbackThreads();
118 asynStatus createSortingThread();
121 void *asynGenericPointerInterruptPvt_;
126 bool firstOutputArray_;
127 asynUser *pasynUserGenericPointer_;
128 void *asynGenericPointerPvt_;
129 asynGenericPointer *pasynGenericPointer_;
130 bool connectedToArrayPort_;
131 std::vector<epicsThread*>pThreads_;
132 epicsMessageQueue *pToThreadMsgQ_;
133 epicsMessageQueue *pFromThreadMsgQ_;
134 std::multiset<sortedListElement> sortedNDArrayList_;
136 epicsThreadId sortingThreadId_;
137 epicsTimeStamp lastProcessTime_;
139 bool compressionAware_;
#define ND_ARRAY_MAX_DIMS
NDArray.h.
Definition NDArray.h:26
#define NDPLUGIN_API
Definition NDPluginAPI.h:41
N-dimensional array class; each array has a set of dimensions, a data type, pointer to data,...
Definition NDArray.h:99
int uniqueId
A number that must be unique for all NDArrays produced by a driver after is has started.
Definition NDArray.h:121
Class from which actual plugin drivers are derived; derived from asynNDArrayDriver.
Definition NDPluginDriver.h:57
int NDPluginDriverSortFree
Definition NDPluginDriver.h:100
int NDPluginDriverQueueSize
Definition NDPluginDriver.h:93
int NDPluginDriverEnableCallbacks
Definition NDPluginDriver.h:103
int NDPluginDriverDroppedArrays
Definition NDPluginDriver.h:92
int NDPluginDriverProcessPlugin
Definition NDPluginDriver.h:105
int NDPluginDriverMinCallbackTime
Definition NDPluginDriver.h:107
int NDPluginDriverBlockingCallbacks
Definition NDPluginDriver.h:104
int NDPluginDriverMaxByteRate
Definition NDPluginDriver.h:108
virtual void processCallbacks(NDArray *pArray)=0
int NDPluginDriverQueueFree
Definition NDPluginDriver.h:94
int NDPluginDriverSortSize
Definition NDPluginDriver.h:99
int NDPluginDriverNumThreads
Definition NDPluginDriver.h:96
int NDPluginDriverMaxThreads
Definition NDPluginDriver.h:95
int NDPluginDriverDisorderedArrays
Definition NDPluginDriver.h:101
int NDPluginDriverSortTime
Definition NDPluginDriver.h:98
int NDPluginDriverArrayAddr
Definition NDPluginDriver.h:90
NDArray * pPrevInputArray_
Definition NDPluginDriver.h:110
int NDPluginDriverSortMode
Definition NDPluginDriver.h:97
int NDPluginDriverPluginType
Definition NDPluginDriver.h:91
int NDPluginDriverArrayPort
Definition NDPluginDriver.h:88
int NDPluginDriverExecutionTime
Definition NDPluginDriver.h:106
int NDPluginDriverDroppedOutputArrays
Definition NDPluginDriver.h:102
This is the class from which NDArray drivers are derived; implements the asynGenericPointer functions...
Definition asynNDArrayDriver.h:136
virtual asynStatus writeInt32(asynUser *pasynUser, epicsInt32 value)
Definition asynNDArrayDriver.cpp:671
virtual asynStatus writeOctet(asynUser *pasynUser, const char *value, size_t maxChars, size_t *nActual)
Called when asyn clients call pasynOctet->write().
Definition asynNDArrayDriver.cpp:511
Definition NDPluginDriver.h:25
NDArray * pArray_
Definition NDPluginDriver.h:31
friend bool operator<(const sortedListElement &lhs, const sortedListElement &rhs)
Definition NDPluginDriver.h:28
epicsTimeStamp insertionTime_
Definition NDPluginDriver.h:32