LAMA
/home/brandes/workspace/LAMA/src/lama/ContextAccess.hpp
Go to the documentation of this file.
00001 
00034 #ifndef LAMA_CONTEXT_ACCESS_HPP_
00035 #define LAMA_CONTEXT_ACCESS_HPP_
00036 
00037 // for dll_import
00038 #include <lama/config.hpp>
00039 
00040 // base classes
00041 #include <lama/BaseAccess.hpp>
00042 
00043 // others
00044 #include <lama/Context.hpp>
00045 
00046 // logging
00047 #include <logging/logging.hpp>
00048 
00049 namespace lama
00050 {
00051 
00060 class LAMA_DLL_IMPORTEXPORT ContextAccess : public BaseAccess
00061 {
00062 public:
00063 
00066     ContextAccess( ContextPtr context, const char* filename, int line );
00067 
00070     ~ContextAccess();
00071 
00074     virtual void release();
00075 
00078     virtual void writeAt( std::ostream& stream ) const;
00079 
00080 private:
00081 
00082     LAMA_LOG_DECL_STATIC_LOGGER(logger);
00083 
00084     ContextAccess();    // do not allow the default constructor 
00085 
00086     ContextPtr mContext; 
00087 
00088     bool mReleased;    
00089 
00090     const char* mFile;  
00091 
00092     int mLine;  
00093 };
00094 
00095 }  // namespace lama
00096 
00107 #define LAMA_CONTEXT_ACCESS( context ) lama::ContextAccess LAMA_Ctx_Access__( context, __FILE__, __LINE__ )
00108 
00109 #endif // LAMA_CONTEXT_ACCESS_HPP_