.. _program_listing_file_processors_openephysZMQ_openephysZMQ.hpp: Program Listing for File openephysZMQ.hpp ========================================= |exhale_lsh| :ref:`Return to documentation for file ` (``processors/openephysZMQ/openephysZMQ.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp // --------------------------------------------------------------------- // This file is part of falcon-core. // // Copyright (C) 2021 - present Neuro-Electronics Research Flanders // // Falcon-server is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Falcon-server is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with falcon-core. If not, see . // --------------------------------------------------------------------- #pragma once #include "iprocessor.hpp" #include "channel_generated.h" #include "timeseriesdata/timeseriesdata.hpp" #include "utilities/zmqutil.hpp" #include "flatbuffers/flatbuffers.h" class OpenEphysZMQ : public IProcessor { // CONSTRUCTOR and OVERLOADED METHODS public: OpenEphysZMQ(); void Preprocess(ProcessingContext &context) override; void CreatePorts() override; void CompleteStreamInfo() override; void Process(ProcessingContext &context) override; void Postprocess(ProcessingContext &context) override; protected: // OPTIONS options::String address_{"127.0.0.1", options::notempty()}; options::Value port_{5556, options::positive(true)}; options::Value npackets_{0, options::zeroismax()}; options::Value sample_rate_{30000, options::positive(true)}; options::Value nchannels_{384, options::positive(true)}; // PORT protected: PortOut>* data_port_; // VARIABLES protected: zmq::socket_t socket_; uint64_t last_message_number_; uint64_t missing_packets_counter_; uint64_t valid_packets_counter_; uint64_t invalid_packets_counter_; TimePoint first_valid_packet_arrival_time_; flatbuffers::FlatBufferBuilder flatbuilder_; openephysflatbuffer::ContinuousDataBuilder builder_; };