windows-nt/Source/XPSP1/NT/inetsrv/iis/staxinc/export/qbase.h

63 lines
1.2 KiB
C
Raw Permalink Normal View History

2020-09-26 03:20:57 -05:00
//
// QBASE.h
//
// This file defines CQElement - a base class for all types which
// are to be used in the lockq.h and other templated queue manipulation
// classes.
//
//
#ifndef _QBASE_H_
#define _QBASE_H_
#include "dbgtrace.h"
//-----------------------------------------------
// Base Element Class
//
// This is the base class for Queue and stack Elements.
// The various implementations of Stacks and Queues are friends.
//
class CQElement {
public :
CQElement *m_pNext ;
inline CQElement( ) ;
inline CQElement( CQElement* p ) ;
inline ~CQElement( ) ;
} ;
CQElement::CQElement( ) :
m_pNext( 0 ) {
//
// Construct a queue element - not in any list pointer must be NULL
//
}
CQElement::~CQElement( ) {
//
// Destroy a queue element - next pointer must be NULL or
// -1 (for lockq.h) so that we know the element is not
// on a queue at destruction time and the user has properly
// managed the linking and unlinking of the queue.
//
_ASSERT( m_pNext == 0 || m_pNext == (CQElement*)(DWORD_PTR)-1 ) ;
}
CQElement::CQElement( CQElement *pIn ) :
m_pNext( pIn ) {
//
// Constructor which sets the initial next pointer value !
//
}
#endif // _CQUEUE_H