Version

menu_open

include/AK/Tools/Common/AkAutoLock.h

Go to the documentation of this file.
00001 
00002 //
00003 // AkAutoLock.h
00004 //
00005 // AudioKinetic Lock base class.
00006 //
00007 // Copyright (c) 2006 Audiokinetic Inc. / All Rights Reserved
00008 //
00010 #ifndef _AUTO_LOCK_H_
00011 #define _AUTO_LOCK_H_
00012 
00013 #include <AK/SoundEngine/Common/AkTypes.h>
00014 
00015 template< class TLock >
00016 class AkAutoLock
00017 {
00018 public:
00020     AkForceInline AkAutoLock( TLock& in_rLock )
00021         : m_rLock( in_rLock )
00022     {
00023         m_rLock.Lock();
00024     }
00025 
00027     AkForceInline ~AkAutoLock()
00028     {
00029         m_rLock.Unlock();
00030     }
00031 
00032 private:
00033     AkAutoLock& operator=(AkAutoLock&);
00034     TLock& m_rLock;
00035 };
00036 
00037 #endif //_AUTO_LOCK_H_

Was this page helpful?

Need Support?

Questions? Problems? Need more info? Contact us, and we can help!

Visit our Support page

Tell us about your project. We're here to help.

Register your project and we'll help you get started with no strings attached!

Get started with Wwise