Public Member Functions | Public Attributes | Private Attributes

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

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

#include <stx_group.h>

Collaboration diagram for stx_XStack:
Collaboration graph
[legend]

List of all members.

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

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 47 of file stx_group.h.


Constructor & Destructor Documentation

stx_XStack::stx_XStack (  )  [inline]

Definition at line 49 of file stx_group.h.

    :
    m_someIDonStack(&m_stack_x) {
        //Empty
    };


Member Function Documentation

Int32_t stx_XStack::Pop (  ) 

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

                         {
    log_FUNC_m(Pop);
    cmn_MutexLock l(m_stack_x);
    while (size() == 0) {
        log_FUNC_m(Pop);
        log_DBG_m(dbg_DETAIL, "No more IDs on stack. WAIT.");
        m_someIDonStack.Wait();
    };
    UInt32_t idx = top();
    pop();
    return idx; 
}

Here is the call graph for this function:

Here is the caller graph for this function:

void stx_XStack::Push ( Int32_t  a_idx  ) 

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

                                   {
    log_FUNC_m(Push);
    cmn_MutexLock l(m_stack_x);
    push(a_idx);
    if (size() == 1) {  // 
        m_someIDonStack.Broadcast();
    };
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 59 of file stx_group.h.

Definition at line 53 of file stx_group.h.

Referenced by Pop(), and Push().

Definition at line 56 of file stx_group.h.

Referenced by Pop(), and Push().


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