0024512: clang++ compiler complains about extra semicolon
[occt.git] / src / NCollection / NCollection_TListNode.hxx
1 // Created on: 2002-04-23
2 // Created by: Alexander KARTOMIN (akm)
3 // Copyright (c) 2002-2014 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
7 // This library is free software; you can redistribute it and / or modify it
8 // under the terms of the GNU Lesser General Public version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16 #ifndef NCollection_TListNode_HeaderFile
17 #define NCollection_TListNode_HeaderFile
18
19 #include <NCollection_ListNode.hxx>
20 #include <NCollection_BaseAllocator.hxx>
21 #include <NCollection_DefineAlloc.hxx>
22
23 /**
24  * Purpose:     Abstract list node class. Used by BaseList
25  * Remark:      Internal class
26  */              
27 template <class TheItemType> class NCollection_TListNode 
28   : public NCollection_ListNode
29 {
30  public:
31   //! Constructor
32   NCollection_TListNode (const TheItemType& theItem,
33                          NCollection_ListNode* theNext=NULL) :
34     NCollection_ListNode  (theNext) { myValue = theItem; }
35   //! Constant value access
36   const TheItemType& Value () const { return myValue; }
37   //! Variable value access
38   TheItemType& ChangeValue () { return myValue; }
39   //! Memory allocation
40   DEFINE_STANDARD_ALLOC
41   DEFINE_NCOLLECTION_ALLOC
42   //! Static deleter to be passed to BaseList
43   static void delNode (NCollection_ListNode * theNode, 
44                        Handle(NCollection_BaseAllocator)& theAl)
45   {
46     ((NCollection_TListNode *) theNode)->myValue.~TheItemType();
47     theAl->Free(theNode);
48   }
49
50   
51  protected:
52   TheItemType    myValue; //!< The item stored in the node
53   
54 };
55
56 #endif