CTR-Pia  5.4.3
Game Communication Engine
 全て クラス ネームスペース 関数 変数 型定義 列挙型 列挙型の値 ページ
common_TreeMapNode.h
1 /*--------------------------------------------------------------------------------*
2  Copyright (C)Nintendo All rights reserved.
3 
4  These coded instructions, statements, and computer programs contain proprietary
5  information of Nintendo and/or its licensed developers and are protected by
6  national and international copyright laws. They may not be disclosed to third
7  parties or copied or duplicated in any form, in whole or in part, without the
8  prior written consent of Nintendo.
9 
10  The content herein is highly confidential and should be handled accordingly.
11  *--------------------------------------------------------------------------------*/
12 
13 
14 #pragma once
15 
16 #include <nn/pia/common/common_Definitions.h>
17 #include <nn/pia/common/common_TreeMapNodeBase.h>
18 
19 
20 namespace nn
21 {
22 namespace pia
23 {
24 namespace common
25 {
26 
27 //! @cond PRIVATE
28 template <typename Key>
29 class TreeMap;
30 //! @endcond
31 
32 /*!
33  @cond PRIVATE
34  @brief ツリーマップのノードとなるクラスです。
35  */
36 template <typename Key_>
37 class TreeMapNode : public common::TreeMapNodeBase
38 {
39  friend class TreeMap<Key_>;
40 
41 public:
42  typedef Key_ Key;
43 
44 
45  /*!
46  @brief デフォルトコンストラクタです。
47  */
48  TreeMapNode()
49  : TreeMapNodeBase(), m_Key()
50  {
51  }
52 
53 
54  /*!
55  @brief キーの値を取得します。
56  @return キーの値です。
57  */
58  const Key& GetKey() const
59  {
60  return m_Key;
61  }
62 
63 
64 private:
65  void InitNode()
66  {
67  TreeMapNodeBase::InitNodeBase();
68  m_Key = Key();
69  }
70 
71 public:
72  TreeMapNode* Prev() const
73  {
74  return static_cast<TreeMapNode*>(PrevBase());
75  }
76  TreeMapNode* Next() const
77  {
78  return static_cast<TreeMapNode*>(NextBase());
79  }
80 
81 private:
82  TreeMapNode* GetLeft() const
83  {
84  return static_cast<TreeMapNode*>(GetLeftBase());
85  }
86  TreeMapNode* GetRight() const
87  {
88  return static_cast<TreeMapNode*>(GetRightBase());
89  }
90 
91 private:
92  Key m_Key;
93 
94  TreeMapNode(const TreeMapNode&);
95  TreeMapNode& operator=(const TreeMapNode&);
96 };
97 //! @endcond
98 }
99 }
100 } // end of namespace nn::pia::common