TuttleOFX
1
|
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 RAII fashion to make sure the binary gets unloaded when needed. 00016 */ 00017 class OfxhPluginLoadGuard 00018 { 00019 OfxhPlugin* _plugin; 00020 OfxhPluginBinary* _pluginBinary; 00021 00022 OfxPlugin* _rawOfxPlugin; 00023 00024 public: 00025 OfxhPluginLoadGuard( OfxhPlugin& p, OfxhHost& _host ); 00026 virtual ~OfxhPluginLoadGuard(); 00027 00028 OfxPlugin* getOfxPlugin() { return _rawOfxPlugin; } 00029 const OfxPlugin* getOfxPlugin() const { return _rawOfxPlugin; } 00030 00031 OfxPlugin* operator->() { return _rawOfxPlugin; } 00032 00033 }; 00034 00035 } 00036 } 00037 } 00038 00039 #endif 00040