areaDetector 3-14
EPICS areaDetector framework
streamApi.h
Go to the documentation of this file.
1#ifndef STREAM_API_H
2#define STREAM_API_H
3
4#include <stdlib.h>
5#include <stdint.h>
6#include <NDArray.h>
7#include <zmq.h>
8#include <stream2.h>
9
17
18typedef struct
19{
20 size_t series;
22
24{
25private:
26 char *mHostname;
27 void *mCtx, *mSock;
28 size_t mSeries;
29 size_t mFrame;
30
31 int poll (int timeout); // timeout in seconds
32
33public:
34 StreamAPI (const char *hostname);
35 ~StreamAPI (void);
36 int getHeader (stream_header_t *header, int timeout = 0);
37 int waitFrame (int *end, int timeout = 0);
38 int getFrame (NDArray **pArray, NDArrayPool *pNDArrayPool, int decompress);
39};
40
41class Stream2API
42{
43private:
44 char *mHostname;
45 void *mCtx, *mSock;
46 uint64_t mSeries_id;
47 char* mImage_dtype;
48 zmq_msg_t mMsg;
49 stream2_image_msg *mImageMsg;
50 uint64_t mImage_size_x;
51 uint64_t mImage_size_y;
52 uint64_t mNumber_of_images;
53
54 int poll (int timeout); // timeout in seconds
55
56public:
57 Stream2API (const char *hostname);
59 int getHeader (stream_header_t *header, int timeout = 0);
60 int waitFrame (int *end, int timeout = 0);
61 int getFrame (NDArray **pArray, NDArrayPool *pNDArrayPool, int decompress);
62};
63
64
65#endif
N-dimensional array class; each array has a set of dimensions, a data type, pointer to data,...
Definition NDArray.h:99
The NDArrayPool class manages a free list (pool) of NDArray objects.
Definition NDArray.h:168
Definition stream2Api.h:13
~Stream2API(void)
int waitFrame(int *end, int timeout=0)
int getHeader(stream_header_t *header, int timeout=0)
Stream2API(const char *hostname)
int getFrame(NDArray **pArray, NDArrayPool *pNDArrayPool, int decompress)
Definition streamApi.h:24
~StreamAPI(void)
Definition streamApi.cpp:186
int getFrame(NDArray **pArray, NDArrayPool *pNDArrayPool, int decompress)
Definition streamApi.cpp:300
int getHeader(stream_header_t *header, int timeout=0)
Definition streamApi.cpp:193
int waitFrame(int *end, int timeout=0)
Definition streamApi.cpp:252
stream_err
Definition streamApi.h:11
@ STREAM_SUCCESS
Definition streamApi.h:12
@ STREAM_ERROR
Definition streamApi.h:15
@ STREAM_TIMEOUT
Definition streamApi.h:13
@ STREAM_WRONG_HTYPE
Definition streamApi.h:14
Definition stream2.h:181
Definition stream2Api.h:8