Public Member Functions | Public Attributes | Protected Attributes | Friends

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

#include <fio_Vector.h>

Inheritance diagram for fio_Vector:
Inheritance graph
[legend]
Collaboration diagram for fio_Vector:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 fio_Vector (const fio_Vector &v)
 fio_Vector (fio_RelFileTrans &a_relFileTrans, ivd_VectorSize_t a_vectorSize=0, ivd_RecordIDX_t a_vectorIndex=0, bool a_changed=true)
virtual ~fio_Vector ()
fio_RelFileTransGetRelFileTrans ()
void SetVector (const fio_VecQualifers &a_vq)
void operator= (const fio_Vector &v)
bool Write2DB (const void *a_buffer_p, ivd_VectorSize_t a_vectorSize, ivd_RecordIDX_t &a_vectorIndex, fio_Transaction &a_trans)
bool Write2DB (const void *a_buffer_p, fio_Transaction &a_trans)
 Just write sime sized new data on same place.
void ReadFromDB (void *a_buffer_p)
ivd_VectorSize_t GetVectorSize ()
ivd_RecordIDX_t GetVectorIndex ()
void Dump (ostream &os)

Public Attributes

 log_CLASSID_m

Protected Attributes

fio_RelFileTransm_relFileTrans
ivd_VectorSize_t m_vectorSize
ivd_RecordIDX_t m_vectorIndex
bool m_changed

Friends

class ut_fio_Vector

Detailed Description

Definition at line 75 of file fio_Vector.h.


Constructor & Destructor Documentation

fio_Vector::fio_Vector ( const fio_Vector v  )  [explicit]

Definition at line 59 of file fio_Vector.cpp.

References log_FUNC_A_m, m_changed, m_vectorIndex, and m_vectorSize.

Referenced by fio_Vector().

                                           :
        m_relFileTrans(v.m_relFileTrans),
        m_vectorSize(v.m_vectorSize),
        m_vectorIndex(v.m_vectorIndex),
        m_changed(true)
{
    log_FUNC_A_m(fio_Vector(fio_Vector), "m_vectorSize=" << m_vectorSize 
                               << ", m_vectorIndex=" << m_vectorIndex
                               << ", m_changed=" << boolalpha << m_changed);
    // Empty
}

Here is the caller graph for this function:

fio_Vector::fio_Vector ( fio_RelFileTrans a_relFileTrans,
ivd_VectorSize_t  a_vectorSize = 0,
ivd_RecordIDX_t  a_vectorIndex = 0,
bool  a_changed = true 
) [explicit]

Definition at line 72 of file fio_Vector.cpp.

References fio_Vector(), and log_FUNC_A_m.

            :
            m_relFileTrans(a_relFileTrans),
            m_vectorSize(a_vectorSize),
            m_vectorIndex(a_vectorIndex),
            m_changed(a_changed)
{
    log_FUNC_A_m(fio_Vector(,,,), "a_vectorSize=" << a_vectorSize 
                               << ", a_vectorIndex=" << a_vectorIndex
                               << ", a_changed=" << boolalpha << a_changed);
    // Empty
}

Here is the call graph for this function:

fio_Vector::~fio_Vector (  )  [virtual]

Definition at line 91 of file fio_Vector.cpp.

References log_FUNC_m.

{
    log_FUNC_m(~fio_Vector);
    // Empty
}


Member Function Documentation

void fio_Vector::Dump ( ostream &  os  ) 

Reimplemented in fio_BasicString, fsc_GenerationMgr, fsc_nsAttrStream, fsc_nsDirEntryFormattedVec, fsc_nsDirEntryVec, and fsc_nsElement.

Definition at line 157 of file fio_Vector.cpp.

References cmn_File::GetFullPathRef(), m_changed, m_relFileTrans, m_vectorIndex, and m_vectorSize.

                                 {
    os << " vector linked to rel file " << m_relFileTrans.GetFullPathRef() << endl
       << " vector changed " << boolalpha << m_changed << endl
       << " vector size " << m_vectorSize << endl
       << " vector idx  " << m_vectorIndex << endl;
}

Here is the call graph for this function:

fio_RelFileTrans& fio_Vector::GetRelFileTrans (  )  [inline]

Definition at line 90 of file fio_Vector.h.

{ return m_relFileTrans;};

ivd_RecordIDX_t fio_Vector::GetVectorIndex (  )  [inline]

Definition at line 138 of file fio_Vector.h.

