00001 // Copyright (c) 2009-2010 Rosen Diankov 00002 // 00003 // Licensed under the Apache License, Version 2.0 (the "License"); 00004 // you may not use this file except in compliance with the License. 00005 // You may obtain a copy of the License at 00006 // http://www.apache.org/licenses/LICENSE-2.0 00007 // 00008 // Unless required by applicable law or agreed to in writing, software 00009 // distributed under the License is distributed on an "AS IS" BASIS, 00010 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00011 // See the License for the specific language governing permissions and 00012 // limitations under the License. 00013 // 00014 // \author Rosen Diankov 00015 #include "actionlib_controller.h" 00016 #include <rave/plugin.h> 00017 00018 static std::list< boost::shared_ptr<void> >* s_listRegisteredReaders = NULL; 00019 InterfaceBasePtr CreateInterfaceValidated(InterfaceType type, const std::string& interfacename, std::istream& sinput, EnvironmentBasePtr penv) 00020 { 00021 if( !s_listRegisteredReaders ) { 00022 s_listRegisteredReaders = new list< boost::shared_ptr<void> >(); 00023 //s_listRegisteredReaders.push_back(ROSMocapSystem::RegisterXMLReader(penv)); 00024 } 00025 switch(type) { 00026 case PT_Controller: 00027 if( interfacename == "rosactionlib") 00028 return InterfaceBasePtr(new ROSActionLibController(penv,sinput)); 00029 break; 00030 default: 00031 break; 00032 } 00033 return InterfaceBasePtr(); 00034 } 00035 00036 void GetPluginAttributesValidated(PLUGININFO& info) 00037 { 00038 info.interfacenames[OpenRAVE::PT_Controller].push_back("rosactionlib"); 00039 } 00040 00041 RAVE_PLUGIN_API void DestroyPlugin() 00042 { 00043 delete s_listRegisteredReaders; 00044 s_listRegisteredReaders = NULL; 00045 }