CTR Pia  4.11.3
Game Communication Engine
common_ListNode.h
1 /*---------------------------------------------------------------------------*
2  Project: Pia
3  File: common_ListNode.h
4 
5  Copyright Nintendo. All rights reserved.
6 
7  These coded instructions, statements, and computer programs contain
8  proprietary information of Nintendo of America Inc. and/or Nintendo
9  Company Ltd., and are protected by Federal copyright law. They may
10  not be disclosed to third parties or copied or duplicated in any form,
11  in whole or in part, without the prior written consent of Nintendo.
12  *---------------------------------------------------------------------------*/
13 
14 
15 #pragma once
16 
17 #include <pia/common/common_definitions.h>
18 
19 
20 namespace nn
21 {
22 namespace pia
23 {
24 namespace common
25 {
26 
27 class ListBase;
28 
29 /*!
30 @cond PRIVATE
31 @brief Represents the class for list nodes.
32 */
33 class ListNode : public nn::pia::common::RootObject
34 {
35  friend class ListBase;
36 
37 public:
38 /*!
39 @brief Instantiates the object with default parameters (default constructor).
40 */
41  ListNode()
42  {
43  InitListNode();
44  }
45 
46 
47 /*!
48 Private:
49 @brief Gets the next element.
50 @return Returns the next element.
51 */
52  ListNode* Prev() const
53  {
54  return m_pPrev;
55  }
56 
57 
58 /*!
59 Private:
60 @brief Gets the previous element.
61 @return Returns the previous element.
62 */
63  ListNode* Next() const
64  {
65  return m_pNext;
66  }
67 
68 
69  bool IsFreeListNode() const
70  {
71  return (m_pPrev == NULL) || (m_pNext == NULL);
72  }
73 
74 private:
75  void InitListNode()
76  {
77  m_pPrev = NULL;
78  m_pNext = NULL;
79  }
80 
81  ListNode* m_pPrev;
82  ListNode* m_pNext;
83 };
84 //! @endcond
85 }
86 }
87 } // end of namespace nn::pia::common
Definition: assert.h:115
This is the common base class used inside the Pia library.
Definition: common_RootObject.h:40