TuttleOFX  1
OfxhPluginHandle.hpp
Go to the documentation of this file.
00001 #ifndef OFXH_PLUGINHANDLE_HPP
00002 #define OFXH_PLUGINHANDLE_HPP
00003 
00004 #include "OfxhHost.hpp"
00005 #include "OfxhPlugin.hpp"
00006 #include "OfxhPluginBinary.hpp"
00007 
00008 #include <ofxCore.h>
00009 
00010 namespace tuttle {
00011 namespace host {
00012 namespace ofx {
00013 
00014 /**
00015  * wrapper class for Plugin/PluginBinary.  use in a RAIA fashion to make sure the binary gets unloaded when needed and not before.
00016  */
00017 class OfxhPluginHandle
00018 {
00019 OfxhPlugin* _p;
00020 OfxhPluginBinary* _b;
00021 OfxPlugin* _op;
00022 
00023 public:
00024         OfxhPluginHandle( OfxhPlugin& p, OfxhHost& _host );
00025         virtual ~OfxhPluginHandle();
00026 
00027         OfxPlugin*       getOfxPlugin()       { return _op; }
00028         const OfxPlugin* getOfxPlugin() const { return _op; }
00029 
00030         OfxPlugin* operator->() { return _op; }
00031 
00032 };
00033 
00034 }
00035 }
00036 }
00037 
00038 #endif
00039