10 #include "storage/FileAllocator.h"
11 #include "storage/Interval.h"
73 virtual bool isValid()
const = 0;
140 stdString data_filename;
189 Datablock *
search(
const epicsTime &start)
const;
220 const stdString &data_filename);
228 const stdString &data_filename);
241 FileOffset data_offset, stdString data_filename);
244 void makeDot(
const char *filename);
253 bool selfTest(
unsigned long &nodes,
unsigned long &records);
256 PROHIBIT_DEFAULT_COPY(
RTree);
275 mutable size_t cache_misses, cache_hits;
277 void make_node_dot(FILE *dot, FILE *f,
FileOffset node_offset);
283 bool getFirstRecord(
class Node &node,
int &record_index)
const;
286 bool getLastRecord(
class Node &node,
int &record_index)
const;
292 void split_record(Node &node,
int idx,
const epicsTime &cut);
300 void adjust_tree(Node &node, Node *new_node);
307 FileOffset data_offset,
const stdString &data_filename);
311 FileOffset data_offset,
const stdString &data_filename);
316 void remove_record(Node &node,
int i);
322 void condense_tree(Node &node);
336 bool updateLast(
const epicsTime &start,
Interval getInterval()
Return range covered by this RTree on read error.
virtual bool getPrevDatablock()=0
Absolutely no clue what this one could do.
static const size_t anchor_size
Definition: RTree.h:144
const stdString & getDataFilename() const
The file name referenced by this entry.
Definition: RTree.h:76
RTree(FileAllocator &fa, FileOffset anchor)
Attach RTree to FileAllocator.
bool selfTest(unsigned long &nodes, unsigned long &records)
Returns true if tree passes self test, otherwise prints errors.
bool insertDatablock(const Interval &range, FileOffset data_offset, const stdString &data_filename)
Create and insert a new Datablock.
Each RTree leaf points to Datablocks; they describe where the actual data that the index references r...
Definition: RTree.h:62
bool updateLastDatablock(const Interval &range, FileOffset data_offset, stdString data_filename)
Tries to update existing datablock.
size_t removeDatablock(const Interval &range, FileOffset data_offset, const stdString &data_filename)
Remove reference to given data block.
A time interval.
Definition: Interval.h:10
uint32_t FileOffset
FileOffset is used as a system independent type for, well, offsets into files.
Definition: StorageTypes.h:13
int getM() const
The 'M' value, i.e.
Definition: RTree.h:167
Datablock * getFirstDatablock() const
void init(int M)
Initialize empty tree.
Implements a file-based RTree.
Definition: RTree.h:54
Datablock * getLastDatablock() const
FileOffset getDataOffset() const
The file offset of this entry.
Definition: RTree.h:83
Maintains memory blocks within a file.
Definition: FileAllocator.h:22
virtual const Interval & getInterval() const =0
Returns interval.
virtual bool getNextDatablock()=0
Get the data block for the next time interval from the RTree.
Datablock * search(const epicsTime &start) const
Locate data after start time.
virtual bool getNextChainedBlock()=0
Get a sub-block that's under the current block.
class Node chooseLeaf(const Interval &range)
void makeDot(const char *filename)
Create a graphviz 'dot' file.
virtual ~Datablock()
Destructor.
void reattach()
Re-attach to an existing tree.
virtual bool isValid() const =0