1 ///////////////////////////////////////////////////////////////////////////////
2 // $Source: x:/prj/tech/libsrc/cpptools/RCS/dlisttem.h $
4 // $Date: 1997/06/24 18:07:07 $
7 // (c) Copyright 1993-1996 Tom Leonard. All Rights Reserved. Unlimited license granted to Looking Glass Technologies Inc.
13 //include "storintr.h"
15 #ifdef DEBUG_DLIST_TEM
16 #pragma message "DEBUG_DLIST_TEM enabled"
17 #define DListTemDebugStr(s) DebugStr(s)
19 #define DListTemDebugStr(s)
22 ///////////////////////////////////////////////////////////////////////////////
24 template <class NODE
, int ID
>
25 void cDList
<NODE
, ID
>::DestroyAll()
28 delete Remove(GetFirst());
32 ///////////////////////////////////////
34 // Write a list to a stream
36 template <class NODE
, int ID
>
37 BOOL cSerialDList
<NODE
, ID
>::ToStream(cOStore
&OStore
) const
39 typedef cDListNode
<NODE
, ID
> cNode
;
43 if (!OStore
.WriteHeader("DLIST"))
52 if (!p
->ToStream(OStore
))
55 p
= p
->cNode::GetNext();
61 return OStore
.WriteTrailer();
65 ///////////////////////////////////////
67 // Fill a list from a stream
69 template <class NODE
, int ID
>
70 BOOL cSerialDList
<NODE
, ID
>::FromStream(cIStore
&IStore
)
72 if (!IStore
.ReadHeader("DLIST"))
81 DListTemDebugStr("cSerialDList<NODE, ID>::FromStream() -> FALSE: no/empty list");
89 p
->FromStream(IStore
);
95 DListTemDebugStr(cFmtStr("cSerialDList<NODE, ID>::FromStream() failed: %ld != -1L, i==%ld", j
, i
));
99 return IStore
.ReadTrailer();
103 ///////////////////////////////////////////////////////////////////////////////
105 #endif /* !__DLISTTEM_H */