6 #include <boost/algorithm/string.hpp>
7 #include <boost/regex.hpp>
25 LinkMap::const_iterator it =
links_.find(i);
34 if (!
file_.is_open()) {
70 using namespace boost;
73 while (
file_.good()) {
93 std::vector<std::vector<uint64_t> > chans(links.size(), std::vector<uint64_t>(data.size()));
96 for (
size_t i(0);
i < links.size(); ++
i) {
97 for (
size_t j(0);
j < data.size(); ++
j) {
98 chans[
i][
j] = data[
j][
i];
103 for (
size_t i(0);
i < links.size(); ++
i) {
104 s.
links_.insert(std::make_pair(links[
i], chans[i]));
120 while (getline(
file_, line)) {
128 if (boost::regex_match(line, what,
reBoard_)) {
146 while (getline(
file_, line)) {
158 if (boost::regex_match(line, what,
reLink_)) {
159 std::vector<std::string> tokens;
164 boost::split(tokens, tmp, boost::is_any_of(
" \t"), boost::token_compress_on);
166 std::vector<uint32_t>
links;
168 return std::stoul(
str);
171 throw std::logic_error(
"Unexpected line found!");
174 throw std::logic_error(
"No list of links found");
179 if (!boost::regex_match(token, what,
reValid_)) {
180 throw std::logic_error(
"Token '" + token +
"' doesn't match the valid format");
184 value += std::stoul(what[2].
str(),
nullptr, 16);
192 std::vector<std::vector<uint64_t> >
data;
193 int place =
file_.tellg();
194 while (getline(
file_, line)) {
195 if (boost::regex_match(line, what,
reBoard_)) {
201 if (boost::regex_match(line, what,
reFrame_)) {
203 uint32_t
n = std::stoul(what[1].
str());
205 if (n != data.size()) {
206 std::stringstream
ss;
207 ss <<
"Frame misalignment! (expected " << data.size() <<
" found " <<
n;
208 throw std::logic_error(ss.str());
210 std::vector<std::string> tokens;
213 boost::split(tokens, tmp, boost::is_any_of(
" \t"), boost::token_compress_on);
215 std::vector<uint64_t> row;
221 place =
file_.tellg();
static boost::regex reBoard_
uint16_t *__restrict__ id
static boost::regex reFrame_
static void trim(std::string &s)
const std::string & path() const
source file path
const FileData & get(size_t k) const
data getter via index
std::vector< std::vector< uint64_t > > readRows()
Log< level::Error, false > LogError
static const uint16_t valid_
static boost::regex reLink_
MP7FileReader(const std::string &path)
static uint64_t validStrToUint64(const std::string &token)
static boost::regex reQuadChan_
unsigned long long uint64_t
std::vector< FileData > buffers_
std::vector< std::string > names() const
raw data name collector
char data[epos_bytes_allocation]
static boost::regex reValid_
const std::vector< uint64_t > & link(uint32_t i) const
std::vector< uint32_t > searchLinks()
std::string searchBoard()