forked from hep-cce2/root_serialization
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPDSSource.h
More file actions
48 lines (40 loc) · 1.3 KB
/
PDSSource.h
File metadata and controls
48 lines (40 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#if !defined(PDSSource_h)
#define PDSSource_h
#include <string>
#include <memory>
#include <chrono>
#include <iostream>
#include <fstream>
#include "SourceBase.h"
#include "DataProductRetriever.h"
#include "DelayedProductRetriever.h"
#include "DeserializeStrategy.h"
#include "pds_reading.h"
namespace cce::tf {
class PDSDelayedRetriever : public DelayedProductRetriever {
void getAsync(DataProductRetriever&, int index, TaskHolder) override {}
};
class PDSSource : public SourceBase {
public:
PDSSource(std::string const& iName);
PDSSource(PDSSource&&) = default;
PDSSource(PDSSource const&) = default;
~PDSSource();
size_t numberOfDataProducts() const final {return dataProducts_.size();}
std::vector<DataProductRetriever>& dataProducts() final { return dataProducts_; }
EventIdentifier eventIdentifier() final { return eventID_;}
using buffer_iterator = std::vector<std::uint32_t>::const_iterator;
private:
bool readEvent(long iEventIndex) final; //returns true if an event was read
bool readEventContent();
pds::Compression compression_;
std::ifstream file_;
long presentEventIndex_ = 0;
EventIdentifier eventID_;
std::vector<DataProductRetriever> dataProducts_;
DeserializeStrategy deserializers_;
std::vector<void*> dataBuffers_;
PDSDelayedRetriever delayedRetriever_;
};
}
#endif