#ifndef __STORAGE_PROVIDER_HEADERS__ #define __STORAGE_PROVIDER_HEADERS__ #include "../../components/base/basicMutex.h" #include "../../components/base/basicFunctionality.h" #include "../../components/base/basicLogCollection.h" #include "../../alg/generic/md5.h" #ifdef __linux__ #include #include #define STORAGE_DIR_MODE 0x1FF #define STORAGE_FILE_MODE 0x1B6 #else #include #endif class storageProvider{ private: basicLogCollection *m_pLog; CSTR m_pCWD; CSTR m_pSeriesBase; CSTR m_pEntryFolder; U32 m_nSeriesCounter; CSTR m_pBasePath; basicMutex m_mCounterProtectorMutex; public: // Method to fetch singleton instance. static storageProvider* getInstance(CSTR Base = "data/storage"); ~storageProvider(); bool startNewSeries(void); bool startNewEntry(void); CSTR getCurrentFilePath(void); CSTR getNewFileName(CSTR JustFileName = NULL); CSTR getStorageBase(void) { return m_pBasePath; }; protected: // Constructor - protected so users cannot call it. explicit storageProvider(CSTR BasePath); private: // private static member referencing the single instance of the object // TODO: Replace basicEventHeap with the type of object you want to // return the single instance of static storageProvider* _instance; }; #endif