dada_disk_sink_leap.hpp 939 Bytes
Newer Older
1
2
#ifndef PSRDADA_CPP_EFFELSBERG_EDD_DADA_DISK_SINK_LEAP_HPP
#define PSRDADA_CPP_EFFELSBERG_EDD_DADA_DISK_SINK_LEAP_HPP
Jason Wu's avatar
Jason Wu committed
3
4
5
#define HEADER_SIZE 4096
#define START_TIME 1024
#define HEAP_SIZE 32000
6
7
#include "psrdada_cpp/raw_bytes.hpp"
#include "psrdada_cpp/common.hpp"
8
#include "psrdada_cpp/dada_write_client.hpp"
9
#include <fstream>
10
#include <vector>
11
namespace psrdada_cpp {
12
13
namespace effelsberg {
namespace edd {
14
15
16
17
18
19
20
class DiskSinkLeap
{
public:
    DiskSinkLeap(std::string prefix, int nchan);
    ~DiskSinkLeap();
    void init(RawBytes& block);
    bool operator()(RawBytes& block);
21

22
private:
23
24
    std::string _prefix;
    std::size_t _counter;
25
26
    std::vector<std::ofstream> _output_streams;
    size_t _nchan;
Jason Wu's avatar
Jason Wu committed
27
28
    char _header[HEADER_SIZE];
    char _start_time[START_TIME];
29
30
31
    bool first_block;
    std::vector<char> _transpose;
};
32
} // edd
33
} // effelsberg
34
} //namespace psrdada_cpp
Jason Wu's avatar
Jason Wu committed
35
#endif //PSRDADA_CPP_EFFELSBERG_EDD_DADA_DISK_SINK_LEAP_HPP