EDDPolnMerge.hpp 1.29 KB
Newer Older
root's avatar
root committed
1
2
#ifndef PSRDADA_CPP_EFFELSBERG_EDD_EDDPOLNMERGE_HPP
#define PSRDADA_CPP_EFFELSBERG_EDD_EDDPOLNMERGE_HPP
3
#define HEAP_SIZE = 4096
root's avatar
root committed
4
5
6
7
8
9
10
11
12
13
14
15
#include "psrdada_cpp/dada_write_client.hpp"
#include "psrdada_cpp/raw_bytes.hpp"
#include "psrdada_cpp/common.hpp"
#include <vector>

namespace psrdada_cpp {
namespace effelsberg {
namespace edd {

class EDDPolnMerge
{
public:
16
    EDDPolnMerge(std::size_t npol, int nthreads, DadaWriteClient& writer);
root's avatar
root committed
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
    ~EDDPolnMerge();

    /**
     * @brief      A callback to be called on connection
     *             to a ring buffer.
     *
     * @detail     The first available header block in the
     *             in the ring buffer is provided as an argument.
     *             It is here that header parameters could be read
     *             if desired.
     *
     * @param      block  A RawBytes object wrapping a DADA header buffer
     */
    void init(RawBytes& block);

    /**
     * @brief      A callback to be called on acqusition of a new
     *             data block.
     *
     * @param      block  A RawBytes object wrapping a DADA data buffer
     */
    bool operator()(RawBytes& block);

private:
Jason Wu's avatar
Jason Wu committed
41
    std::size_t _npol;
42
    int _nthreads;
root's avatar
root committed
43
44
45
46
47
48
49
50
    DadaWriteClient& _writer;
};

} // edd
} // effelsberg
} // psrdada_cpp

#endif //PSRDADA_CPP_EFFELSBERG_EDD_EDDPOLNMERGE_HPP