Referenced by fsc_nsDirEntryMgr::AddEntry(), fsc_nsAttrMgr::ChgAttributes(), fsc_nsAttrStream::Dump(), fsc_GenerationMgr::Dump(), and fsc_nsStream::ReadFromDB().

{ return m_vectorIndex; };

Here is the caller graph for this function:

ivd_VectorSize_t fio_Vector::GetVectorSize (  )  [inline]

Definition at line 137 of file fio_Vector.h.

Referenced by fsc_nsDirEntryFormattedVec::Dump(), fsc_nsAttrStream::Dump(), and fsc_nsStream::ReadFromDB().

{ return m_vectorSize; };

Here is the caller graph for this function:

void fio_Vector::operator= ( const fio_Vector v  )  [inline]

Definition at line 108 of file fio_Vector.h.

References m_vectorIndex, and m_vectorSize.

void fio_Vector::ReadFromDB ( void *  a_buffer_p  )  [inline]

Definition at line 133 of file fio_Vector.h.

Referenced by fio_BasicString::fio_BasicString(), and fsc_nsDirEntryFormattedVec::fsc_nsDirEntryFormattedVec().

Here is the caller graph for this function:

void fio_Vector::SetVector ( const fio_VecQualifers a_vq  )  [inline]

Definition at line 103 of file fio_Vector.h.

References fio_VecQualifers::idx, and fio_VecQualifers::size.

Referenced by fsc_nsStream::ReadFromDB(), and fsc_nsStream::Write2DB().

                                                 {
        m_vectorSize  = a_vq.size;
        m_vectorIndex = a_vq.idx;
    };

Here is the caller graph for this function:

bool fio_Vector::Write2DB ( const void *  a_buffer_p,
fio_Transaction a_trans 
)

Just write sime sized new data on same place.

Definition at line 143 of file fio_Vector.cpp.

References assert, m_changed, m_relFileTrans, m_vectorIndex, m_vectorSize, NULL, and fio_RelFile::WriteRec().

                                                            {

    assert(a_buffer_p != NULL);

    m_relFileTrans.WriteRec(m_vectorIndex, a_buffer_p, m_vectorSize, &a_trans);

    bool chg  = m_changed;
    m_changed = false;

    return chg;
}

Here is the call graph for this function:

bool fio_Vector::Write2DB ( const void *  a_buffer_p,
ivd_VectorSize_t  a_vectorSize,
ivd_RecordIDX_t a_vectorIndex,
fio_Transaction a_trans 
)

Definition at line 99 of file fio_Vector.cpp.

References assert, fio_RelFileTrans::GetVectorIDX(), m_changed, m_relFileTrans, m_vectorIndex, m_vectorSize, NULL, fio_RelFileTrans::ReleaseVectorIdx(), and fio_RelFile::WriteRec().

Referenced by hsm_FileHeader::StoreDirTreeRec(), hsm_FileHeader::StoreNameOwnRec(), hsm_FileHeader::StoreOldNameOwnRec(), and fsc_GenerationMgr::Write2DB().

                                                            {

    ivd_RecordIDX_t idx = m_vectorIndex;  //  still valid vector index

    if (a_vectorSize == 0) { // nothing to write
        if (idx > 0) { // just release current used vectore
            m_relFileTrans.ReleaseVectorIdx(idx, m_vectorSize, &a_trans);
            idx = 0;
        }
        else {
            return false; // new has no size and old was not stored
        }
    }
    else { // vector has elements
        assert(a_buffer_p != NULL);
        if (idx == 0) {
            idx = m_relFileTrans.GetVectorIDX(a_vectorSize, &a_trans);
        }
        else if (a_vectorSize != m_vectorSize) {
            idx = m_relFileTrans.GetVectorIDX(a_vectorSize, &a_trans);
            m_relFileTrans.ReleaseVectorIdx(m_vectorIndex, m_vectorSize, &a_trans);
        }
        else if (!m_changed) {
            //  if nothing is changed just anounce caller with proper index and size
            a_vectorIndex = m_vectorIndex;
    //        a_vectorSize  = m_vectorSize;
            return false;
        }
        m_relFileTrans.WriteRec(idx, a_buffer_p, a_vectorSize, &a_trans);
    }

    a_vectorIndex = m_vectorIndex = idx;
    m_vectorSize  = a_vectorSize;

    m_changed = false;

    return true;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Friends And Related Function Documentation

friend class ut_fio_Vector [friend]

Definition at line 76 of file fio_Vector.h.


Member Data Documentation

bool fio_Vector::m_changed [protected]

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