CTR Pia  4.11.3
Game Communication Engine
common_FixedObjList.h
1 /*---------------------------------------------------------------------------*
2  Project: Pia
3  File: common_FixedObjList.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 #include <pia/common/common_ObjList.h>
19 
20 
21 namespace nn
22 {
23 namespace pia
24 {
25 namespace common
26 {
27 
28 
29 /*!
30 @cond PRIVATE
31 @brief Represents an <tt>ObjList</tt> object that includes an internal buffer.
32 
33 @param T Specifies the type of object being managed.
34 @param N Specifies the maximum number of elements that can be stored in the list.
35 */
36 template <typename T, u32 N>
37 class FixedObjList : public nn::pia::common::ObjList<T>
38 {
39 public:
40 /**
41 @brief Instantiates the object with default parameters (default constructor).
42 */
43  FixedObjList()
44  : ObjList<T>()
45  {
46  SetBuffer(N, mBuffer);
47  }
48 
49 private:
50  // Make <tt>SetBuffer</tt> unusable from the outside.
51  void SetBuffer(u32 limitNum, void* pBuffer)
52  {
53  ObjList<T>::SetBuffer(limitNum, pBuffer);
54  }
55 
56 private:
57  u8 mBuffer[ObjList<T>::c_NodeSize * N];
58 };
59 //! @endcond
60 }
61 }
62 } // end of namespace nn::pia::common
Definition: assert.h:115