00001 00002 // exotkPlugin.cxx 00004 // Copyright (C) 2001 Stephane Routelous 00005 // 00006 // This file is part of exoTK. 00007 // 00008 // exoTK is free software; you can redistribute it and/or modify 00009 // it under the terms of the GNU General Public License as published by 00010 // the Free Software Foundation; either version 2 of the License, or 00011 // (at your option) any later version. 00012 // 00013 // exoTK is distributed in the hope that it will be useful, 00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 // GNU General Public License for more details. 00017 // 00018 // You should have received a copy of the GNU General Public License 00019 // along with exoTK; if not, write to the Free Software 00020 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00022 00029 #include <exotkPlugin.hxx> 00030 00031 #ifndef _TCollection_AsciiString_HeaderFile 00032 #include <TCollection_AsciiString.hxx> 00033 #endif 00034 #ifndef _exotkPlugin_Plugin_HeaderFile 00035 #include <exotkPlugin_Plugin.hxx> 00036 #endif 00037 #ifndef _TColStd_SequenceOfTransient_HeaderFile 00038 #include <TColStd_SequenceOfTransient.hxx> 00039 #endif 00040 00046 namespace exotkPlugin_Datas 00047 { 00049 TColStd_SequenceOfTransient theRegisteredPlugins; 00051 TColStd_SequenceOfTransient theNotRegisteredPlugins; 00052 } 00053 00054 00055 //================================================================================== 00056 // Function name : exotkPlugin::RegisterPlugin 00057 //================================================================================== 00058 // Written by : Stephane Routelous - 2001-12-29 00:47:09 00059 // Description : 00060 // Return type : Handle_exotkPlugin_Plugin 00061 //================================================================================== 00062 // Argument : const TCollection_AsciiString &aPluginPath 00063 Handle_exotkPlugin_Plugin exotkPlugin::RegisterPlugin(const TCollection_AsciiString &aPluginPath) 00064 { 00065 Standard_Boolean thePluginIsRegistered = Standard_False; 00066 Handle_exotkPlugin_Plugin theReturnedPlugin; 00067 Handle_exotkPlugin_Plugin thePlugin = new exotkPlugin_Plugin(aPluginPath); 00068 if ( thePlugin->IsValid() ) 00069 { 00070 exotkPlugin_Datas::theRegisteredPlugins.Append(thePlugin); 00071 thePluginIsRegistered = Standard_True; 00072 theReturnedPlugin = thePlugin; 00073 } 00074 else 00075 { 00076 exotkPlugin_Datas::theNotRegisteredPlugins.Append(thePlugin); 00077 } 00078 return theReturnedPlugin; 00079 } 00080 00081 00082 //================================================================================== 00083 // Function name : exotkPlugin::UnregisterPlugins 00084 //================================================================================== 00085 // Written by : Stephane Routelous - 2001-12-29 00:47:11 00086 // Description : 00087 // Return type : void 00088 //================================================================================== 00089 void exotkPlugin::UnregisterPlugins() 00090 { 00091 /* int i; 00092 for ( i = 1 ; i <= exotkPlugin_Datas::theRegisteredPlugins.Length() ; i++ ) 00093 { 00094 Handle_exotkPlugin_Plugin thePlugin = Handle_exotkPlugin_Plugin::DownCast(exotkPlugin_Datas::theRegisteredPlugins.Value(i)); 00095 } 00096 */ 00097 }
1.2.12 written by Dimitri van Heesch,
© 1997-2001