16 #ifndef DABC_HierarchyStore
17 #define DABC_HierarchyStore
19 #ifndef DABC_Hierarchy
23 #ifndef DABC_BinaryFile
86 bool ScanFiles(
const std::string &dirname,
const DateTime& onlydate, std::vector<uint64_t>& vect);
Generic file storage for DABC buffers.
Reference on memory from memory pool.
Class for holding GMT time with precision of nanoseconds.
Defines and implements basic POSIX file interface.
std::string MakeFileName(const std::string &fpath, const DateTime &dt)
FileInterface * fIO
! base directory
bool ScanTreeDir(dabc::Hierarchy &h, const std::string &dirname)
! scanned files tree
void SetBasePath(const std::string &path)
Set top directory for all recorded data.
dabc::Hierarchy fTree
! file interface
Hierarchy GetSerie(const std::string &entry, const DateTime &from, const DateTime &till)
Get entry with history for specified time interval.
bool ScanFiles(const std::string &dirname, const DateTime &onlydate, std::vector< uint64_t > &vect)
virtual ~HierarchyReading()
bool GetStrucutre(Hierarchy &h, const DateTime &dt=0)
Get full structure at given point of time.
bool ProduceStructure(Hierarchy &tree, const DateTime &from, const DateTime &till, const std::string &entry, Hierarchy &tgt)
bool ScanTree()
Scan only directories, do not open any files.
dabc::Buffer ReadBuffer(dabc::BinaryFile &f)
bool fDoStore
! time when last store flush was done
uint64_t fLastVersion
! indicate if store flush should be done
FileInterface * fIO
! base directory for data store
virtual ~HierarchyStore()
bool WriteDiff(dabc::Buffer buf)
bool fDoFlush
! indicate if store diff should be done
bool CheckForNextStore(DateTime &now, double store_period, double flush_period)
Returns true if any new store action should be performed.
bool WriteExtractedData()
Write extracted data to files, performed outside hierarchy mutex.
dabc::DateTime fLastFlushTm
! time when last store was done
bool SetBasePath(const std::string &path)
Set base path for data storage, can only be changed when all files are closed.
bool StartFile(dabc::Buffer buf)
dabc::BinaryFile fFile
! file interface
bool ExtractData(dabc::Hierarchy &h)
Extract data which is can be stored, must be called under hierarchy mutex.
dabc::DateTime fLastStoreTm
! file used to write data
Buffer fStoreBuf
! last stored version
Represents objects hierarchy of remote (or local) DABC process.