2 [momiji music component library]
3 ---------------------------------------------------------------------
6 ---------------------------------------------------------------------
7 Copyright (C) 2011 tyiki badwell {miria@users.sourceforge.jp}.
9 This program is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/gpl-3.0.html>.
21 ---------------------------------------------------------------------
26 //#include "Momiji.Core.Interface.h"
28 using namespace System::Runtime;
34 generic<typename DATA_TYPE>
35 public ref class BufferPool
38 delegate DATA_TYPE Allocator();
44 InteropServices::GCHandle _bufferHandle;
45 Allocator^ _allocator;
48 Buffer(Allocator^ allocator);
59 System::IntPtr GetBufferIntPtr();
60 DATA_TYPE% GetBuffer();
64 System::Collections::Generic::List<Buffer^>^ _buffers; //開放用の集合
65 System::Collections::Generic::Dictionary<System::IntPtr, Buffer^>^ _idleBuffers; //暇になっているバッファの集合
66 System::Collections::Generic::Dictionary<System::IntPtr, Buffer^>^ _busyBuffers; //再生中のバッファの集合
68 System::UInt32 _defaultPoolSize;
69 Allocator^ _allocator;
73 System::UInt32 defaultPoolSize,
83 Buffer^ GetBusy(System::IntPtr bufferPtr);
84 void Release(Buffer^ buffer);
85 System::Boolean IsBusy();