1 /*---------------------------------------------------------------------------*
2   Project:  NintendoWare
3   File:     snd_SoundMemoryAllocatable.h
4 
5   Copyright (C)2009-2010 Nintendo Co., Ltd./HAL Laboratory, Inc.  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   $Revision: 18106 $
14  *---------------------------------------------------------------------------*/
15 
16 /**
17  * :include nw/snd/snd_SoundMemoryAllocatable.h
18  *
19  * @file snd_SoundMemoryAllocatable.h
20  */
21 
22 #ifndef NW_SND_SOUND_MEMORY_ALLOCATABLE_H_
23 #define NW_SND_SOUND_MEMORY_ALLOCATABLE_H_
24 
25 namespace nw {
26 namespace snd {
27 
28 //---------------------------------------------------------------------------
29 //! @brief    サウンドデータを配置するためのメモリを確保するためのインターフェイスです。
30 //!
31 //!           @ref SoundHeap クラスがこのクラスを継承しています。
32 //!
33 //! @see      SoundHeap クラス
34 //!
35 //! @date 2010/01/15 初版
36 //---------------------------------------------------------------------------
37 class SoundMemoryAllocatable
38 {
39 public:
40     //----------------------------------------
41     //! @name デストラクタ
42     //@{
43     //---------------------------------------------------------------------------
44     //! @brief    デストラクタです。
45     //!
46     //! @date 2010/01/15 初版
47     //---------------------------------------------------------------------------
~SoundMemoryAllocatable()48     virtual ~SoundMemoryAllocatable() {}
49     //@}
50 
51     //----------------------------------------
52     //! @name ヒープ操作
53     //@{
54     //---------------------------------------------------------------------------
55     //! @brief    メモリ上のヒープからメモリ領域を割り当てます。
56     //!
57     //!           確保するメモリの先頭アドレスは
58     //!           32 バイトアライメントされている必要があります。
59     //!
60     //! @param[in]    size    確保するメモリサイズです。
61     //!
62     //! @return   確保したメモリブロックの先頭アドレスを返します。
63     //!           確保に失敗した場合は NULL を返さなくてはなりません。
64     //!
65     //! @date 2010/01/15 初版
66     //---------------------------------------------------------------------------
67     virtual void* Alloc( size_t size ) = 0;
68     //@}
69 };
70 
71 } // namespace nw::snd
72 } // namespace nw
73 
74 
75 #endif /* NW_SND_SOUND_MEMORY_ALLOCATABLE_H_ */
76 
77