Public Member Functions | Public Attributes | Protected Attributes

cmn_LockOwn Class Reference
[Common, basic classes, functions and types]

#include <stx_group.h>

Inheritance diagram for cmn_LockOwn:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 cmn_LockOwn ()
virtual ~cmn_LockOwn ()
void LockOwnInit (int a_groupID, int a_maxNumOfLocks, int a_maxWaitSeconds)
int GetGroupID ()
void IncNumOfLocks ()
bool IsItTimeToFlush ()
void SetNeedFlush ()
 following method are used by
void Clear ()

Public Attributes

 log_CLASSID_m

Protected Attributes

int m_groupID
bool m_needFlush
int m_numOfLocks
int m_maxNumOfLocks
ivd_Time32_t m_firstLockTime
int m_maxWaitSeconds

Detailed Description

Definition at line 67 of file stx_group.h.


Constructor & Destructor Documentation

cmn_LockOwn::cmn_LockOwn (  )  [inline]

Definition at line 69 of file stx_group.h.

        :
        m_groupID(-1),
        m_needFlush(false),
        m_numOfLocks(0),
        m_maxNumOfLocks(100),
        m_firstLockTime(0),
        m_maxWaitSeconds(5)
    {
        // Empty
    };

virtual cmn_LockOwn::~cmn_LockOwn (  )  [inline, virtual]

Definition at line 81 of file stx_group.h.

{};


Member Function Documentation

void cmn_LockOwn::Clear ( void   ) 

Definition at line 113 of file stx_group.cpp.

References dbg_DETAIL, log_DBG_m, log_FUNC_m, m_firstLockTime, m_groupID, m_needFlush, and m_numOfLocks.

Referenced by stx_GroupOfEl< _T, _defGroupEl >::Clear().

                        { 
    log_FUNC_m(Clear);
    log_DBG_m(dbg_DETAIL, "Last value before clear. groupID " << m_groupID 
                       << "  numOfLocks "    << m_numOfLocks
                       << "  firstLockTime "
                       << cmn_Time(m_firstLockTime).Time2hms()
                       << "  needFlush " << m_needFlush);
    m_firstLockTime = 0;
    m_numOfLocks    = 0;
    m_needFlush = false;
}

Here is the caller graph for this function:

int cmn_LockOwn::GetGroupID (  )  [inline]

Definition at line 98 of file stx_group.h.

Referenced by fio_TransGroupLock< _T, _defTransEl >::ReleaseGroup(), and fio_TransGroupLock< _T, _defTransEl >::UnLockAndFlush().

{ return m_groupID; };

Here is the caller graph for this function:

void cmn_LockOwn::IncNumOfLocks (  ) 

Definition at line 89 of file stx_group.cpp.

References log_FUNC_m, m_firstLockTime, m_numOfLocks, and NULL.

Referenced by stx_GroupOfEl< _T, _defGroupEl >::InsertEl().

Here is the caller graph for this function:

bool cmn_LockOwn::IsItTimeToFlush (  ) 

Definition at line 99 of file stx_group.cpp.

References dbg_DETAIL, log_DBG_m, log_FUNC_m, m_firstLockTime, m_groupID, m_maxNumOfLocks, m_maxWaitSeconds, m_needFlush, m_numOfLocks, NULL, and cmn_Time::Time2hms().

                                  {
    log_FUNC_m(IsItTimeToFlush);
    cmn_Time t(m_firstLockTime);
    log_DBG_m(dbg_DETAIL, "IsItTimeToFlush: groupID " << m_groupID 
                       << "  numOfLocks "    << m_numOfLocks
                       << "  firstLockTime " << t.Time2hms()
                       << "  needFlush "     << m_needFlush);
    return m_firstLockTime + m_maxWaitSeconds > time(NULL)
        || m_numOfLocks >= m_maxNumOfLocks
        || m_needFlush;
}

Here is the call graph for this function:

void cmn_LockOwn::LockOwnInit ( int  a_groupID,
int  a_maxNumOfLocks,
int  a_maxWaitSeconds 
)

Definition at line 75 of file stx_group.cpp.

References dbg_DETAIL, log_DBG_m, log_FUNC_m, m_groupID, m_maxNumOfLocks, and m_maxWaitSeconds.

Referenced by fio_TransGroupLock< _T, _defTransEl >::ReserveGroup().

                                                       {
    log_FUNC_m(LockOwnInit);
    m_groupID        = a_groupID;
    m_maxNumOfLocks  = a_maxNumOfLocks;
    m_maxWaitSeconds = a_maxWaitSeconds;
    log_DBG_m(dbg_DETAIL, "groupID " << m_groupID 
                       << "  maxNumOfLocks " << m_maxNumOfLocks
                       << "  maxWaitSeconds " << m_maxWaitSeconds);
}

Here is the caller graph for this function:

void cmn_LockOwn::SetNeedFlush (  )  [inline]

following method are used by

See also:
fio_TransGroupLock

Definition at line 105 of file stx_group.h.

Referenced by fio_TransGroupLock< _T, _defTransEl >::LockByIDOwn().

{ m_needFlush = true;};

Here is the caller graph for this function:


Member Data Documentation

Reimplemented in fio_Transaction.

Definition at line 96 of file stx_group.h.

Definition at line 92 of file stx_group.h.

Referenced by Clear(), IncNumOfLocks(), and IsItTimeToFlush().

int cmn_LockOwn::m_groupID [protected]

Definition at line 91 of file stx_group.h.

Referenced by IsItTimeToFlush(), and LockOwnInit().

Definition at line 93 of file stx_group.h.

Referenced by IsItTimeToFlush(), and LockOwnInit().

bool cmn_LockOwn::m_needFlush [protected]

Definition at line 89 of file stx_group.h.

Referenced by Clear(), and IsItTimeToFlush().

int cmn_LockOwn::m_numOfLocks [protected]

Definition at line 90 of file stx_group.h.

Referenced by Clear(), IncNumOfLocks(), and IsItTimeToFlush().


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