27 #include "../peyton/binarystream.hpp"
28 #include "../peyton/memorymap.hpp"
29 #include "../ensemble_alloc.hpp"
62 extern const char* UNSORTED_HEADER_FULL;
63 extern const char* UNSORTED_HEADER_CHECK;
64 extern const char* SORTED_HEADER_FULL;
65 extern const char* SORTED_HEADER_CHECK;
67 extern struct range_special { } ALL;
68 extern struct range_MAX
70 template<
typename T>
operator T()
const
72 return std::numeric_limits<T>::max();
75 extern struct range_MIN
77 template<
typename T>
operator T()
const
79 return std::numeric_limits<T>::is_integer ? std::numeric_limits<T>::min() : -
std::numeric_limits<T>::max();
89 range(
const T &a) : first(a), last(a) {}
90 range(
const T &a,
const T &b) : first(a), last(b) {}
91 range(
const range_special &r = ALL) : first(MIN), last(MAX) {}
93 bool in(
const T& v) {
return first <= v && v <= last; }
94 operator bool()
const {
return first <= last; }
104 struct index_creator_base
106 virtual bool start(
const std::string &datafile) = 0;
107 virtual bool add_entry(uint64_t offs, gpulog::logrecord lr) = 0;
108 virtual bool finish() = 0;
109 virtual ~index_creator_base() {};
135 index_handle idx_time, idx_sys;
136 std::string datafile;
138 void open(
const std::string &datafile);
140 bool open_index(index_handle &h,
const std::string &datafile,
const std::string &suffix,
const std::string &filetype);
157 gpulog::logrecord
next();
163 swarmdb(
const std::string &datafile);
168 return result(*
this, sys, T);
184 double Tabserr, Trelerr;
192 return snapshots(*
this, T, Tabserr, Trelerr);
195 void index_binary_log_file(std::vector<boost::shared_ptr<index_creator_base> > &ic,
const std::string &datafile);