/* DefsManager - access to preconfigured default objects and definitions Copyright (C) CinelerraCV 2007, Hermann Vosseler This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * *****************************************************/ #include "proc/mobject/session/defsmanager.hpp" #include "proc/asset/procpatt.hpp" #include "proc/asset/pipe.hpp" #include "common/configrules.hpp" #include "common/error.hpp" #include using boost::format; using asset::Query; using asset::Pipe; using asset::ProcPatt; using asset::PProcPatt; using cinelerra::ConfigRules; using cinelerra::query::QueryHandler; using cinelerra::query::CINELERRA_ERROR_CAPABILITY_QUERY; namespace mobject { namespace session { using std::tr1::shared_ptr; /** initialize the most basic internal defaults. */ DefsManager::DefsManager () throw() { TODO ("setup basic defaults of the session"); } template shared_ptr DefsManager::search (const Query& capabilities) { UNIMPLEMENTED ("search for default registered object, dont create"); } template shared_ptr DefsManager::create (const Query& capabilities) { UNIMPLEMENTED ("retrieve object and register as default"); } template bool DefsManager::define (shared_ptr& defaultObj, const Query& capabilities) { UNIMPLEMENTED ("just do the defaults registration"); } template bool DefsManager::forget (shared_ptr& defaultObj) { UNIMPLEMENTED ("purge defaults registration"); } template shared_ptr DefsManager::operator() (const Query& capabilities) { TODO ("move this code to create()"); QueryHandler& typeHandler = ConfigRules::instance(); shared_ptr res = typeHandler.resolve (capabilities); if (!res) throw cinelerra::error::Config ( str(format("The following Query could not be resolved: %s.") % capabilities.asKey()) , CINELERRA_ERROR_CAPABILITY_QUERY ); else return res; } /***************************************************************/ /* explicit template instantiations for querying various Types */ /***************************************************************/ template shared_ptr DefsManager::operator ()(const Query&); template PProcPatt DefsManager::operator ()(const Query&); } // namespace mobject::session } // namespace mobject