Main Page   Class Hierarchy   Compound List   File List   Compound Members  

BasicDynLib.cpp

00001 /********************************************************************
00002     ** Copyright (C) 2000 SOMELib Project
00003     **
00004     ** This library is free software; you can redistribute it and/or
00005     ** modify it under the terms of the GNU Library General Public
00006     ** License as published by the Free Software Foundation; either
00007     ** version 2 of the License, or (at your option) any later version.
00008     **
00009     ** This library is distributed in the hope that it will be useful,
00010     ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012     ** Library General Public License for more details.
00013     **
00014     ** You should have received a copy of the GNU Library General Public
00015     ** License along with this library; if not, write to the
00016     ** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00017     ** Boston, MA  02111-1307, USA.
00018     **
00019     *******************************************************************/
00020 
00021 #include "UserConfig.h"
00022 #include "BasicDynLib.h"
00023 #include <string>
00024 #include <iostream>
00025 
00026 //check valid defines
00027 #if ((defined(USE_SOME_UNIX_SO) && defined(USE_SOME_WINDOWS_DLL)) || (defined(USE_SOME_UNIX_SO) && defined(USE_SOME_HPUX_SL)) || (defined(USE_SOME_HPUX_SL) && defined(USE_SOME_WINDOWS_DLL)))
00028 #error "Only define one type of dynamic library loading."
00029 #endif
00030 #if (!defined(USE_SOME_UNIX_SO) && !defined(USE_SOME_WINDOWS_DLL) && !defined(USE_SOME_HPUX_SL))
00031 #error "You haven't selected a type of dynamic loading."
00032 #endif
00033 
00034 //Implementation of BasicDynLib
00035 SOME::BasicDynLib::BasicDynLib():
00036         valid_lib(false)
00037 {}
00038 
00039 
00040 
00041 SOME::BasicDynLib::~BasicDynLib()
00042 {
00043     //can't use virtuality in base class destructor unloadLibrary();
00044 }
00045 
00046 
00047 
00048 //Derived types for each platform, correct one selected by make
00049 
00050 
00051 #include "DynLib.h"
00052 
00053 //our factory
00054 SOME::BasicDynLib* SOME::newDynLib()
00055 {
00056 #ifdef USE_SOME_UNIX_SO
00057     return new SOME::DynLib;
00058 #endif
00059 
00060 #ifdef USE_SOME_WINDOWS_DLL
00061     return new SOME::DynLib;
00062 #endif
00063 
00064 #ifdef USE_SOME_HPUX_SL
00065     return new SOME::DynLib;
00066 #endif
00067 
00068     std::cerr << "newDynLib() failed, try defining the appropriate symbol in UserConfig.h\n";
00069     return NULL;
00070 }
00071 
00072 
00073 //implementations
00074 #ifdef USE_SOME_UNIX_SO
00075 
00076 #endif //USE_SOME_UNIX_SO
00077 
00078 #ifdef USE_SOME_WINDOWS_DLL
00079 
00080 #endif //USE_SOME_WINDOWS_DLL
00081 
00082 #ifdef USE_SOME_HPUX_SL
00083 
00084 #endif //USE_SOME_HPUX_SL

Generated at Fri Dec 8 14:24:48 2000 for SOMELib by doxygen1.2.1 written by Dimitri van Heesch, © 1997-2000