1 /*---------------------------------------------------------------------------*
2   Project:  NintendoWare
3   File:     snd_DisposeCallbackManager.h
4 
5   Copyright (C)2009-2011 Nintendo/HAL Laboratory, Inc.  All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain proprietary
8   information of Nintendo and/or its licensed developers and are protected by
9   national and international copyright laws. They may not be disclosed to third
10   parties or copied or duplicated in any form, in whole or in part, without the
11   prior written consent of Nintendo.
12 
13   The content herein is highly confidential and should be handled accordingly.
14 
15   $Revision: 31311 $
16  *---------------------------------------------------------------------------*/
17 
18 #ifndef NW_SND_DISPOSE_CALLBACK_MANAGER_H_
19 #define NW_SND_DISPOSE_CALLBACK_MANAGER_H_
20 
21 #include <nw/ut/ut_LinkList.h>
22 #include <nw/snd/snd_DisposeCallback.h>
23 
24 namespace nw {
25 namespace snd {
26 namespace internal {
27 namespace driver {
28 
29 class DisposeCallbackManager
30 {
31     /* ------------------------------------------------------------------------
32             typename definition
33        ------------------------------------------------------------------------ */
34 public:
35     typedef ut::LinkList< DisposeCallback, offsetof(DisposeCallback,m_DisposeLink)> CallbackList;
36 
37     /* ------------------------------------------------------------------------
38             class member
39        ------------------------------------------------------------------------ */
40 public:
41     static DisposeCallbackManager& GetInstance();
42 
43     void Dispose( void* mem, unsigned long size );
44 
45     void RegisterDisposeCallback( DisposeCallback* callback );
46     void UnregisterDisposeCallback( DisposeCallback* callback );
47 
48     unsigned long GetCallbackCount() const;
49 
50 private:
51     DisposeCallbackManager();
52 
53     CallbackList m_CallbackList;
54 };
55 
56 } // namespace nw::snd::internal::driver
57 } // namespace nw::snd::internal
58 } // namespace nw::snd
59 } // namespace nw
60 
61 
62 #endif /* NW_SND_DISPOSE_CALLBACK_MANAGER_H_ */
63 
64