TuttleOFX  1
TuttleOFX/libraries/tuttle/src/tuttle/host/ofx/OfxhPluginAPICache.hpp
Go to the documentation of this file.
00001 /*
00002  * Software License :
00003  *
00004  * Copyright (c) 2007-2009, The Open Effects Association Ltd.  All Rights Reserved.
00005  *
00006  * Redistribution and use in source and binary forms, with or without
00007  * modification, are permitted provided that the following conditions are met:
00008  *
00009  * Redistributions of source code must retain the above copyright notice,
00010  *    this list of conditions and the following disclaimer.
00011  * Redistributions in binary form must reproduce the above copyright notice,
00012  *    this list of conditions and the following disclaimer in the documentation
00013  *    and/or other materials provided with the distribution.
00014  * Neither the name The Open Effects Association Ltd, nor the names of its
00015  *    contributors may be used to endorse or promote products derived from this
00016  *    software without specific prior written permission.
00017  *
00018  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
00019  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00020  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00021  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
00022  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00023  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00024  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
00025  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00026  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00027  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00028  */
00029 #ifndef _TUTTLE_HOST_OFX_PLUGINAPICACHE_HPP_
00030 #define _TUTTLE_HOST_OFX_PLUGINAPICACHE_HPP_
00031 
00032 #include "OfxhHost.hpp"
00033 #include "property/OfxhSet.hpp"
00034 
00035 #include <string>
00036 
00037 namespace tuttle {
00038 namespace host {
00039 namespace ofx {
00040 class OfxhPlugin;
00041 class OfxhPluginBinary;
00042 
00043 namespace APICache {
00044 
00045 /// this acts as an interface for the Plugin Cache, handling api-specific cacheing
00046 class OfxhPluginAPICacheI
00047 {
00048 public:
00049         std::string _apiName;
00050         int _apiVersionMin, _apiVersionMax;
00051 
00052 public:
00053         OfxhPluginAPICacheI( std::string apiName, int verMin, int verMax )
00054                 : _apiName( apiName )
00055                 , _apiVersionMin( verMin )
00056                 , _apiVersionMax( verMax )
00057         {}
00058 
00059         virtual ~OfxhPluginAPICacheI() {}
00060 
00061         virtual void loadFromPlugin( OfxhPlugin& ) = 0;
00062 
00063         /// factory method, to create a new plugin (from binary)
00064         virtual OfxhPlugin* newPlugin( OfxhPluginBinary&, int pi, OfxPlugin& plug ) = 0;
00065 
00066         /// factory method, to create a new plugin (from the
00067         virtual OfxhPlugin* newPlugin( OfxhPluginBinary& pb, int pi, const std::string& api, int apiVersion, const std::string& pluginId,
00068                                        const std::string& rawId, int pluginMajorVersion, int pluginMinorVersion ) = 0;
00069 
00070         virtual OfxhHost& getHost() = 0;
00071 
00072         virtual void confirmPlugin( OfxhPlugin& ) = 0;
00073 
00074         virtual bool pluginSupported( const OfxhPlugin&, std::string& reason ) const = 0;
00075 };
00076 
00077 }
00078 }
00079 }
00080 }
00081 
00082 #endif
00083