Public Member Functions | Private Attributes

fio_AlterJourBlock Class Reference
[Classes for large file i/o, relative file, and DataBase]

#include <fio_AlterJourBlock.h>

List of all members.

Public Member Functions

 fio_AlterJourBlock ()
virtual ~fio_AlterJourBlock ()
int Insert (UInt16_t a_fileID, ivd_FilePosition_t a_filePosition, ivd_FileBufSize_t a_bufSize)
 return size of inserted data
int Insert (const UInt8_t *a_data, int a_size)
int Insert (fio_Alter_t &a_alter)
void WriteToLog (fio_JourHandle *m_jourHnd_p)
int Size ()
UInt8_tGetBlock ()
int GetDataSizeOn (UInt8_t *a_pos_p, int a_size)
int SizeAvail ()
bool IsAlterHdrOn (UInt8_t *a_pos_p)
void Clear ()

Private Attributes

int m_blockSize
UInt8_tm_block
UInt8_tm_fillPos
UInt8_tm_endPos
 one byte past last
 log_CLASSID_m

Detailed Description

Definition at line 40 of file fio_AlterJourBlock.h.


Constructor & Destructor Documentation

fio_AlterJourBlock::fio_AlterJourBlock (  ) 
fio_AlterJourBlock::~fio_AlterJourBlock (  )  [virtual]

Definition at line 64 of file fio_AlterJourBlock.cpp.

References m_block.

{
    delete [] m_block;
}


Member Function Documentation

void fio_AlterJourBlock::Clear ( void   )  [inline]

Definition at line 76 of file fio_AlterJourBlock.h.

                 {
        m_fillPos = m_block;
    };

UInt8_t* fio_AlterJourBlock::GetBlock (  )  [inline]

Definition at line 60 of file fio_AlterJourBlock.h.

Referenced by fio_AlterJour::UpdateDB().

{ return m_block; };

Here is the caller graph for this function:

int fio_AlterJourBlock::GetDataSizeOn ( UInt8_t a_pos_p,
int  a_size 
) [inline]

Definition at line 62 of file fio_AlterJourBlock.h.

Referenced by fio_AlterJour::UpdateDB().

                                                     {
        return (a_pos_p + a_size <= m_fillPos) 
                ? a_size
                : m_fillPos - a_pos_p;
    };

Here is the caller graph for this function:

int fio_AlterJourBlock::Insert ( const UInt8_t a_data,
int  a_size 
)

Definition at line 85 of file fio_AlterJourBlock.cpp.

References m_endPos, m_fillPos, and size.

                                                                {
    if ((m_fillPos + a_size) < m_endPos) {
        memcpy(m_fillPos, a_data, a_size);
        m_fillPos += a_size;
        return a_size;
    }
    else { // fill up to the end of buffer;
        int size = m_endPos - m_fillPos;
        memcpy(m_fillPos, a_data, size);
        m_fillPos += size;
        return size;
    }
}

int fio_AlterJourBlock::Insert ( UInt16_t  a_fileID,
ivd_FilePosition_t  a_filePosition,
ivd_FileBufSize_t  a_bufSize 
)

return size of inserted data

Definition at line 71 of file fio_AlterJourBlock.cpp.

References fio_Alter_t::Init(), m_endPos, and m_fillPos.

Referenced by fio_AlterJour::Insert().

                                          {
    if ((m_fillPos + sizeof(fio_Alter_t)) < m_endPos) {
        fio_Alter_t &alterHdr = *reinterpret_cast<fio_Alter_t*>(m_fillPos);
        alterHdr.Init(a_fileID, a_filePosition, a_bufSize);
        m_fillPos += sizeof(fio_Alter_t);
        return sizeof(fio_Alter_t);
    }
    return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int fio_AlterJourBlock::Insert ( fio_Alter_t a_alter  ) 

Definition at line 101 of file fio_AlterJourBlock.cpp.

References m_endPos, and m_fillPos.

                                                      {
    if ((m_fillPos + sizeof(fio_Alter_t)) < m_endPos) {
        fio_Alter_t &alterHdr = *reinterpret_cast<fio_Alter_t*>(m_fillPos);
        alterHdr = a_alter;
        m_fillPos += sizeof(fio_Alter_t);
        return sizeof(fio_Alter_t);
    }
    return 0;
}

bool fio_AlterJourBlock::IsAlterHdrOn ( UInt8_t a_pos_p  )  [inline]

Definition at line 72 of file fio_AlterJourBlock.h.

Referenced by fio_AlterJour::UpdateDB().

                                         {
        return ((a_pos_p + sizeof(fio_Alter_t)) <= m_fillPos);
    };

Here is the caller graph for this function:

int fio_AlterJourBlock::Size (  )  [inline]

Definition at line 56 of file fio_AlterJourBlock.h.

Referenced by WriteToLog().

               {
        return m_fillPos - m_block;
    };

Here is the caller graph for this function:

int fio_AlterJourBlock::SizeAvail (  )  [inline]

Definition at line 68 of file fio_AlterJourBlock.h.

Referenced by fio_AlterJour::Insert().

                    {
        return m_endPos - m_fillPos;
    };

Here is the caller graph for this function:

void fio_AlterJourBlock::WriteToLog ( fio_JourHandle m_jourHnd_p  ) 

Definition at line 113 of file fio_AlterJourBlock.cpp.

References fio_JourHandle::JourWrite(), m_block, and Size().

                                                               {
    m_jourHnd_p->JourWrite(m_block, Size());
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 88 of file fio_AlterJourBlock.h.

Definition at line 83 of file fio_AlterJourBlock.h.

Referenced by WriteToLog(), and ~fio_AlterJourBlock().

Definition at line 78 of file fio_AlterJourBlock.h.

one byte past last

Definition at line 86 of file fio_AlterJourBlock.h.

Referenced by Insert().

Definition at line 84 of file fio_AlterJourBlock.h.

Referenced by Insert().


The documentation for this class was generated from the following files: