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

#include <stx_group.h>

Collaboration diagram for stx_XStack:

Collaboration graph
[legend]

List of all members.


Detailed Description

stored in stack when some one need an ID ask IDmgr.

When ID is no more used it's returned to IDmgr. When no more IDs in stack then wait for some to be relesed.

Definition at line 33 of file stx_group.h.


Public Member Functions

 stx_XStack ()
void Push (Int32_t a_idx)
Int32_t Pop ()

Public Attributes

 log_CLASSID_m

Private Attributes

cmn_Condition m_someIDonStack
cmn_Mutex m_stack_x

Constructor & Destructor Documentation

stx_XStack::stx_XStack (  )  [inline]

Definition at line 35 of file stx_group.h.

00036     :
00037     m_someIDonStack(&m_stack_x) {
00038         //Empty
00039     };
private:


Member Function Documentation

void stx_XStack::Push ( Int32_t  a_idx  ) 

Definition at line 35 of file stx_group.cpp.

References cmn_Condition::Broadcast(), log_FUNC_m, m_someIDonStack, m_stack_x, and size.

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

00035                                    {
00036     log_FUNC_m(Push);
00037     cmn_MutexLock l(m_stack_x);
00038     push(a_idx);
00039     if (size() == 1) {  // 
00040         m_someIDonStack.Broadcast();
00041     };
00042 }

Here is the call graph for this function:

Here is the caller graph for this function:

Int32_t stx_XStack::Pop (  ) 

Definition at line 46 of file stx_group.cpp.

References dbg_DETAIL, log_DBG_m, log_FUNC_m, m_someIDonStack, m_stack_x, size, and cmn_Condition::Wait().

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

00046                          {
00047     log_FUNC_m(Pop);
00048     cmn_MutexLock l(m_stack_x);
00049     while (size() == 0) {
00050         log_FUNC_m(Pop);
00051         log_DBG_m(dbg_DETAIL, "No more IDs on stack. WAIT.");
00052         m_someIDonStack.Wait();
00053     };
00054     UInt32_t idx = top();
00055     pop();
00056     return idx; 
00057 }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 39 of file stx_group.h.

Referenced by Pop(), and Push().

Definition at line 42 of file stx_group.h.

Referenced by Pop(), and Push().

Definition at line 45 of file stx_group.h.


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

Generated on Mon Feb 27 19:50:52 2012 for OPENARCHIVE by  doxygen 1.5.6