#ifndef lxZLmAQ0qUwCFC9Ehehzy92Ldko #define lxZLmAQ0qUwCFC9Ehehzy92Ldko /* warn: heap is sloppy with the write barrier of it's content mmap()ed data store; the stated barrier is always equal or less than the actually used amount of space; it is only correct after sync() calls (which happen implicitely at interval turnover */ #include #include #include "checkpoint.hpp" #include "everything_else.hpp" #include "scalar.hpp" #include "string_helpers.hpp" #include "time.hpp" #include "vector.hpp" template struct Heap { // constructor requires a 3-tuple: // 1. name (used for file name creation) // 2. average size of contained object // 3. default payload value (if a new heap is created) Heap(const string name, const uint64_t avgLength); Heap(); // read & write access inline Payload & operator() (Time t) __attribute__ ((pure)); void sync(); // intern methods void addCheckpoints(Time t); // intern data typedef Vector::ptr_t ptr_t; ptr_t interval; // current interval (number) Time timeLimit; // current intervals time limit (inclusive) Time currentTime; // current intervals time (same as times(interval) // but allows compiler to perform better // optimizations) // file backings Vector