TuttleOFX
1
|
#include <OfxhPluginBinary.hpp>
Public Types | |
typedef OfxhPluginBinary | This |
typedef boost::ptr_vector < OfxhPlugin > | PluginVector |
Public Member Functions | |
OfxhPluginBinary (const std::string &file, const std::string &bundlePath, time_t mtime, size_t size) | |
OfxhPluginBinary (const std::string &file, const std::string &bundlePath, OfxhPluginCache *cache) | |
virtual | ~OfxhPluginBinary () |
dtor | |
bool | operator== (const This &other) const |
bool | operator!= (const This &other) const |
time_t | getFileModificationTime () const |
size_t | getFileSize () const |
const std::string & | getFilePath () const |
const std::string & | getBundlePath () const |
const std::string | getResourcesPath () const |
bool | hasBinaryChanged () const |
bool | isLoaded () const |
void | addPlugin (OfxhPlugin *pe) |
void | loadPluginInfo (OfxhPluginCache *) |
try to open the plugin bundle object and query it for plugins | |
int | getNPlugins () const |
how many plugins? | |
PluginVector & | getPlugins () |
get plugins | |
const PluginVector & | getPlugins () const |
get plugins | |
OfxhPlugin & | getPlugin (int idx) |
get a plugin | |
const OfxhPlugin & | getPlugin (int idx) const |
get a plugin | |
Protected Attributes | |
OfxhBinary | _binary |
our binary object, abstracted layer ontop of OS calls, defined in OfxhBinary.hpp | |
std::string | _filePath |
full path to the file | |
std::string | _bundlePath |
path to the .bundle directory | |
PluginVector | _plugins |
my plugins | |
time_t | _fileModificationTime |
used as a time stamp to check modification times, used for caching | |
size_t | _fileSize |
file size last time we check, used for caching | |
bool | _binaryChanged |
whether the timestamp/filesize in this cache is different from that in the actual binary | |
Private Member Functions | |
OfxhPluginBinary () | |
void | checkBinaryChanged () |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int version) |
Friends | |
class | OfxhPluginLoadGuard |
class | boost::serialization::access |
class that represents a binary file which holds plugins. Has a set of plugins inside it and which it owns These are owned by a PluginCache
Definition at line 23 of file OfxhPluginBinary.hpp.
typedef boost::ptr_vector<OfxhPlugin> tuttle::host::ofx::OfxhPluginBinary::PluginVector |
Definition at line 27 of file OfxhPluginBinary.hpp.
Definition at line 26 of file OfxhPluginBinary.hpp.
tuttle::host::ofx::OfxhPluginBinary::OfxhPluginBinary | ( | ) | [inline, explicit, private] |
Definition at line 41 of file OfxhPluginBinary.hpp.
tuttle::host::ofx::OfxhPluginBinary::OfxhPluginBinary | ( | const std::string & | file, |
const std::string & | bundlePath, | ||
time_t | mtime, | ||
size_t | size | ||
) | [inline, explicit] |
create one from the cache. this will invoke the Binary() constructor which will stat() the file.
Definition at line 51 of file OfxhPluginBinary.hpp.
References checkBinaryChanged().
tuttle::host::ofx::OfxhPluginBinary::OfxhPluginBinary | ( | const std::string & | file, |
const std::string & | bundlePath, | ||
OfxhPluginCache * | cache | ||
) | [inline, explicit] |
constructor which will open a library file, call things inside it, and then create Plugin objects as appropriate for the plugins exported therefrom
Definition at line 65 of file OfxhPluginBinary.hpp.
References loadPluginInfo().
tuttle::host::ofx::OfxhPluginBinary::~OfxhPluginBinary | ( | ) | [virtual] |
dtor
Definition at line 60 of file OfxhPluginBinary.cpp.
void tuttle::host::ofx::OfxhPluginBinary::addPlugin | ( | OfxhPlugin * | pe | ) | [inline] |
Definition at line 138 of file OfxhPluginBinary.hpp.
References _plugins.
void tuttle::host::ofx::OfxhPluginBinary::checkBinaryChanged | ( | ) | [inline, private] |
Definition at line 78 of file OfxhPluginBinary.hpp.
References _binary, _binaryChanged, _fileModificationTime, _fileSize, tuttle::host::ofx::OfxhBinary::getSize(), and tuttle::host::ofx::OfxhBinary::getTime().
Referenced by OfxhPluginBinary(), and serialize().
const std::string& tuttle::host::ofx::OfxhPluginBinary::getBundlePath | ( | ) | const [inline] |
Definition at line 117 of file OfxhPluginBinary.hpp.
References _bundlePath.
Referenced by tuttle::host::ofx::imageEffect::OfxhImageEffectNodeDescriptor::OfxhImageEffectNodeDescriptor(), and tuttle::host::ofx::OfxhPluginLoadGuard::OfxhPluginLoadGuard().
time_t tuttle::host::ofx::OfxhPluginBinary::getFileModificationTime | ( | ) | const [inline] |
Definition at line 102 of file OfxhPluginBinary.hpp.
References _fileModificationTime.
const std::string& tuttle::host::ofx::OfxhPluginBinary::getFilePath | ( | ) | const [inline] |
Definition at line 112 of file OfxhPluginBinary.hpp.
References _filePath.
Referenced by tuttle::host::ofx::OfxhPluginCache::addPlugin(), and tuttle::host::ofx::OfxhPluginCache::serialize().
size_t tuttle::host::ofx::OfxhPluginBinary::getFileSize | ( | ) | const [inline] |
Definition at line 107 of file OfxhPluginBinary.hpp.
References _fileSize.
int tuttle::host::ofx::OfxhPluginBinary::getNPlugins | ( | ) | const [inline] |
how many plugins?
Definition at line 146 of file OfxhPluginBinary.hpp.
References _plugins.
Referenced by tuttle::host::ofx::OfxhPluginCache::scanDirectory().
OfxhPlugin& tuttle::host::ofx::OfxhPluginBinary::getPlugin | ( | int | idx | ) | [inline] |
get a plugin
Definition at line 164 of file OfxhPluginBinary.hpp.
References _plugins.
Referenced by tuttle::host::ofx::OfxhPluginCache::scanDirectory().
const OfxhPlugin& tuttle::host::ofx::OfxhPluginBinary::getPlugin | ( | int | idx | ) | const [inline] |
PluginVector& tuttle::host::ofx::OfxhPluginBinary::getPlugins | ( | ) | [inline] |
get plugins
Definition at line 152 of file OfxhPluginBinary.hpp.
References _plugins.
Referenced by serialize(), and tuttle::host::ofx::OfxhPluginCache::serialize().
const PluginVector& tuttle::host::ofx::OfxhPluginBinary::getPlugins | ( | ) | const [inline] |
const std::string tuttle::host::ofx::OfxhPluginBinary::getResourcesPath | ( | ) | const [inline] |
Definition at line 122 of file OfxhPluginBinary.hpp.
References _bundlePath.
bool tuttle::host::ofx::OfxhPluginBinary::hasBinaryChanged | ( | ) | const [inline] |
Definition at line 127 of file OfxhPluginBinary.hpp.
References _binaryChanged.
bool tuttle::host::ofx::OfxhPluginBinary::isLoaded | ( | ) | const [inline] |
Definition at line 132 of file OfxhPluginBinary.hpp.
References _binary, and tuttle::host::ofx::OfxhBinary::isLoaded().
void tuttle::host::ofx::OfxhPluginBinary::loadPluginInfo | ( | OfxhPluginCache * | cache | ) |
try to open the plugin bundle object and query it for plugins
Definition at line 16 of file OfxhPluginBinary.cpp.
References _binary, _binaryChanged, _fileModificationTime, _fileSize, _plugins, tuttle::host::ofx::OfxhPluginCache::findApiHandler(), tuttle::host::ofx::OfxhBinary::findSymbol(), tuttle::host::ofx::OfxhBinary::getBinaryPath(), tuttle::host::ofx::OfxhBinary::getSize(), tuttle::host::ofx::OfxhBinary::getTime(), tuttle::host::ofx::OfxhBinary::load(), tuttle::host::ofx::OfxhBinary::setInvalid(), and tuttle::host::ofx::OfxhBinary::unload().
Referenced by OfxhPluginBinary().
bool tuttle::host::ofx::OfxhPluginBinary::operator!= | ( | const This & | other | ) | const [inline] |
Definition at line 100 of file OfxhPluginBinary.hpp.
References operator==().
bool tuttle::host::ofx::OfxhPluginBinary::operator== | ( | const This & | other | ) | const [inline] |
Definition at line 87 of file OfxhPluginBinary.hpp.
References _binary, _binaryChanged, _bundlePath, _fileModificationTime, _filePath, _fileSize, and _plugins.
Referenced by operator!=().
void tuttle::host::ofx::OfxhPluginBinary::serialize | ( | Archive & | ar, |
const unsigned int | version | ||
) | [inline, private] |
Definition at line 178 of file OfxhPluginBinary.hpp.
References _binary, _bundlePath, _fileModificationTime, _filePath, _fileSize, _plugins, checkBinaryChanged(), getPlugins(), and tuttle::host::ofx::OfxhBinary::init().
friend class boost::serialization::access [friend] |
Definition at line 176 of file OfxhPluginBinary.hpp.
friend class OfxhPluginLoadGuard [friend] |
Definition at line 29 of file OfxhPluginBinary.hpp.
our binary object, abstracted layer ontop of OS calls, defined in OfxhBinary.hpp
Definition at line 32 of file OfxhPluginBinary.hpp.
Referenced by checkBinaryChanged(), isLoaded(), loadPluginInfo(), tuttle::host::ofx::OfxhPluginLoadGuard::OfxhPluginLoadGuard(), operator==(), serialize(), and tuttle::host::ofx::OfxhPluginLoadGuard::~OfxhPluginLoadGuard().
bool tuttle::host::ofx::OfxhPluginBinary::_binaryChanged [protected] |
whether the timestamp/filesize in this cache is different from that in the actual binary
Definition at line 38 of file OfxhPluginBinary.hpp.
Referenced by checkBinaryChanged(), hasBinaryChanged(), loadPluginInfo(), and operator==().
std::string tuttle::host::ofx::OfxhPluginBinary::_bundlePath [protected] |
path to the .bundle directory
Definition at line 34 of file OfxhPluginBinary.hpp.
Referenced by getBundlePath(), getResourcesPath(), operator==(), and serialize().
time_t tuttle::host::ofx::OfxhPluginBinary::_fileModificationTime [protected] |
used as a time stamp to check modification times, used for caching
Definition at line 36 of file OfxhPluginBinary.hpp.
Referenced by checkBinaryChanged(), getFileModificationTime(), loadPluginInfo(), operator==(), and serialize().
std::string tuttle::host::ofx::OfxhPluginBinary::_filePath [protected] |
full path to the file
Definition at line 33 of file OfxhPluginBinary.hpp.
Referenced by getFilePath(), operator==(), and serialize().
size_t tuttle::host::ofx::OfxhPluginBinary::_fileSize [protected] |
file size last time we check, used for caching
Definition at line 37 of file OfxhPluginBinary.hpp.
Referenced by checkBinaryChanged(), getFileSize(), loadPluginInfo(), operator==(), and serialize().
my plugins
Definition at line 35 of file OfxhPluginBinary.hpp.
Referenced by addPlugin(), getNPlugins(), getPlugin(), getPlugins(), loadPluginInfo(), operator==(), and serialize().