00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef SGE_RENDERER_SCOPED_LOCK_HPP_INCLUDED
00022 #define SGE_RENDERER_SCOPED_LOCK_HPP_INCLUDED
00023
00024 #include "scoped_lock_wrapper.hpp"
00025 #include "../export.hpp"
00026 #include <boost/noncopyable.hpp>
00027
00028 namespace sge
00029 {
00030 namespace renderer
00031 {
00032
00033 template<typename T, typename Value>
00034 class scoped_lock : boost::noncopyable {
00035 public:
00036 typedef scoped_lock_wrapper<
00037 T,
00038 Value
00039 > wrapper;
00040
00041 SGE_SYMBOL explicit scoped_lock(
00042 wrapper const& w);
00043
00044 SGE_SYMBOL void release();
00045
00046 SGE_SYMBOL Value const value() const;
00047
00048 SGE_SYMBOL ~scoped_lock();
00049 private:
00050 void unlock();
00051
00052 wrapper w;
00053 };
00054
00055 }
00056 }
00057
00058 #endif