1 /*---------------------------------------------------------------------------*
2   Project:  NintendoWare
3   File:     snd_DisposeCallbackManager.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: 22284 $
14  *---------------------------------------------------------------------------*/
15 
16 #ifndef NW_SND_DISPOSE_CALLBACK_MANAGER_H_
17 #define NW_SND_DISPOSE_CALLBACK_MANAGER_H_
18 
19 #include <nw/ut/ut_LinkList.h>
20 #include <nw/snd/snd_DisposeCallback.h>
21 
22 namespace nw {
23 namespace snd {
24 namespace internal {
25 namespace driver {
26 
27 class DisposeCallbackManager
28 {
29     /* ------------------------------------------------------------------------
30             typename definition
31        ------------------------------------------------------------------------ */
32   public:
33     typedef ut::LinkList< DisposeCallback, offsetof(DisposeCallback,m_DisposeLink)> CallbackList;
34 
35     /* ------------------------------------------------------------------------
36             class member
37        ------------------------------------------------------------------------ */
38   public:
39     static DisposeCallbackManager& GetInstance();
40 
41     void Dispose( void* mem, unsigned long size );
42 
43     void RegisterDisposeCallback( DisposeCallback* callback );
44     void UnregisterDisposeCallback( DisposeCallback* callback );
45 
46     unsigned long GetCallbackCount() const;
47 
48   private:
49     DisposeCallbackManager();
50 
51     CallbackList m_CallbackList;
52 };
53 
54 } // namespace nw::snd::internal::driver
55 } // namespace nw::snd::internal
56 } // namespace nw::snd
57 } // namespace nw
58 
59 
60 #endif /* NW_SND_DISPOSE_CALLBACK_MANAGER_H_ */
61 
62