28 cIndexedFileAsyncWriter();
76 tBool m_bCatchFirstTime;
79 tInt m_nCacheMinStoreAtOnce;
80 volatile tInt m_nCacheFlushPtr;
81 volatile tInt m_nCacheInsertPtr;
82 std::atomic<tSize> m_nCacheUsageCount;
84 cIndexedFileAsyncWriter m_oWriterThread;
85 std::mutex m_mutexFreedEvent;
86 std::mutex m_mutexCacheUsed;
87 std::condition_variable m_CondFreedEvent;
88 std::condition_variable m_CondCacheUsed;
89 std::atomic<tBool> m_bCondCacheUsedProcessed;
97 volatile tInt32 m_nLastWriteResult;
99 typedef struct tagStreamInfoAdd
119 tBool m_bUsePrefixTempFileExtension;
185 "adtf_file library instead.")
255 tBool& bIndexEntryAppended);
268 const
tVoid* pInfoData,
280 const
tChar* strStreamName);
374 tBool bUseSegmentSize);
376 friend class cIndexedFileAsyncWriter;
unsigned long tUInt32
type definition for unsigned integer values (32bit) (platform and compiler independent type).
unsigned char tUInt8
type definition for unsigned integer values (8bit) (platform and compiler independent type).
unsigned int tUInt16
type definition for unsigned integer values (16bit) (platform and compiler independent type).
signed long tInt32
type definition for signed integer values (32bit) (platform and compiler independent type).
char tChar
The tChar defines the type for platform character set (platform and compiler dependent type).
tInt64 tFileSize
type definition for a file or stream size value (platform and compiler independent type).
tInt64 tTimeStamp
type definition for a time value.
tInt64 tFilePos
type definition for a file or stream position value (platform and compiler independent type).
int64_t tInt64
type definition for signed integer values (64bit) (platform and compiler independent type).
void tVoid
The tVoid is always the definition for the void (non-type).
int tInt
type definition for signed integer value (platform and compiler dependent type).
bool tBool
The tBool defines the type for the Values tTrue and tFalse (platform and compiler dependent).
uint64_t tUInt64
type definition for unsigned integer values (64bit) (platform and compiler independent type).
A_UTILS_NS::cResult tResult
For backwards compatibility and to bring latest version into scope.
Class for storing an index table of an indexed file.
cIndexedFileWriter * m_pInstance
The file writer instance.
tResult Create(cIndexedFileWriter *pInstance)
Initializes the asynchronous writer.
cIndexedFile()
Default constructor.
Callback interface that informs about dropped chunks in history mode.
virtual tResult OnChunkDropped(tUInt64 nIndex, tUInt16 nStreamId, tUInt16 nFlags, tTimeStamp tmTime)=0
Called whenever a chunk is dropped from the history.
Class for writing indexed files.
tResult WriteFileHeaderExt()
write the extension file header
tResult StoreToDisk(bool bFlush)
stores the data to disk
tResult QuitHistory()
In case there is a history set up, this switches over to permanent storage.
cFilename GetTempSaveFileName()
Get the Temp Save File Name (Filename during the Save Mode)
tResult Create(const tChar *strFilename, tInt nCacheSize=-1, tUInt32 ui32Flags=0, tUInt64 ui64FileTimeOffset=0, tTimeStamp tmHistory=0, tFileSize nHistorySize=0, IChunkDroppedCallback *pDropCallback=nullptr)
Create a new indexed file.
tResult WriteChunk(tUInt16 ui16StreamId, const tVoid *pData, tUInt32 nDataSize, tTimeStamp nTimeStamp, tUInt32 nFlags)
Writes a new chunk to the file.
cString GetPrefix()
Returns the prefix.
tVoid SetPrefixTempFileExtension(tBool useMode)
Set the mode, if a prefix is set by a temp Save File Name or not.
tResult RenameTempSaveToFileName()
Rename the TempFile Name '~$FileName.dat' back to 'FileName.dat' Filename.
tResult WriteFileHeader()
Write the file header.
tBool GetPrefixTempFileExtensionMode()
Get the mode, if a prefix is set by a temp Save File Name or not.
tInt64 InternalWrite(const tVoid *pvBuffer, tInt nBufferSize, tBool bUseSegmentSize)
internal writing function
tResult SetStreamName(tUInt16 ui16StreamId, const tChar *strStreamName)
Set the name of a stream.
tInt GetCacheUsage()
Get the amount of cache space used.
tResult AllocCache(tInt nSize)
allocates a given amount of memory for chaching
tResult SetAdditionalStreamInfo(tUInt16 ui16StreamId, const tVoid *pInfoData, tUInt32 ui32InfoDataSize, tBool bUseAsReference=tFalse)
Sets additional info for a stream.
A_UTILS_DEPRECATED_MESSAGE("The class 'cIndexedFileWriter' is deprecated. Please use the aquivalent from the " "adtf_file library instead.") cIndexedFileWriter()
Default constructor.
tResult Initialize()
Initializes the writer.
tResult CreateAFileWithPrefixdAndAFileWithoutPrefix(cFilename strFilename, cFilename &strSaveFilename)
Return the Name of the file during creation mode.
cString GetNewFileNameWithPrefix(cString strFilename)
Set a Prefix to the incoming Filename and return the new name.
tResult WriteIndexTable()
write index table
tResult WriteToCache(const tVoid *pData, tInt nDataSize, const tBool bIsChunkHeader=tFalse)
write the given data to local cache
tResult Close()
Finishes writing to and closes the file.
#define tFalse
Value for tBool.
#define A_UTILS_D(__pclassname_)
Helper macro for d-pattern definitions.
#define MAX_INDEXED_STREAMS
Maximum of indexed streams.
ADTF A_UTIL Namespace - Within adtf this is used as util or adtf_util.
string_base< cStackString > cString
cString implementation for a stack string which works on stack if string is lower than A_UTILS_DEFAUL...