EPICS ARCHIVER V4
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups
IndexFile.h
1 
3 #ifndef __INDEX_FILE_H__
4 #define __INDEX_FILE_H__
5 
6 // tools
7 #include "tools/AutoFilePtr.h"
8 
9 // storage
10 #include "storage/Index.h"
11 #include "storage/NameHash.h"
12 
15 
35 class IndexFile : public Index
36 {
37 public:
38 
40  static const uint32_t cookie = 0x43414932;
41 
43  IndexFile(int RTreeM = 50);
44 
46  ~IndexFile();
47 
49  static const uint32_t ht_size;
50 
51  // Index interface
52 
54  virtual void open(const stdString &filename, ReadWrite readwrite=ReadOnly);
55 
57  virtual void close();
58 
60  virtual Result *addChannel(const stdString &channel);
61 
63  virtual Result *findChannel(const stdString &channel);
64 
66  virtual NameIterator *iterator();
67 
69  void showStats(FILE *f);
70 
72  bool check(int level);
73 
74 private:
75 
76  const int RTreeM;
77  AutoFilePtr f;
78  FileAllocator fa;
79  NameHash names;
80 };
81 
83 
84 #endif
virtual NameIterator * iterator()
Returns iterator.
Name iterator.
Definition: Index.h:115
void showStats(FILE *f)
Prints statistics.
static const uint32_t cookie
== 'CAI2', Chan.
Definition: IndexFile.h:40
Return value of addChannel() and findChannel()
Definition: Index.h:65
ReadWrite
Modes used for open.
Definition: Index.h:27
bool check(int level)
Check level.
virtual void close()
Close the index file.
virtual Result * addChannel(const stdString &channel)
Add channel.
virtual Result * findChannel(const stdString &channel)
Find channel.
RTree-based index file.
Definition: IndexFile.h:35
virtual void open(const stdString &filename, ReadWrite readwrite=ReadOnly)
Open the index file.
A file-based Hash table for strings.
Definition: NameHash.h:37
IndexFile(int RTreeM=50)
Constructor.
~IndexFile()
Destructor.
Auto-close FILE pointer wrapper.
Definition: AutoFilePtr.h:15
Maintains memory blocks within a file.
Definition: FileAllocator.h:22
static const uint32_t ht_size
The hash table size used for new channel name tables.
Definition: IndexFile.h:49
Base interface for the archiver's indices.
Definition: Index.h:16