WIL説明書(C++)  3.0.0
FvAllocator.h
[詳解]
1 // $Revision: 1.1 $
2 /*
3  @file FvAllocator.h
4  @brief CFvAllocator template class
5  @author FAST Corporation
6 */
7 
8 #ifndef _FVALLOCATOR_H_INCLUDED_
9 #define _FVALLOCATOR_H_INCLUDED_
10 
11 #include "FvMacros.h"
12 #include "FvDefs.h"
13 #include "FvDebug.h"
14 #include "FvAlloc.h"
15 #include "FvErrors.h"
16 #include "FvObject.h"
17 #include "FvException.h"
18 
19 #pragma pack(push,_FVCL_PACKING)
20 
21 namespace FVCL
22 {
23 
24 // /////////////////////////////////////////////////////////////////
25 // DEFINE
26 //
27 
28 // /////////////////////////////////////////////////////////////////
29 // TYPEDEF
30 //
31 
32 // /////////////////////////////////////////////////////////////////
33 // CLASS
34 template<class TYPE> class CFvAllocator : public CFvObject
35 {
36 public:
37  // DEFINE/TYPEDEF
38  typedef TYPE* pointer;
39  typedef const TYPE* const_pointer;
40  typedef TYPE& reference;
41  typedef const TYPE& const_reference;
42  typedef UINT size_type;
43 
44 public:
45  // ===================================================================
46  CFvAllocator( size_type uiInitial, size_type uiIncrease )
47  {
48  this->m_uiCount = 0;
49  this->m_uiCapacity = 0;
50  this->m_uiInitial = uiInitial;
51  this->m_uiIncrease = uiIncrease;
52  }
53 
54  // ===================================================================
55  virtual ~CFvAllocator()
56  {
57  }
58 
59 public:
60  //
61  // METHOD
62  //
63 
64  virtual reference SetItem( size_type uiIndex, const_reference _Val ) = 0;
65  virtual reference GetItem( size_type uiIndex ) const = 0;
66  virtual pointer GetBuffer( size_type uiIndex = 0 ) const = 0;
67 
68  // ===================================================================
69  virtual size_type GetCount() const
70  {
71  return this->m_uiCount;
72  }
73 
74  // ===================================================================
75  virtual size_type GetBack() const
76  {
77  return ((this->m_uiCount==0) ? 0 : this->m_uiCount-1);
78  }
79 
80  // ===================================================================
81  virtual size_type GetCapacity() const
82  {
83  return this->m_uiCapacity;
84  }
85 
86  // ===================================================================
87  virtual size_type SetIncrease( size_type uiIncrease )
88  {
89  return this->m_uiIncrease = uiIncrease;
90  }
91  // ===================================================================
92  virtual size_type GetIncrease() const
93  {
94  return this->m_uiIncrease;
95  }
96 
97  virtual bool Allocate() = 0;
98  virtual void Clear() = 0;
99  virtual bool Reserve( size_type uiIncrease ) = 0;
100  virtual bool Erase( size_type uiS, size_type uiE ) = 0;
101  virtual bool Insert( size_type uiPos, size_type uiSize, const_reference _Val ) = 0;
102  virtual bool PopBack() = 0;
103  virtual bool PushBack( const_reference _Val ) = 0;
104  virtual bool Resize( size_type uiSize, const_pointer pVal=NULL ) = 0;
105  virtual bool ChangeOrder( size_type uiPos, INT order ) = 0;
106  virtual bool SwapItem( size_type uiPos1, size_type uiPos2 ) = 0;
107 
108 protected:
109  // OBJECT
110  size_type m_uiCount;
111  size_type m_uiCapacity;
112  size_type m_uiInitial;
113  size_type m_uiIncrease;
114 };
115 
116 } // FVCL
117 
118 #pragma pack(pop)
119 
120 #endif // _FVALLOCATOR_H_INCLUDED_
virtual bool SwapItem(size_type uiPos1, size_type uiPos2)=0
配列要素の位置入れ替え
virtual bool ChangeOrder(size_type uiPos, INT order)=0
配列要素の順序入れ替え
virtual size_type GetBack() const
配列終端の指標の取得
Definition: FvAllocator.h:75
size_type m_uiInitial
配列の初期容量
Definition: FvAllocator.h:112
TYPE * pointer
ポインタ型
Definition: FvAllocator.h:38
size_type m_uiIncrease
配列の増分
Definition: FvAllocator.h:113
配列確保テンプレートクラスの基本クラス
Definition: FvAllocator.h:34
FVCLのネームスペース
Definition: EVCbasicDeclare.txt:9
virtual size_type GetIncrease() const
配列の増分の取得
Definition: FvAllocator.h:92
FVCLの基底クラス
Definition: FvObject.h:23
virtual reference GetItem(size_type uiIndex) const =0
配列の要素の取得
virtual void Clear()=0
配列の開放
int INT
整数型(32ビット)
Definition: FvDefs.h:36
virtual bool PushBack(const_reference _Val)=0
配列への要素の追加
virtual bool Erase(size_type uiS, size_type uiE)=0
配列要素の削除
マクロ定義
virtual size_type SetIncrease(size_type uiIncrease)
配列の増分の設定
Definition: FvAllocator.h:87
UINT size_type
サイズ型
Definition: FvAllocator.h:42
size_type m_uiCapacity
配列の許容量
Definition: FvAllocator.h:111
virtual bool Reserve(size_type uiIncrease)=0
配列容量の追加
const TYPE * const_pointer
ポインタ型(const付き)
Definition: FvAllocator.h:39
virtual bool Allocate()=0
配列の確保
virtual bool Insert(size_type uiPos, size_type uiSize, const_reference _Val)=0
配列への要素の挿入
size_type m_uiCount
配列内の要素数
Definition: FvAllocator.h:110
virtual reference SetItem(size_type uiIndex, const_reference _Val)=0
配列への要素の設定
const TYPE & const_reference
参照型(const付き)
Definition: FvAllocator.h:41
virtual bool Resize(size_type uiSize, const_pointer pVal=NULL)=0
配列の再確保
TYPE & reference
参照型
Definition: FvAllocator.h:40
エラーコード定義
virtual pointer GetBuffer(size_type uiIndex=0) const =0
配列の要素へのアドレス取得
virtual size_type GetCapacity() const
配列の許容量の取得
Definition: FvAllocator.h:81
virtual bool PopBack()=0
配列末端からの要素の取り出し
virtual size_type GetCount() const
配列の要素数の取得
Definition: FvAllocator.h:69
unsigned int UINT
整数型(32ビット)[符号なし]
Definition: FvDefs.h:37
メモリ確保と開放のグローバル関数のインターフェース
CFvObject クラスのインターフェース
CFvAllocator(size_type uiInitial, size_type uiIncrease)
コンストラクタ
Definition: FvAllocator.h:46
変数型と定数の定義
デバッグ用関数のインターフェース
virtual ~CFvAllocator()
デストラクタ
Definition: FvAllocator.h:55
例外発行関数のインターフェース

Documentation copyright © 2007 FAST Corporation. [B-001864]
Generated on 2023年11月02日(木) 10時12分53秒 for WIL説明書(C++) by doxygen 1.8.11