目录

include/AK/Tools/Common/AkListBareLight.h

Go to the documentation of this file.
00001 
00002 //
00003 // Copyright (c) 2006 Audiokinetic Inc. / All Rights Reserved
00004 //
00006 
00007 // AkListBareLight.h
00008 
00009 #ifndef _AKLISTBARELIGHT_H
00010 #define _AKLISTBARELIGHT_H
00011 
00012 #include <AK/Tools/Common/AkListBare.h>
00013 
00014 // this one lets you define the structure
00015 // only requirement is that T must have member pNextLightItem,
00016 // or use the template getter.
00017 // client is responsible for allocation/deallocation of T.
00018 
00019 // WATCH OUT !
00020 // - remember that removeall/term can't delete the elements for you.
00021 // - be sure to destroy elements AFTER removing them from the list, as remove will
00022 // access members of the element.
00023 // WARNING : Each AkListBareLight item can be used in only one AkListBareLight at 
00024 //           once since the member pNextLightItem cannot be re-used.
00025 
00027 template <class T> struct AkListBareLightNextItem
00028 {
00030     static AkForceInline T *& Get( T * in_pItem ) 
00031     {
00032         return in_pItem->pNextLightItem;
00033     }
00034 };
00035 
00037 template <class T, template <class> class U_NEXTITEM = AkListBareLightNextItem > class AkListBareLight : public AkListBare< T, U_NEXTITEM, AkCountPolicyNoCount, AkLastPolicyNoLast > {};
00038 
00039 #endif // _AKLISTBARELIGHT_H