CFEL - ASG Software Suite
2.5.0
CASS
|
contains input that uses ZMQ as interface More...
#include <iostream>
#include <zmq.hpp>
#include <msgpack.hpp>
#include "zmq_input.h"
#include "cass_settings.h"
#include "cass_exceptions.hpp"
#include "log.h"
#include "acqiris_device.hpp"
#include "pixeldetector.hpp"
#include "machine_device.hpp"
Go to the source code of this file.
Classes | |
struct | Info |
define a structure that holds information about how to parse and extract the info contained in a msgpack object. More... | |
Typedefs | |
typedef std::map< std::string, Info > | extractmap_t |
Functions | |
template<typename type > | |
void | readNDArrayDataAsString (std::vector< float > &out, const msgpack::object &obj) |
read the string like payload of an msgpack object into an vector of floats More... | |
template<typename type > | |
void | readNDArrayDataAsBinary (std::vector< float > &out, const msgpack::object &obj) |
read the binary payload of an msgpack object into an vector of floats More... | |
bool | iterate (const msgpack::object &obj, int depth, extractmap_t &emap, string acckey="") |
contains input that uses ZMQ as interface
Definition in file zmq_input.cpp.
typedef std::map<std::string,Info> extractmap_t |
Definition at line 97 of file zmq_input.cpp.
bool iterate | ( | const msgpack::object & | obj, |
int | depth, | ||
extractmap_t & | emap, | ||
string | acckey = "" |
||
) |
just go through the msgpack object and
separate the keys of the nested dictionaries by a '$' character
check if we're interested in the data
get a reference to the info that will now attempt to fill.
check if its ndarray data
if it is then extract the shape and the data according to the type of the data an how it is packed
check if its an array
check if its a single data value
if we are not interested in the data then just check to see if its another map that we should iterate into
Definition at line 132 of file zmq_input.cpp.
References cass::Log::add(), Info::data, info, Info::shape, and cass::Log::WARNING.
Referenced by cass::XtcIterator::process(), and cass::ZMQInput::runthis().
void readNDArrayDataAsBinary | ( | std::vector< float > & | out, |
const msgpack::object & | obj | ||
) |
read the binary payload of an msgpack object into an vector of floats
type | the type of data wrapped in the msgpack object as string |
out | reference to the vector where the data will be written to |
obj | the msgpack object who's payload will be written to the out vector |
Definition at line 125 of file zmq_input.cpp.
void readNDArrayDataAsString | ( | std::vector< float > & | out, |
const msgpack::object & | obj | ||
) |
read the string like payload of an msgpack object into an vector of floats
type | the type of data wrapped in the msgpack object as string |
out | reference to the vector where the data will be written to |
obj | the msgpack object who's payload will be written to the out vector |
Definition at line 109 of file zmq_input.cpp.