6 #include <boost/algorithm/string.hpp>
7 #include <boost/regex.hpp>
8 #include <boost/lexical_cast.hpp>
26 LinkMap::const_iterator it =
links_.find(
i);
35 if (!
file_.is_open()) {
71 using namespace boost;
74 while (
file_.good()) {
94 std::vector<std::vector<uint64_t> > chans(
links.size(), std::vector<uint64_t>(
data.size()));
97 for (
size_t i(0);
i <
links.size(); ++
i) {
98 for (
size_t j(0);
j <
data.size(); ++
j) {
104 for (
size_t i(0);
i <
links.size(); ++
i) {
105 s.links_.insert(std::make_pair(
links[
i], chans[
i]));
160 std::vector<std::string> tokens;
165 boost::split(tokens,
tmp, boost::is_any_of(
" \t"), boost::token_compress_on);
167 std::vector<uint32_t>
links;
169 tokens.begin(), tokens.end(), std::back_inserter(
links), boost::lexical_cast<uint32_t,
const std::string&>);
172 throw std::logic_error(
"Unexpected line found!");
175 throw std::logic_error(
"No list of links found");
181 throw std::logic_error(
"Token '" +
token +
"' doesn't match the valid format");
185 value += std::stoul(what[2].
str(),
nullptr, 16);
193 std::vector<std::vector<uint64_t> >
data;
194 int place =
file_.tellg();
204 uint32_t
n = boost::lexical_cast<uint32_t>(what[1].
str());
206 if (
n !=
data.size()) {
207 std::stringstream
ss;
208 ss <<
"Frame misalignment! (expected " <<
data.size() <<
" found " <<
n;
209 throw std::logic_error(
ss.str());
211 std::vector<std::string> tokens;
214 boost::split(tokens,
tmp, boost::is_any_of(
" \t"), boost::token_compress_on);
216 std::vector<uint64_t> row;
222 place =
file_.tellg();