/*---------------------------------------------------------------------------* Project: NintendoWare File: snd_PlayerHeap.h Copyright (C)2009-2010 Nintendo Co., Ltd./HAL Laboratory, Inc. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo of America Inc. and/or Nintendo Company Ltd., and are protected by Federal copyright law. They may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without the prior written consent of Nintendo. $Revision: 13145 $ *---------------------------------------------------------------------------*/ #ifndef NW_SND_PLAYER_HEAP_H_ #define NW_SND_PLAYER_HEAP_H_ #include #include namespace nw { namespace snd { /* ======================================================================== type declaration ======================================================================== */ class SoundPlayer; namespace internal { class BasicSound; /* ======================================================================== class defition ======================================================================== */ class PlayerHeap : public SoundMemoryAllocatable { public: PlayerHeap(); virtual ~PlayerHeap(); void AttachSoundPlayer( SoundPlayer* player ) { m_pPlayer = player; } void AttachSound( BasicSound* sound ); void DetachSound( BasicSound* sound ); bool Create( void* startAddress, size_t size ); void Destroy(); // メモリブロックを確保する virtual void* Alloc( size_t size ); // 確保したメモリブロックを全て解放する void Clear(); // ヒープが有効かどうかを調べる bool IsValid() const { return m_pAllocAddress != NULL; } // ヒープの空き容量を取得する size_t GetFreeSize() const; private: BasicSound* m_pSound; SoundPlayer* m_pPlayer; void* m_pStartAddress; void* m_pEndAddress; void* m_pAllocAddress; public: ut::LinkListNode m_Link; // NW_UT_INIT_LIST のためにpublic }; } // namespace nw::snd::internal } // namespace nw::snd } // namespace nw #endif /* NW_SND_PLAYER_HEAP_H_ */