|
From: stephan b. <sg...@us...> - 2004-12-23 21:50:54
|
Update of /cvsroot/pclasses/pclasses2/src/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16903 Modified Files: SharedLib.dl.cpp SharedLib.dyld.cpp SharedLib.generic.cpp SharedLib.ltdl.cpp SharedLib.shl.cpp SharedLib.win32.cpp Log Message: moved the operator[](const string &) into SharedLib.generic.cpp, to reduce code duplication. Index: SharedLib.dl.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/System/SharedLib.dl.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- SharedLib.dl.cpp 23 Dec 2004 21:13:27 -0000 1.4 +++ SharedLib.dl.cpp 23 Dec 2004 21:50:44 -0000 1.5 @@ -86,13 +86,6 @@ return addr; } -#ifdef PCLASSES_WITH_STL -void* SharedLib::operator[](const std::string& symbol) throw(RuntimeError) -{ - return operator[](symbol.c_str()); -} -#endif - } // !namespace System } // !namespace P Index: SharedLib.generic.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/System/SharedLib.generic.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- SharedLib.generic.cpp 23 Dec 2004 21:44:27 -0000 1.2 +++ SharedLib.generic.cpp 23 Dec 2004 21:50:44 -0000 1.3 @@ -7,12 +7,21 @@ namespace P { namespace System { +#ifdef PCLASSES_WITH_STL +void* SharedLib::operator[](const std::string& symbol) throw(RuntimeError) +{ + return operator[](symbol.c_str()); +} +#endif + #ifdef PCLASSES_WITH_STL /** An internal helper type to clean up a list of SharedLib objects. + + ContainterT must be compatible with list<SharedLib *>. */ template <typename ContainterT> struct SharedLibCleaner @@ -21,6 +30,10 @@ SharedLibCleaner() { } + + /** + Calls delete() on each entry in container(). + */ ~SharedLibCleaner() { typename list_t::iterator it = m_list.begin(); @@ -32,6 +45,9 @@ m_list.clear(); } + /** + Returns this object's container. + */ list_t & container() { return this->m_list; Index: SharedLib.dyld.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/System/SharedLib.dyld.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- SharedLib.dyld.cpp 23 Dec 2004 05:27:49 -0000 1.2 +++ SharedLib.dyld.cpp 23 Dec 2004 21:50:44 -0000 1.3 @@ -98,12 +98,6 @@ return (void*)addr; } -#ifdef PCLASSES_WITH_STL -void* SharedLib::operator[](const std::string& symbol) throw(RuntimeError) -{ - return operator[](symbol.c_str()); -} -#endif } // !namespace System Index: SharedLib.ltdl.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/System/SharedLib.ltdl.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- SharedLib.ltdl.cpp 23 Dec 2004 21:08:08 -0000 1.1 +++ SharedLib.ltdl.cpp 23 Dec 2004 21:50:44 -0000 1.2 @@ -112,12 +112,6 @@ return addr; } -#ifdef PCLASSES_WITH_STL -void* SharedLib::operator[](const std::string& symbol) throw(RuntimeError) -{ - return operator[](symbol.c_str()); -} -#endif } // !namespace System Index: SharedLib.shl.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/System/SharedLib.shl.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- SharedLib.shl.cpp 23 Dec 2004 05:27:49 -0000 1.2 +++ SharedLib.shl.cpp 23 Dec 2004 21:50:44 -0000 1.3 @@ -91,13 +91,6 @@ return address; } -#ifdef PCLASSES_WITH_STL -void* SharedLib::operator[](const std::string& symbol) throw(RuntimeError) -{ - return operator[](symbol.c_str()); -} -#endif - } // !namespace System } // !namespace P Index: SharedLib.win32.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/System/SharedLib.win32.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- SharedLib.win32.cpp 23 Dec 2004 05:27:49 -0000 1.2 +++ SharedLib.win32.cpp 23 Dec 2004 21:50:44 -0000 1.3 @@ -68,13 +68,6 @@ return addr; } -#ifdef PCLASSES_WITH_STL -void* SharedLib::operator[](const std::string& symbol) throw(RuntimeError) -{ - return operator[](symbol.c_str()); -} -#endif - } // !namespace System } // !namespace P |