8 #ifndef _FVBUFFERALLOCATOR_H_INCLUDED_ 9 #define _FVBUFFERALLOCATOR_H_INCLUDED_ 21 #pragma pack(push,_FVCL_PACKING) 58 if( adrs == NULL && count != 0 )
68 if( adrs == NULL && count != 0 )
87 virtual reference
SetItem( size_type uiIndex, const_reference _Val )
96 virtual reference
GetItem( size_type uiIndex )
const 110 virtual bool SetBuffer( pointer adrs, size_type count,
bool is_attach )
112 if( adrs == NULL && count != 0 )
return false;
121 virtual pointer
GetBuffer( size_type uiIndex = 0 )
const 123 if (this->
m_pTable == NULL)
return NULL;
163 fvalg::api::fnOAL_free( this->
m_pTable );
177 memset(&this->
m_pTable[i], 0,
sizeof(TYPE));
188 pNewTable = (TYPE*)fvalg::api::fnOAL_calloc( (this->
m_uiCapacity + uiIncrease),
sizeof(TYPE) );
189 if( pNewTable == NULL )
return false;
192 for( iCnt=0 ; iCnt<this->
m_uiCount ; iCnt++ )
193 pNewTable[iCnt] = this->
m_pTable[iCnt];
198 fvalg::api::fnOAL_free( this->
m_pTable );
205 virtual bool Erase( size_type uiS, size_type uiE )
207 if( this->
m_pTable == NULL )
return false;
210 if( uiE < uiS )
return false;
212 size_type iCnt, jCnt;
213 for( iCnt=uiS, jCnt=1 ; iCnt<this->
m_uiCount ; iCnt++, jCnt++ )
215 size_type uiP = uiE+jCnt;
216 if( uiP < this->m_uiCount )
219 this->m_uiCount -= (uiE-uiS+1);
224 virtual bool Insert( size_type uiPos, size_type uiSize, const_reference _Val )
226 if( this->
m_pTable == NULL )
return false;
227 if( this->
m_uiCount <= uiPos )
return false;
228 if( uiSize == 0 ) uiSize = 1;
229 if( this->m_uiCapacity < this->
m_uiCount+uiSize )
232 size_type uiLen = this->
m_uiCount - uiPos;
234 for( iCnt=1 ; iCnt<=uiLen ; iCnt++ )
236 for( iCnt=uiPos ; iCnt<uiPos+uiSize ; iCnt++ )
245 if( this->
m_pTable == NULL )
return false;
258 if( this->m_uiCapacity <= this->
m_uiCount )
267 virtual bool Resize( size_type uiSize, const_pointer pVal=NULL )
279 this->m_uiCount = uiSize;
281 else if( this->m_uiCount < uiSize )
287 for( size_type iCnt=this->m_uiCount ; iCnt<uiSize ; iCnt++ )
288 this->
m_pTable[iCnt] = static_cast<const_reference>(*pVal);
289 this->m_uiCount = uiSize;
297 if( !(0 <= uiPos && uiPos < this->
m_uiCount) )
301 INT iPos2 = iPos1 + order;
305 iPos2 = (
INT)this->m_uiCount - 1;
307 INT inc = (iPos1<iPos2) ? 1 : -1;
309 for(
INT i=iPos1 ; i!=iPos2 ; i+=inc )
317 virtual bool SwapItem( size_type uiPos1, size_type uiPos2 )
319 if( ! (uiPos1 < this->
m_uiCount) )
return false;
320 if( ! (uiPos2 < this->m_uiCount) )
return false;
339 #endif // _FVBUFFERALLOCATOR_H_INCLUDED_ virtual bool IsAttach() const
アタッチ属性の取得
Definition: FvBufferAllocator.h:136
virtual bool SetBuffer(pointer adrs, size_type count, bool is_attach)
配列の設定
Definition: FvBufferAllocator.h:110
size_type m_uiInitial
配列の初期容量
Definition: FvAllocator.h:112
TYPE * pointer
ポインタ型
Definition: FvAllocator.h:38
size_type m_uiIncrease
配列の増分
Definition: FvAllocator.h:113
virtual pointer GetBuffer(size_type uiIndex=0) const
配列の要素へのアドレス取得
Definition: FvBufferAllocator.h:121
配列確保テンプレートクラスの基本クラス
Definition: FvAllocator.h:34
virtual reference GetItem(size_type uiIndex) const
配列の要素の取得
Definition: FvBufferAllocator.h:96
FVCLのネームスペース
Definition: EVCbasicDeclare.txt:9
領域確保不可例外クラス
Definition: FveBadAllocException.h:18
virtual bool PopBack()
配列末端からの要素の取り出し
Definition: FvBufferAllocator.h:243
const INT FAILED_TO_ALLOCATE
メモリの確保に失敗しました。
Definition: FvErrors.h:15
const INT INVALID_PARAMETER
パラメータが無効です。
Definition: FvErrors.h:24
int INT
整数型(32ビット)
Definition: FvDefs.h:36
virtual bool PushBack(const_reference _Val)
配列への要素の追加
Definition: FvBufferAllocator.h:252
virtual bool SetBuffer(pointer adrs, size_type count)
配列の設定
Definition: FvBufferAllocator.h:104
virtual bool Erase(size_type uiS, size_type uiE)
配列要素の削除
Definition: FvBufferAllocator.h:205
パラメータ不正例外クラス
Definition: FveBadParamException.h:18
virtual bool Reserve(size_type uiIncrease)
配列容量の追加
Definition: FvBufferAllocator.h:181
UINT size_type
サイズ型
Definition: FvAllocator.h:42
size_type m_uiCapacity
配列の許容量
Definition: FvAllocator.h:111
virtual ~CFvBufferAllocator()
デストラクタ
Definition: FvBufferAllocator.h:76
virtual void Clear()
配列の開放
Definition: FvBufferAllocator.h:159
const TYPE * const_pointer
ポインタ型(const付き)
Definition: FvAllocator.h:39
size_type m_uiCount
配列内の要素数
Definition: FvAllocator.h:110
const TYPE & const_reference
参照型(const付き)
Definition: FvAllocator.h:41
CFvBufferAllocator(size_type uiInitial, size_type uiIncrease)
コンストラクタ
Definition: FvBufferAllocator.h:46
アクセス違反例外クラス
Definition: FveBadAccessException.h:18
TYPE & reference
参照型
Definition: FvAllocator.h:40
CFvBufferAllocator(size_type uiInitial, size_type uiIncrease, TYPE *adrs, size_type count)
コンストラクタ
Definition: FvBufferAllocator.h:56
virtual void Reset()
配列のリセット
Definition: FvBufferAllocator.h:172
CFvBufferAllocator(size_type uiInitial, size_type uiIncrease, TYPE *adrs, size_type count, bool is_attach)
コンストラクタ
Definition: FvBufferAllocator.h:66
virtual bool SwapItem(size_type uiPos1, size_type uiPos2)
配列要素の位置入れ替え
Definition: FvBufferAllocator.h:317
virtual bool Allocate()
配列の確保
Definition: FvBufferAllocator.h:142
unsigned int UINT
整数型(32ビット)[符号なし]
Definition: FvDefs.h:37
bool m_IsAttach
アタッチ属性
Definition: FvBufferAllocator.h:332
virtual bool Insert(size_type uiPos, size_type uiSize, const_reference _Val)
配列への要素の挿入
Definition: FvBufferAllocator.h:224
virtual void IsAttach(bool value)
アタッチ属性の設定
Definition: FvBufferAllocator.h:130
pointer m_pTable
配列
Definition: FvBufferAllocator.h:331
virtual bool Resize(size_type uiSize, const_pointer pVal=NULL)
配列の再確保
Definition: FvBufferAllocator.h:267
virtual bool ChangeOrder(size_type uiPos, INT order)
配列要素の順序入れ替え
Definition: FvBufferAllocator.h:295
virtual reference SetItem(size_type uiIndex, const_reference _Val)
配列への要素の設定
Definition: FvBufferAllocator.h:87
配列確保テンプレートクラス(ポインタ型)
Definition: FvBufferAllocator.h:34