blob: ee91756f58a9bab57d902bf6541532ae90e6158f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
//
// Copyright (c) 1996 Microsoft Corporation
//
//
// ILIST.H -- Header for Classes:
// CInfList
//
//
// History:
// 05/22/96 JosephJ Created
//
//
class CInfList;
///////////////////////////////////////////////////////////////////////////
// CLASS CInfList
///////////////////////////////////////////////////////////////////////////
// Simple singly-linked list which can not be modified once it's been
// created. Assumes creation and eventual deletion are protected by some
// external critical section.
//
// Sample:
// for (; pList; pList = pList->Next())
// {
// const CInfAddregSection *pAS = (CInfAddregSection *) pList->GetData();
// }
class CInfList
{
public:
CInfList(void *pvData, const CInfList *pNext)
: m_pvData(pvData), m_pNext(pNext) {}
~CInfList() {}
//-------------- GetData ------------------
const void * GetData (void) const {return m_pvData;}
//-------------- Next ------------------
const CInfList * Next (void) const {return m_pNext;}
//-------------- FreeList ------------------
// Distroys the specified list.
static void FreeList(CInfList *);
//-------------- ReverseList ------------------
// Reverses the specified list.
static void ReverseList(const CInfList **);
private:
void mfn_SetNext(const CInfList * pNewNext)
{
m_pNext = pNewNext;
}
void * m_pvData;
const CInfList * m_pNext;
};
|