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.


Detailed Description

Definition at line 53 of file stx_group.h.


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

Constructor & Destructor Documentation

cmn_LockOwn::cmn_LockOwn (  )  [inline]

Definition at line 55 of file stx_group.h.

00056         :
00057         m_groupID(-1),
00058         m_needFlush(false),
00059         m_numOfLocks(0),
00060         m_maxNumOfLocks(100),
00061         m_firstLockTime(0),
00062         m_maxWaitSeconds(5)
00063     {
00064         // Empty
00065     };

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

Definition at line 67 of file stx_group.h.

00067 {};


Member Function Documentation

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

Definition at line 61 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().

00063                                                        {
00064     log_FUNC_m(LockOwnInit);
00065     m_groupID        = a_groupID;
00066     m_maxNumOfLocks  = a_maxNumOfLocks;
00067     m_maxWaitSeconds = a_maxWaitSeconds;
00068     log_DBG_m(dbg_DETAIL, "groupID " << m_groupID 
00069                        << "  maxNumOfLocks " << m_maxNumOfLocks
00070                        << "  maxWaitSeconds " << m_maxWaitSeconds);
00071 }

Here is the caller graph for this function:

int cmn_LockOwn::GetGroupID (  )  [inline]

Definition at line 84 of file stx_group.h.

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

00084 { return m_groupID; };

Here is the caller graph for this function:

void cmn_LockOwn::IncNumOfLocks (  ) 

Definition at line 75 of file stx_group.cpp.

References log_FUNC_m, m_firstLockTime, m_numOfLocks, and NULL.

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

00075                                 {
00076     log_FUNC_m(IncNumOfLocks);
00077     if (m_firstLockTime == 0) {
00078         m_firstLockTime = time(NULL);
00079     }
00080     m_numOfLocks++;
00081 }

Here is the caller graph for this function:

bool cmn_LockOwn::IsItTimeToFlush (  ) 

Definition at line 85 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().

00085                                   {
00086     log_FUNC_m(IsItTimeToFlush);
00087     cmn_Time t(m_firstLockTime);
00088     log_DBG_m(dbg_DETAIL, "IsItTimeToFlush: groupID " << m_groupID 
00089                        << "  numOfLocks "    << m_numOfLocks
00090                        << "  firstLockTime " << t.Time2hms()
00091                        << "  needFlush "     << m_needFlush);
00092     return m_firstLockTime + m_maxWaitSeconds > time(NULL)
00093         || m_numOfLocks >= m_maxNumOfLocks
00094         || m_needFlush;
00095 }

Here is the call graph for this function:

void cmn_LockOwn::SetNeedFlush (  )  [inline]

following method are used by

See also:
fio_TransGroupLock

Definition at line 91 of file stx_group.h.

00091 { m_needFlush = true;};

void cmn_LockOwn::Clear ( void   ) 

Definition at line 99 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().

00099                         { 
00100     log_FUNC_m(Clear);
00101     log_DBG_m(dbg_DETAIL, "Last value before clear. groupID " << m_groupID 
00102                        << "  numOfLocks "    << m_numOfLocks
00103                        << "  firstLockTime "
00104                        << cmn_Time(m_firstLockTime).Time2hms()
00105                        << "  needFlush " << m_needFlush);
00106     m_firstLockTime = 0;
00107     m_numOfLocks    = 0;
00108     m_needFlush = false;
00109 }

Here is the caller graph for this function:


Member Data Documentation

int cmn_LockOwn::m_groupID [protected]

bool cmn_LockOwn::m_needFlush [protected]

Definition at line 75 of file stx_group.h.

Referenced by Clear(), and IsItTimeToFlush().

int cmn_LockOwn::m_numOfLocks [protected]

Definition at line 76 of file stx_group.h.

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

Definition at line 77 of file stx_group.h.

Referenced by IsItTimeToFlush(), and LockOwnInit().

Definition at line 78 of file stx_group.h.

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

Definition at line 79 of file stx_group.h.

Referenced by IsItTimeToFlush(), and LockOwnInit().

Reimplemented in fio_Transaction.

Definition at line 82 of file stx_group.h.


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

Generated on Mon Feb 27 19:05:15 2012 for OPENARCHIVE by  doxygen 1.5.6