You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(622) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(303) |
Feb
(64) |
Mar
(5) |
Apr
(63) |
May
(82) |
Jun
(53) |
Jul
(50) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: stephan b. <sg...@us...> - 2004-12-25 01:03:38
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28842/include/pclasses/Util Added Files: LexT.h Log Message: egg --- NEW FILE: LexT.h --- #ifndef p_UTIL_LEXT_HPP_INCLUDED #define p_UTIL_LEXT_HPP_INCLUDED 1 //////////////////////////////////////////////////////////////////////// // LexT.hpp: the lext::LexT class //////////////////////////////////////////////////////////////////////// #include <string> #include <sstream> #include <map> namespace P { namespace Util { /** The functions in the Private namespace should not be used by client code. */ namespace Private { /** Lexically casts str to a value_type, returning errorVal if the conversion fails. TODO: implement the following suggestion from Kai Unger <kai...@ha...> (21 Sept 2004): When the cast is done, you should check if there are unread characters left. For example, casting "1.2this_definitly_is_not_a_number" to double will not result in returning the error value, because conversion of "1.2" to 1.2d succeeds and the rest of the string is ignored. */ template <typename value_type> value_type fromString( const std::string & str, const value_type & errorVal ) throw() { std::istringstream is( str ); if ( !is ) return errorVal; value_type foo = value_type(); if ( is >> foo ) return foo; return errorVal; } /** Returns a string representation of the given object, which must be ostreamble. */ template <typename value_type> std::string toString( const value_type & obj ) throw() { std::ostringstream os; os << std::fixed; os << obj; return os.str(); } /** Convenience/efficiency overload. */ inline std::string fromString( const std::string & str, const std::string & errorVal ) throw() { return str; } /** Convenience/efficiency overload. */ inline std::string fromString( const char *str, const char *errorVal ) throw() { return str; } /** Convenience/efficiency overload. */ inline std::string toString( const char *obj ) throw() { return obj; } /** Convenience/efficiency overload. */ inline std::string toString( const std::string & obj ) throw() { return obj; } } // end Private namespace /** LexT provides a really convenient way to lexically cast strings and other streamable types to/from each other. All parameterized types used by this type must be: - i/o streamable. The operators must complement each other. - Assignable. - Default Constructable. This type is fairly light-weight, with only one std::string data member, so it should copy quickly and implicitely use std::string's CoW and reference counting features. Adding reference counting to this class would be of no benefit, and would probably hurt performance, considering that std::string's are optimized in these ways, and this type is simply a proxy for a std::string. For some uses the LexT type can replace the requirement for returning a proxy type from a type's operator[](), as discussed in Scott Meyers' <em>More Effective C++</em>, Item 30. This class originally was such a proxy, and then evolved into a generic solution for POD-based types, which inherently also covers most i/ostreamable types. It is less efficient than specialized proxies for, e.g. (char &), but it is also extremely easy to use, as shown here: <pre> LexT lex = 17; int bogo = lex; ulong bogol = bogo * static_cast<long>(lex); lex = "bogus string"; typedef std::map<LexT,LexT> LMap; LMap map; map[4] = "one"; map["one"] = 4; map[123] = "eat this"; map['x'] = "marks the spot"; map["fred"] = 94.3 * static_cast<double>( map["one"] ); map["fred"] = 10 * static_cast<double>( map["fred"] ); map["123"] = "this was re-set"; int myint = map["one"]; </pre> Finally, Perl-ish type flexibility in C++. :) It gets better: if we're using s11n, we can now save and load these objects at will: <pre> s11nlite::save( map, "somefile.s11n" ); ... LMap * map = s11nlite::load_serializable<LMap>( "somefile.s11n" ); </pre> If s11n is detected by this header it will automatically register a serialization proxy with s11n. See the end of this header file for the exact registration code. This software is released into the Public Domain by it's author, stephan beal (st...@s1...). Change history: 25 Dec 2004: - Ported into the P::Classes tree. Renamed the class and some functions for P's naming conventions. 25 Nov 2004: - Minor doc updates. - Changed multiple-include guard to allow inclusion of this file twice for purposes of registering LexT with s11n. Before, this header must have been included AFTER including s11n to pick up the registration. Now including this header after including s11n is safe if it has previously been included (and thus didn't pick up s11n registration). 2 Oct 2004: - Accomodated recent changes in libs11n. 22 Aug 2004: - Added ambiguity-buster overloads for operator==() for (const char *) and std::string. 20 Aug 2004: - Added LexT::empty() - Moved LexT::operator==() to a free function. - Added LexT::operator=(const char *) (see API notes for why). 17 Aug 2004: - Initial release. - After-relase: - Added more docs. - Added std::string and (const char *) overloads, to avoid some ambiguities. 16 Aug 2004: - Zen Coding Session. */ struct LexT { /** Constructs an empty object. Calling <code>castTo<T>()</code> on an un-populated LexT object will return T(). */ LexT() throw(){} ~LexT() throw() {} /** Lexically casts f to a string. */ template <typename FromT> LexT( const FromT & f ) throw() { this->m_data = Private::toString( f ); } /** Efficiency overload. */ LexT( const std::string & f ) throw() : m_data(f) { } /** See operator=(const char *) for a note about why this exists. */ LexT( const char * str ) throw() : m_data(str?str:"") { } /** Copies rhs's data to this object. */ LexT( const LexT & rhs ) throw() : m_data(rhs.m_data) { } /** Returns (this-<str() < rhs.str()). */ inline bool operator<( const LexT & rhs ) const { return this->str() < rhs.str(); } /** Returns (this-<str() > rhs.str()). */ inline bool operator>( const LexT & rhs ) const { return this->str() > rhs.str(); } /** Copies rhs's data and returns this object. */ inline LexT & operator=( const LexT & rhs ) throw() { if( &rhs != this ) this->m_data = rhs.m_data; return *this; } /** This overload exists to keep the compiler/linker from generating a new instantiation of this function for each differently-lengthed (const char *) which is assigned to a LexT. */ inline LexT & operator=( const char * rhs ) throw() { this->m_data = rhs ? rhs : ""; return *this; } /** lexically casts str() to a ToType, returning dflt if the cast fails. When calling this function you may need to use the following syntax to avoid compile errors: Foo foo = lex.template castTo<Foo>(); (It's weird, i know, and the first time i saw it, finding the solution to took me days. (Thank you, Nicolai Josuttis!)) However, in normal usage you won't need to use this function, as the generic type conversion operator does the exact same thing: <pre> LexT lex = 17; int foo = lex; </pre> */ template <typename ToType> ToType castTo( const ToType & dflt = ToType() ) const throw() { return Private::fromString( this->m_data, dflt ); } /** i used to LOVE C++... After writing this function i WORSHIP C++. The grace with which C++ handles this is pure magic, my friends. 16.8.2004 ----- stephan */ template <typename ToType> inline operator ToType() const throw() { return this->template castTo<ToType>(); } /** Overload to avoid ambiguity in some cases. */ inline operator std::string () const throw() { return this->str(); } /** Returns the same as str(). */ operator std::string & () throw() { return this->m_data; } /** Returns the same as str(). */ operator const std::string & () const throw() { return this->m_data; } /** Overload to avoid ambiguity in some cases. Useful for mixing C and C++ APIs: <pre> LexT arg = "USER"; LexT user = ::getenv(arg); </pre> */ inline operator const char * () const throw() { return this->str().c_str(); } /** Sets this object's value and returns this object. */ template <typename ToType> inline LexT & operator=( const ToType & f ) throw() { this->m_data = Private::toString( f ); return *this; } /** Returns a reference to this object's raw string data. */ inline std::string & str() throw() { return this->m_data; } /** Returns a const reference to this object's raw string data. */ inline const std::string & str() const throw() { return this->m_data; } /** Returns true if this object contains no data, else false. */ inline bool empty() const { return this->m_data.empty(); } private: std::string m_data; }; /** Copies a.str() to os. */ inline std::ostream & operator<<( std::ostream & os, const LexT & a ) { return os << a.str(); } /** Reads from the input stream, appending to a.str() until the stream gives up. If the implementation of this function seems "wrong" to you, please read the justification in this paper: http://s11n.net/papers/lexically_casting.html */ inline std::istream & operator>>( std::istream & is, LexT & a ) { while( std::getline( is, a.str() ).good() ); return is; } /** Casts lhs to a T object and returns true only if that object compares as equal to rhs. */ template <typename T> inline bool operator==( const LexT & lhs, const T & rhs ) { return lhs.template castTo<T>() == rhs; } /** Returns lhs.str() == rhs.str(). */ inline bool operator==( const LexT & lhs, const LexT & rhs ) { return lhs.str() == rhs.str(); } /** Avoid an ambiguity... If rhs == 0 then this function returns true if lhs.empty(). */ inline bool operator==( const LexT & lhs, const char * rhs ) { if( ! rhs ) return lhs.empty(); return lhs.str() == std::string(rhs); } /** Avoid an ambiguity... */ inline bool operator==( const LexT & lhs, const std::string & rhs ) { return lhs.str() == rhs; } } } // namespace P::Util #endif // p_UTIL_LEXT_HPP_INCLUDED //////////////////////////////////////////////////////////////////////// #ifdef s11n_S11N_INCLUDED // <--- that macro was added in s11n 0.9.7 # ifndef p_UTIL_LEXT_REGISTERED_WITH_S11N # define p_UTIL_LEXT_REGISTERED_WITH_S11N 1 // We have s11n! Let's use it! // Plug in a proxy for LexT, to make it work like a Streamable... # include <s11n.net/s11n/data_node_functor.hpp> // <-- s11n::streamable_type_serialization_proxy class # include <s11n.net/s11n/pods_streamable.hpp> // <-- required for s11n 0.9.14+ # define S11N_TYPE lext::LexT // <-- type of object to be treated as a Serializable # define S11N_TYPE_NAME "LexT" // <-- class name (for the classloader) # define S11N_SERIALIZE_FUNCTOR ::s11n::streamable_type_serialization_proxy // ^^^^ our de/s11n implementation (proxy functor) # include <s11n.net/s11n/reg_serializable_traits.hpp> // <-- register the above data with s11n # endif // p_UTIL_LEXT_REGISTERED_WITH_S11N #endif // s11n_S11N_INCLUDED //////////////////////////////////////////////////////////////////////// |
From: stephan b. <sg...@us...> - 2004-12-25 00:21:24
|
Update of /cvsroot/pclasses/pclasses2/src/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22229/src/System Modified Files: SharedLib.dyld.cpp SharedLib.shl.cpp SharedLib.win32.cpp Log Message: Removed the auto-appending of the default SO extension, analog to the removal in the dl/ltdl-based SharedLibs. Index: SharedLib.dyld.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/System/SharedLib.dyld.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- SharedLib.dyld.cpp 23 Dec 2004 21:50:44 -0000 1.3 +++ SharedLib.dyld.cpp 25 Dec 2004 00:21:13 -0000 1.4 @@ -22,10 +22,8 @@ #include <mach-o/dyld.h> -#ifdef PCLASSES_WITH_STL -# include <string> -# include <sstream> -#endif +#include <string> +#include <sstream> namespace P { @@ -49,40 +47,38 @@ SharedLib::SharedLib(const Unicode::String& name, BindMode mode) throw(SystemError) { - Unicode::String realName = name; - realName.append(".dyld"); +// Unicode::String realName = name; +// realName.append(".dyld"); int flags = BindMode2Flags(mode) | NSLINKMODULE_OPTION_RETURN_ON_ERROR; NSObjectFileImage file; NSObjectFileImageReturnCode ret; - ret = NSCreateObjectFileImageFromFile(realName.utf8(), &file); + ret = NSCreateObjectFileImageFromFile(name.utf8(), &file); if(ret != NSObjectFileImageSuccess) throw SystemError(0, "Could not load shared library", P_SOURCEINFO); - NSModule out = NSLinkModule(file, realName.utf8(), flags); + NSModule out = NSLinkModule(file, name.utf8(), flags); _handle = (unsigned long)out; } -#ifndef PCLASSES_WITH_STL SharedLib::SharedLib(const std::string& name, BindMode mode) throw(SystemError) { - std::ostringstream realName; - realName << name; - realName << ".dyld"; +// std::ostringstream realName; +// realName << name; +// realName << ".dyld"; int flags = BindMode2Flags(mode) | NSLINKMODULE_OPTION_RETURN_ON_ERROR; NSObjectFileImage file; NSObjectFileImageReturnCode ret; - ret = NSCreateObjectFileImageFromFile(realName.c_str(), &file); + ret = NSCreateObjectFileImageFromFile(name.c_str(), &file); if(ret != NSObjectFileImageSuccess) throw SystemError(0, "Could not load shared library", P_SOURCEINFO); - NSModule out = NSLinkModule(file, realName.c_str(), flags); + NSModule out = NSLinkModule(file, name.c_str(), flags); _handle = (unsigned long)out; } -#endif SharedLib::~SharedLib() throw() { Index: SharedLib.win32.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/System/SharedLib.win32.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- SharedLib.win32.cpp 23 Dec 2004 21:50:44 -0000 1.3 +++ SharedLib.win32.cpp 25 Dec 2004 00:21:13 -0000 1.4 @@ -21,10 +21,8 @@ #include "pclasses/System/SharedLib.h" #include <windows.h> -#ifdef PCLASSES_WITH_STL -# include <string> -# include <sstream> -#endif +#include <string> +#include <sstream> namespace P { @@ -32,27 +30,25 @@ SharedLib::SharedLib(const Unicode::String& name, BindMode mode) throw(SystemError) { - Unicode::String realName = name; - realName.append(".dll"); +// Unicode::String realName = name; +// realName.append(".dll"); - //@fixme _handle = (unsigned long)LoadLibrary(name); + _handle = (unsigned long)LoadLibrary(name); if(!_handle) throw SystemError(GetLastError(), "Could not load shared library", P_SOURCEINFO); } -#ifndef PCLASSES_WITH_STL SharedLib::SharedLib(const std::string& name, BindMode mode) throw(SystemError) { - std::ostringstream realName; - realName << name; - realName << ".dll"; +// std::ostringstream realName; +// realName << name; +// realName << ".dll"; - _handle = (unsigned long)LoadLibrary(realName.c_str()); + _handle = (unsigned long)LoadLibrary(name.c_str()); if(!_handle) throw SystemError(GetLastError(), "Could not load shared library", P_SOURCEINFO); } -#endif SharedLib::~SharedLib() throw() { Index: SharedLib.shl.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/System/SharedLib.shl.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- SharedLib.shl.cpp 23 Dec 2004 21:50:44 -0000 1.3 +++ SharedLib.shl.cpp 25 Dec 2004 00:21:13 -0000 1.4 @@ -23,10 +23,8 @@ #include <dl.h> #include <errno.h> -#ifdef PCLASSES_WITH_STL -# include <string> -# include <sstream> -#endif +#include <string> +#include <sstream> namespace P { @@ -51,31 +49,29 @@ SharedLib::SharedLib(const Unicode::String& name, BindMode mode) throw(SystemError) { - Unicode::String realName = name; - realName.append(".sl"); +// Unicode::String realName = name; +// realName.append(".sl"); - _handle = (unsigned long)shl_load(realName.utf8(), BindMode2Flags(mode)); + _handle = (unsigned long)shl_load(name.utf8(), BindMode2Flags(mode)); //@fixme dlerror() on hpux ?? if(!_handle) throw SystemError(errno, dlerror(), P_SOURCEINFO); } -#ifndef PCLASSES_WITH_STL SharedLib::SharedLib(const std::string& name, BindMode mode) throw(SystemError) { - std::ostringstream realName; - realName << name; - realName << ".sl"; +// std::ostringstream realName; +// realName << name; +// realName << ".sl"; - _handle = (unsigned long)shl_load(realName.str().c_str(), + _handle = (unsigned long)shl_load(name.str().c_str(), BindMode2Flags(mode)); //@fixme dlerror() on hpux ?? if(!_handle) throw SystemError(errno, dlerror(), P_SOURCEINFO); } -#endif SharedLib::~SharedLib() throw() { |
From: stephan b. <sg...@us...> - 2004-12-25 00:13:40
|
Update of /cvsroot/pclasses/pclasses2/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20575/test Modified Files: Makefile.toc Log Message: Added CType.cpp, FactoryTest.h. Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/test/Makefile.toc,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Makefile.toc 24 Dec 2004 23:06:28 -0000 1.4 +++ Makefile.toc 25 Dec 2004 00:13:31 -0000 1.5 @@ -1,11 +1,13 @@ #!/usr/bin/make -f include toc.make -HEADERS = Test.h +HEADERS = Test.h \ + FactoryTest.h DIST_FILES += $(HEADERS) SOURCES = \ + CType.cpp \ FactoryTest.cpp \ IntTypeTest.cpp \ ListTest.cpp \ @@ -14,9 +16,10 @@ StackTest.cpp \ ThreadTest.cpp -DIST_FILES += $(SOURCES) +DIST_FILES += $(SOURCES) $(HEADERS) -OBJECTS = IntTypeTest.o \ +OBJECTS = \ + IntTypeTest.o \ ListTest.o \ PtrTest.o \ QueueTest.o \ |
From: stephan b. <sg...@us...> - 2004-12-25 00:13:03
|
Update of /cvsroot/pclasses/pclasses2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20433 Modified Files: toc.pclasses2.make.at Log Message: Added -rdynamic to ldflags for tests, otherwise dynamic loading no workie. Index: toc.pclasses2.make.at =================================================================== RCS file: /cvsroot/pclasses/pclasses2/toc.pclasses2.make.at,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- toc.pclasses2.make.at 24 Dec 2004 23:06:25 -0000 1.4 +++ toc.pclasses2.make.at 25 Dec 2004 00:12:53 -0000 1.5 @@ -30,7 +30,7 @@ #################################################################################### # Linker args for in-build-tree tests, so they can link back to the in-tree # shared libs easily... -LIBP_TESTS_LDADD = $(P_BACKLINK_LDADD) -L$(top_srcdir)/lib $(LIBPCORE_CLIENT_LDADD) +LIBP_TESTS_LDADD = -rdynamic $(P_BACKLINK_LDADD) -L$(top_srcdir)/lib $(LIBPCORE_CLIENT_LDADD) ######################################################################## # Huge kludge to shut up make: |
From: stephan b. <sg...@us...> - 2004-12-25 00:11:59
|
Update of /cvsroot/pclasses/pclasses2/src/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20210/src/System Modified Files: SharedLib.ltdl.cpp Log Message: symbol fetching now throws when passed 0. Switched to std::string form of RunTimeError ctor. Index: SharedLib.ltdl.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/System/SharedLib.ltdl.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- SharedLib.ltdl.cpp 24 Dec 2004 23:03:40 -0000 1.3 +++ SharedLib.ltdl.cpp 25 Dec 2004 00:11:49 -0000 1.4 @@ -105,6 +105,10 @@ void* SharedLib::operator[](const char* symbol) throw(RuntimeError) { + if( ! symbol ) + { + throw RuntimeError( "Invalid symbol (null).", P_SOURCEINFO ); + } lt_handle_map_t::iterator it = lt_handle_map().find( _handle ); if( lt_handle_map().end() == it ) { @@ -114,9 +118,10 @@ void* addr = lt_dlsym( lth, symbol); if(!addr) { - std::ostringstream os; - os << "Symbol '"<<symbol<<"' not found in shared library."; - throw RuntimeError(os.str().c_str(), P_SOURCEINFO); + std::ostringstream os; + os << "Symbol '"<<symbol<<"' not found in shared library."; + throw RuntimeError(os.str(), P_SOURCEINFO); +// throw RuntimeError("Symbol not found in SharedLib.", P_SOURCEINFO); } return addr; |
From: stephan b. <sg...@us...> - 2004-12-25 00:10:25
|
Update of /cvsroot/pclasses/pclasses2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19920 Modified Files: configure.pclasses2 Log Message: Re-enabled libltdl. Index: configure.pclasses2 =================================================================== RCS file: /cvsroot/pclasses/pclasses2/configure.pclasses2,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- configure.pclasses2 24 Dec 2004 23:06:25 -0000 1.7 +++ configure.pclasses2 25 Dec 2004 00:10:15 -0000 1.8 @@ -24,8 +24,8 @@ # reminder: need to add SharedLib.ltdl.cpp -# toc_test libltdl || toc_test_require libdl # prefer ltdl, else allow dl. -toc_test_require libdl +toc_test libltdl || toc_test_require libdl # prefer ltdl, else allow dl. +# toc_test_require libdl ############################################################ |
From: stephan b. <sg...@us...> - 2004-12-25 00:07:40
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/Plugin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19350/include/pclasses/Plugin Modified Files: Plugin.h Log Message: Fixed a compile error in previously-uninstantiated template code. Index: Plugin.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Plugin/Plugin.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Plugin.h 24 Dec 2004 23:05:33 -0000 1.2 +++ Plugin.h 25 Dec 2004 00:07:30 -0000 1.3 @@ -254,9 +254,9 @@ */ template <typename T> ::P::System::SharedLib * - addPlugin( const std::string & ) throw(RuntimeError) + addPlugin( const std::string & pluginname ) throw(RuntimeError) { - return pluginManager<T>().addPlugin( p ); + return pluginManager<T>().addPlugin( pluginname ); } |
From: stephan b. <sg...@us...> - 2004-12-25 00:06:11
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19040/include/pclasses/System Modified Files: Mime.h Log Message: Changed the sharing context to FactoryContext, for consistency with the other factories. Index: Mime.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/System/Mime.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Mime.h 24 Dec 2004 16:23:24 -0000 1.6 +++ Mime.h 25 Dec 2004 00:06:01 -0000 1.7 @@ -92,8 +92,10 @@ //! MIME type database /*! The class is used as an application wide MIME type registry. + \author Christian Prochnow <cp...@se...> \author stephan beal <st...@s1...> + \ingroup System */ class /* PIO_EXPORT */ MimeTypeDb @@ -294,7 +296,7 @@ namespace System { template <typename InterfaceT> - class MimeHandlerFactory : public ::P::Factory< InterfaceT, MimeType,::P::Sharing::MimeContext > + class MimeHandlerFactory : public ::P::Factory< InterfaceT, MimeType, ::P::Sharing::FactoryContext > { }; |
From: stephan b. <sg...@us...> - 2004-12-25 00:04:48
|
Update of /cvsroot/pclasses/pclasses2/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18687/src Modified Files: Exception.cpp Log Message: Added std::string overloads on the Error ctors. Index: Exception.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/Exception.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Exception.cpp 24 Dec 2004 23:01:35 -0000 1.5 +++ Exception.cpp 25 Dec 2004 00:04:38 -0000 1.6 @@ -23,12 +23,12 @@ namespace P { Exception::Exception(const char* what, const SourceInfo& si) throw() - : _what(what?what:""), _source(&si), _where() + : _what(what?what:""), _source(&si), _where("") { } Exception::Exception(const std::string & what, const SourceInfo& si) throw() - : _what(what), _source(&si), _where() + : _what(what), _source(&si), _where("") { } @@ -94,6 +94,11 @@ { } +RuntimeError::RuntimeError(const std::string & what, const SourceInfo& si) throw() +: Exception(what, si) +{ +} + RuntimeError::~RuntimeError() throw() { } @@ -103,6 +108,10 @@ : RuntimeError(what, si) { } +OutOfBounds::OutOfBounds(const std::string & what, const SourceInfo& si) throw() +: RuntimeError(what, si) +{ +} OutOfBounds::~OutOfBounds() throw() { @@ -113,6 +122,10 @@ : RuntimeError(what, si) { } +OverrunError::OverrunError(const std::string & what, const SourceInfo& si) throw() +: RuntimeError(what, si) +{ +} OverrunError::~OverrunError() throw() { @@ -123,6 +136,10 @@ : RuntimeError(what, si) { } +UnderrunError::UnderrunError(const std::string & what, const SourceInfo& si) throw() +: RuntimeError(what, si) +{ +} UnderrunError::~UnderrunError() throw() { @@ -133,6 +150,10 @@ : RuntimeError(what, si) { } +OverflowError::OverflowError(const std::string & what, const SourceInfo& si) throw() +: RuntimeError(what, si) +{ +} OverflowError::~OverflowError() throw() { |
From: stephan b. <sg...@us...> - 2004-12-25 00:04:48
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18687/include/pclasses Modified Files: Exception.h Log Message: Added std::string overloads on the Error ctors. Index: Exception.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Exception.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Exception.h 24 Dec 2004 17:16:57 -0000 1.3 +++ Exception.h 25 Dec 2004 00:04:37 -0000 1.4 @@ -76,6 +76,7 @@ class LogicError: public Exception { public: LogicError(const char* what, const SourceInfo& si) throw(); + LogicError(const std::string & what, const SourceInfo& si) throw(); ~LogicError() throw(); }; @@ -83,30 +84,36 @@ class RuntimeError: public Exception { public: RuntimeError(const char* what, const SourceInfo& si) throw(); + RuntimeError(const std::string & what, const SourceInfo& si) throw(); ~RuntimeError() throw(); }; class OverrunError: public RuntimeError { public: OverrunError(const char* what, const SourceInfo& si) throw(); + OverrunError(const std::string & what, const SourceInfo& si) throw(); ~OverrunError() throw(); }; class UnderrunError: public RuntimeError { public: UnderrunError(const char* what, const SourceInfo& si) throw(); + UnderrunError(const std::string & what, const SourceInfo& si) throw(); + ~UnderrunError() throw(); }; class OutOfBounds: public RuntimeError { public: OutOfBounds(const char* what, const SourceInfo& si) throw(); + OutOfBounds(const std::string & what, const SourceInfo& si) throw(); ~OutOfBounds() throw(); }; class OverflowError: public RuntimeError { public: OverflowError(const char* what, const SourceInfo& si) throw(); + OverflowError(const std::string & what, const SourceInfo& si) throw(); ~OverflowError() throw(); }; |
From: stephan b. <sg...@us...> - 2004-12-24 23:26:48
|
Update of /cvsroot/pclasses/pclasses2/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11982/test Modified Files: FactoryTest.cpp Log Message: Now demonstrates loading a plugin to get at multiple classes. Index: FactoryTest.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/test/FactoryTest.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- FactoryTest.cpp 24 Dec 2004 23:06:27 -0000 1.4 +++ FactoryTest.cpp 24 Dec 2004 23:26:40 -0000 1.5 @@ -21,7 +21,7 @@ TheBase * a = 0; -#define CLOAD(CN) a = P::CL::classload<TheBase>( CN ); \ +#define CLOAD(CN) a = P::NamedTypeFactory<TheBase>::instance().create( CN ); \ CERR << CN << " classload()ed? == " << a << "\n"; \ if( a ) CERR << "classname="<<a->classname()<<"\n"; \ delete( a ); a = 0; @@ -42,7 +42,8 @@ try { - pm.addPlugin( "CType" ); + ::P::System::SharedLib * sh = pm.addPlugin( "CType" ); + CERR << "CType lib = " << sh << "\n"; // throw P::Exception( "Foo!", P_SOURCEINFO ); } catch( const ::P::Exception & ex ) @@ -50,10 +51,11 @@ CERR << "Exception:\n"<<ex.where()<<"\n"<<ex.what()<<"\n"; } + LOAD("CType"); + LOAD("XtraType"); LOAD("TheBase"); LOAD("AType"); LOAD("BType"); - LOAD("CType"); LOAD("NoType"); return 0; |
From: stephan b. <sg...@us...> - 2004-12-24 23:26:04
|
Update of /cvsroot/pclasses/pclasses2/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11835/test Added Files: CType.cpp FactoryTest.h Log Message: egg --- NEW FILE: FactoryTest.h --- #ifndef ptest_FACTORYTEST_HPP_INCLUDED #define ptest_FACTORYTEST_HPP_INCLUDED 1 //////////////////////////////////////////////////////////////////////// // Demonstration classes for FactoryTest. //////////////////////////////////////////////////////////////////////// #ifndef CERR #define CERR std::cerr << __FILE__ << ":" << std::dec << __LINE__ << " : " #endif #include <pclasses/Factory.h> struct TheBase { virtual ~TheBase() {} virtual std::string classname() const = 0; }; #endif // ptest_FACTORYTEST_HPP_INCLUDED --- NEW FILE: CType.cpp --- #include "FactoryTest.h" struct AType : public TheBase { AType() { CERR << "AType()\n"; } virtual ~AType() { CERR << "~AType()\n"; } virtual std::string classname() const { return "AType"; } }; struct BType : public AType { BType() { CERR << "BType()\n"; } virtual ~BType() { CERR << "~BType()\n"; } virtual std::string classname() const { return "BType"; } }; #define PFACREG_TYPE AType #define PFACREG_TYPE_INTERFACE TheBase // #define PFACREG_TYPE_IS_ABSTRACT // define to install a null factory for AType #define PFACREG_TYPE_NAME "AType" #include <pclasses/FactoryReg.h> #define PFACREG_TYPE BType #define PFACREG_TYPE_INTERFACE TheBase #define PFACREG_TYPE_NAME "BType" #include <pclasses/FactoryReg.h> struct CType : public BType { CType() { CERR << "CType()\n"; } virtual ~CType() { CERR << "~CType()\n"; } virtual std::string classname() const { return "CType"; } }; TheBase * new_CType() { return new CType; } void CType_bogo_init() { CERR << "CType_bogo_init()\n"; ::P::NamedTypeFactory<TheBase>::instance().registerFactory( "XtraType", new_CType ); } int CType_bogo_init_placeholder = ( CType_bogo_init(), 0 ); #define PFACREG_TYPE CType #define PFACREG_TYPE_INTERFACE TheBase #define PFACREG_TYPE_NAME "CType" #include <pclasses/FactoryReg.h> |
From: stephan b. <sg...@us...> - 2004-12-24 23:07:19
|
Update of /cvsroot/pclasses/pclasses2/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8275/lib Added Files: Makefile.toc Log Message: egg --- NEW FILE: Makefile.toc --- #!/usr/bin/make -f # This dir holds symlinks to the various P libs, to ease linking of test/client # apps within this source tree. include toc.make top_abs=$(shell cd $(top_srcdir); echo $$PWD) plibp=$(top_abs)/src/ ############# P Module libs: pliblist = $(addprefix $(plibp), \ libpclasses_core \ System/libpclasses_system \ Net/libpclasses_net \ IO/libpclasses_io \ Unicode/libpclasses_unicode \ Util/libpclasses_util \ ) pliblist := $(addsuffix .so*,$(pliblist)) SYM_LIST = $(pliblist) symlink-libs: @for rn in $(SYM_LIST); do \ fn="$${rn##*/}"; \ test -L $$fn -a $$rn -ef "$$fn" && continue; \ test -L $$fn && rm $$fn; \ echo "Symlinking $$rn..."; \ ln -s $$rn .; \ done CLEAN_FILES += $(shell for i in *; do test -L $$i || continue; echo $$i; done) all: symlink-libs |
From: stephan b. <sg...@us...> - 2004-12-24 23:07:06
|
Update of /cvsroot/pclasses/pclasses2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8043 Modified Files: Makefile.toc configure.pclasses2 toc.pclasses2.make.at Log Message: Mass commit: build fixes. Can now build tests using proper configure steps, at least on linux systems. Index: toc.pclasses2.make.at =================================================================== RCS file: /cvsroot/pclasses/pclasses2/toc.pclasses2.make.at,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- toc.pclasses2.make.at 24 Dec 2004 12:44:00 -0000 1.3 +++ toc.pclasses2.make.at 24 Dec 2004 23:06:25 -0000 1.4 @@ -3,13 +3,40 @@ CLEAN_FILES += $(wildcard *.o *~) + +INCLUDES += -I$(top_srcdir)/include -I$(top_srcdir)/include/pclasses $(PACKAGE_INCLUDES) + # CXXFLAGS += -fPIC ifneq (,$(wildcard Makefile.am)) DIST_FILES += Makefile.am endif -INSTALL_PACKAGE_HEADERS_DEST = $(prefix)/include/pclasses +######################################################################## +INSTALL_PACKAGE_HEADERS_BASE = $(prefix)/include/pclasses +INSTALL_PACKAGE_HEADERS_DEST = $(INSTALL_PACKAGE_HEADERS_BASE) +# ^^^^ modules must override this to: +# INSTALL_PACKAGE_HEADERS_DEST = $(INSTALL_PACKAGE_HEADERS_BASE)/ModuleName +######################################################################## -INCLUDES += -I$(top_srcdir)/include -I$(top_srcdir)/include/pclasses $(PACKAGE_INCLUDES) +######################################################################## +# P_BACKLINK_LDADD is for use by in-tree libs which need a -L arg +# to link back to other in-tree libs. +P_BACKLINK_LDADD = -L$(top_srcdir)/lib \ + -L$(top_srcdir)/src \ + $(addprefix -L$(top_srcdir)/src/,System Util Unicode IO Net) + +#################################################################################### +# Linker args for in-build-tree tests, so they can link back to the in-tree +# shared libs easily... +LIBP_TESTS_LDADD = $(P_BACKLINK_LDADD) -L$(top_srcdir)/lib $(LIBPCORE_CLIENT_LDADD) + +######################################################################## +# Huge kludge to shut up make: +-l$(LIBPCORE_BASENAME): +-l$(LIBPNET_BASENAME): +-l$(LIBPIO_BASENAME): +-l$(LIBPUNICODE_BASENAME): +-l$(LIBPSYSTEM_BASENAME): +-l$(LIBPUTIL_BASENAME): Index: configure.pclasses2 =================================================================== RCS file: /cvsroot/pclasses/pclasses2/configure.pclasses2,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- configure.pclasses2 24 Dec 2004 12:44:00 -0000 1.6 +++ configure.pclasses2 24 Dec 2004 23:06:25 -0000 1.7 @@ -24,9 +24,8 @@ # reminder: need to add SharedLib.ltdl.cpp -toc_test libltdl || toc_test_require libdl # prefer ltdl, else allow dl. -# toc_test_require libdl -ldadd="${ldadd} ${LDADD_DL}" +# toc_test libltdl || toc_test_require libdl # prefer ltdl, else allow dl. +toc_test_require libdl ############################################################ @@ -119,6 +118,9 @@ done rm sizes +toc_export LDADD_SHM="-lrt" + + cat <<EOF > /dev/null the following defs needs to be ported to toc: PTHREAD_CREATE_JOINABLE @@ -150,55 +152,61 @@ ######################################################################## # For each module, define: # -# LIBPxxx_NAME = the DLL file's name +# LIBPxxx_BASENAME = the DLL file's name # LIBPxxx_LDADD/INCLUDES = the linker/includes flags needed to build -# LIBPxxx_NAME -# LIBPxxx_CLIENT_LDADD = linker args for clients of LIBPxxx_NAME. +# LIBPxxx_BASENAME +# The INCLUDES will also be used by clients. +# LIBPxxx_CLIENT_LDADD = linker args for clients of LIBPxxx_BASENAME. ######################################################################## -toc_export LIBPCORE_NAME=libpclasses_core -toc_export LIBPCORE_LDADD="-l${LIBCORE_NAME}" -toc_export LIBPCORE_CLIENT_LDADD="${ldadd}" +toc_export LIBPCORE_BASENAME=pclasses_core +toc_export LIBPCORE_LDADD="" +toc_export LIBPCORE_CLIENT_LDADD="-l${LIBPCORE_BASENAME}" toc_export LIBPCORE_CFLAGS="${inc}" -toc_export LIBPNET_NAME=libpclasses_net -toc_export LIBPNET_LDADD="-l${LIBPNET_NAME}" -toc_export LIBPNET_CLIENT_LDADD="${ldadd}" -toc_export LIBPNET_CFLAGS="${inc}" +toc_export LIBPNET_BASENAME=pclasses_net +toc_export LIBPNET_LDADD="" +toc_export LIBPNET_CLIENT_LDADD="-l${LIBPNET_BASENAME}" +toc_export LIBPNET_CFLAGS="" -toc_export LIBPIO_NAME=libpclasses_io -toc_export LIBPIO_LDADD="-l${LIBPIO_NAME}" -toc_export LIBPIO_CLIENT_LDADD="${ldadd}" +toc_export LIBPIO_BASENAME=pclasses_io +toc_export LIBPIO_LDADD="${LIBPCORE_CLIENT_LDADD}" +toc_export LIBPIO_CLIENT_LDADD="-l${LIBPIO_BASENAME}" toc_export LIBPIO_CFLAGS="${inc}" -toc_export LIBPUNICODE_NAME=libpclasses_unicode -toc_export LIBPUNICODE_LDADD="-l${LIBPUNICODE_NAME}" -toc_export LIBPUNICODE_CLIENT_LDADD="${ldadd}" +toc_export LIBPUNICODE_BASENAME=pclasses_unicode +toc_export LIBPUNICODE_LDADD="${LIBPCORE_CLIENT_LDADD}" # ${LIBPIO_CLIENT_LDADD} circular dep +toc_export LIBPUNICODE_CLIENT_LDADD="-l${LIBPUNICODE_BASENAME}" toc_export LIBPUNICODE_CFLAGS="${inc}" -toc_export LIBPSYSTEM_NAME=libpclasses_system -toc_export LIBPSYSTEM_LDADD="-l${LIBPSYSTEM_NAME}" -toc_export LIBPSYSTEM_CLIENT_LDADD="${THREADS_CFLAGS}" +toc_export LIBPSYSTEM_BASENAME=pclasses_system +toc_export LIBPSYSTEM_LDADD="${THREADS_LDADD} ${LDADD_DL} ${LDADD_SHM}" +toc_export LIBPSYSTEM_CLIENT_LDADD="-l${LIBPSYSTEM_BASENAME} ${LIBPIO_CLIENT_LDADD} ${LIBPUNICODE_CLIENT_LDADD}" toc_export LIBPSYSTEM_CFLAGS="${THREADS_CFLAGS}" -toc_export LIBPUTIL_NAME=libpclasses_util -toc_export LIBPUTIL_LDADD="-l${LIBPUTIL_NAME_LDADD}" -toc_export LIBPUTIL_CLIENT_LDADD="${THREADS_LDADD}" +toc_export LIBPUTIL_BASENAME=pclasses_util +toc_export LIBPUTIL_LDADD="${THREADS_LDADD}" +toc_export LIBPUTIL_CLIENT_LDADD="-l${LIBPUTIL_BASENAME}" toc_export LIBPUTIL_CFLAGS="${THREADS_CFLAGS}" + ######################################################################## # Enable mysql driver... if test -x "${MYSQL_CONFIG_BIN}"; then toc_export LIBPSQL_HAVE_MYSQL=1 - toc_export LIBPSQL_MYSQL_LDADD="${ldadd} ${MYSQL_LIBS}" - toc_export LIBPSQL_MYSQL_CFLAGS="${inc} ${MYSQL_INCLUDES}" + toc_export LIBPSQL_MYSQL_LDADD="${MYSQL_LIBS}" + toc_export LIBPSQL_MYSQL_CFLAGS="${MYSQL_INCLUDES}" +else + toc_boldecho "Not building MySQL driver." fi ######################################################################## # Enable postgres driver... if test -x "${POSTGRES_CONFIG_BIN}"; then toc_export LIBPSQL_HAVE_POSTGRES=1 - toc_export LIBPSQL_POSTSQL_LDADD="${ldadd} ${POSTGRES_LIBS}" - toc_export LIBPSQL_POSTSQL_CFLAGS="${inc} ${POSTGRES_INCLUDES}" + toc_export LIBPSQL_POSTSQL_LDADD="${POSTGRES_LIBS}" + toc_export LIBPSQL_POSTSQL_CFLAGS="${POSTGRES_INCLUDES}" +else + toc_boldecho "Not building Postgres driver." fi @@ -209,10 +217,6 @@ # now exporting our files... ######################################################################## -toc_test_require atfilter_file \ - include/pclasses/pclasses-config.h.at \ - include/pclasses/pclasses-config.h - ######################################################################## toc_boldecho "======================= Creating Makefiles..." make_out=${PWD}/.toc.Makefile @@ -245,6 +249,11 @@ toc_boldecho "======================= ${TOC_EMOTICON_OKAY} Created Makefiles." ######################################################################## +toc_test_require atfilter_file \ + include/pclasses/pclasses-config.h.at \ + include/pclasses/pclasses-config.h + + ##### Create toc.make and end config process... this must come last. toc_test_require toc_project_makefile ######################################################################## Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/Makefile.toc,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Makefile.toc 24 Dec 2004 10:58:46 -0000 1.3 +++ Makefile.toc 24 Dec 2004 23:06:25 -0000 1.4 @@ -1,15 +1,13 @@ #!/usr/bin/make -f include toc.make -SUBDIRS = AT include m4 src templates test doc toc - -DIST_FILES += README \ +SUBDIRS = AT include m4 src lib test doc toc templates +DIST_FILES += COPYING.LIB COPYING README \ NEWS \ ChangeLog \ - autogen.sh \ + autogen.sh configure.in Makefile.am \ find_toc.sh \ - notes.txt \ toc.$(PACKAGE_NAME).make.at \ toc.$(PACKAGE_NAME).help \ - configure configure.in configure.toc configure.$(PACKAGE_NAME) + configure configure.toc configure.$(PACKAGE_NAME) all: subdirs |
From: stephan b. <sg...@us...> - 2004-12-24 23:06:54
|
Update of /cvsroot/pclasses/pclasses2/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8169/lib Log Message: Directory /cvsroot/pclasses/pclasses2/lib added to the repository |
From: stephan b. <sg...@us...> - 2004-12-24 23:06:41
|
Update of /cvsroot/pclasses/pclasses2/src/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8043/src/Util Modified Files: Makefile.toc Log Message: Mass commit: build fixes. Can now build tests using proper configure steps, at least on linux systems. Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/Util/Makefile.toc,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Makefile.toc 24 Dec 2004 12:44:02 -0000 1.4 +++ Makefile.toc 24 Dec 2004 23:06:27 -0000 1.5 @@ -23,7 +23,7 @@ INCLUDES += $(LIBPUTIL_INCLUDES) build_libs = 1 -LIBNAME = $(LIBPUTIL_NAME) +LIBNAME = lib$(LIBPUTIL_BASENAME) ifeq (1,$(build_libs)) STATIC_LIBS = $(LIBNAME) SHARED_LIBS = $(STATIC_LIBS) |
From: stephan b. <sg...@us...> - 2004-12-24 23:06:40
|
Update of /cvsroot/pclasses/pclasses2/src/Net In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8043/src/Net Modified Files: Makefile.toc Log Message: Mass commit: build fixes. Can now build tests using proper configure steps, at least on linux systems. Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/Net/Makefile.toc,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Makefile.toc 24 Dec 2004 12:44:02 -0000 1.4 +++ Makefile.toc 24 Dec 2004 23:06:26 -0000 1.5 @@ -21,7 +21,7 @@ CLEAN_FILES += $(OBJECTS) build_libs = 1 -LIBNAME = $(LIBPNET_NAME) +LIBNAME = lib$(LIBPNET_BASENAME) ifeq (1,$(build_libs)) STATIC_LIBS = $(LIBNAME) SHARED_LIBS = $(LIBNAME) |
From: stephan b. <sg...@us...> - 2004-12-24 23:06:39
|
Update of /cvsroot/pclasses/pclasses2/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8043/src Modified Files: Makefile.toc Log Message: Mass commit: build fixes. Can now build tests using proper configure steps, at least on linux systems. Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/Makefile.toc,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Makefile.toc 24 Dec 2004 12:44:01 -0000 1.6 +++ Makefile.toc 24 Dec 2004 23:06:26 -0000 1.7 @@ -2,7 +2,8 @@ include toc.make -SUBDIRS = Unicode System IO Util Net +SUBDIRS = Unicode IO System Util Net +# Plugins SOURCES = Alloc.cpp \ AtomicInt.gcc-x86.cpp \ @@ -18,7 +19,7 @@ CLEAN_FILES += $(OBJECTS) build_libs = 1 -LIBNAME = $(LIBPCORE_NAME) +LIBNAME = lib$(LIBPCORE_BASENAME) ifeq (1,$(build_libs)) STATIC_LIBS = $(LIBNAME) SHARED_LIBS = $(STATIC_LIBS) |
From: stephan b. <sg...@us...> - 2004-12-24 23:06:39
|
Update of /cvsroot/pclasses/pclasses2/toc/make In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8043/toc/make Modified Files: BIN_PROGRAMS.make toc.make.at Log Message: Mass commit: build fixes. Can now build tests using proper configure steps, at least on linux systems. Index: toc.make.at =================================================================== RCS file: /cvsroot/pclasses/pclasses2/toc/make/toc.make.at,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- toc.make.at 22 Dec 2004 19:04:24 -0000 1.1 +++ toc.make.at 24 Dec 2004 23:06:28 -0000 1.2 @@ -20,6 +20,12 @@ all: FORCE: ; @true +ifneq (,$(wildcard Makefile.toc)) + TOC_MAKEFILE_NAME = Makefile.toc +else + TOC_MAKEFILE_NAME = Makefile +endif + # try to save some grief later: .toc.%: $(wildcard *) Index: BIN_PROGRAMS.make =================================================================== RCS file: /cvsroot/pclasses/pclasses2/toc/make/BIN_PROGRAMS.make,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- BIN_PROGRAMS.make 22 Dec 2004 19:04:24 -0000 1.1 +++ BIN_PROGRAMS.make 24 Dec 2004 23:06:28 -0000 1.2 @@ -43,8 +43,8 @@ BIN_PROGRAMS_RULES_GENERATOR = $(TOC_MAKESDIR)/makerules.BIN_PROGRAMS -BIN_PROGRAMS_COMMON_DEPS += Makefile $(BIN_PROGRAMS_MAKEFILE) $(BIN_PROGRAMS_OBJECTS) -$(BIN_PROGRAMS_DEPSFILE): Makefile $(BIN_PROGRAMS_RULES_GENERATOR) $(BIN_PROGRAMS_MAKEFILE) +BIN_PROGRAMS_COMMON_DEPS += $(TOC_MAKEFILE_NAME) $(BIN_PROGRAMS_MAKEFILE) $(BIN_PROGRAMS_OBJECTS) +$(BIN_PROGRAMS_DEPSFILE): $(TOC_MAKEFILE_NAME) $(BIN_PROGRAMS_RULES_GENERATOR) $(BIN_PROGRAMS_MAKEFILE) ifeq (1,$(MAKING_CLEAN)) @echo "$(MAKECMDGOALS): skipping BIN_PROGRAMS rules generation." else |
From: stephan b. <sg...@us...> - 2004-12-24 23:06:39
|
Update of /cvsroot/pclasses/pclasses2/src/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8043/src/System Modified Files: Makefile.toc Log Message: Mass commit: build fixes. Can now build tests using proper configure steps, at least on linux systems. Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/System/Makefile.toc,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- Makefile.toc 24 Dec 2004 12:44:02 -0000 1.8 +++ Makefile.toc 24 Dec 2004 23:06:27 -0000 1.9 @@ -79,15 +79,18 @@ INCLUDES += $(LIBPSYSTEM_INCLUDES) LDADD += $(LIBPSYSTEM_LDADD) -LIBNAME = $(LIBPSYSTEM_NAME) +# $(warning LIBPSYSTEM_LDADD=$(LIBPSYSTEM_LDADD)) +LIBNAME = lib$(LIBPSYSTEM_BASENAME) build_libs = 1 ifeq (1,$(build_libs)) STATIC_LIBS = $(LIBNAME) SHARED_LIBS = $(STATIC_LIBS) +# SHARED_LIBS_LDADD = $(LIBPSYSTEM_LDADD) $(LIBNAME)_a_OBJECTS = $(OBJECTS) $(LIBNAME)_so_OBJECTS = $($(LIBNAME)_a_OBJECTS) $(LIBNAME)_so_VERSION = $(PACKAGE_VERSION) - # $(LIBNAME)_so_LDADD = $(LIBPSYSTEM_LDADD) + $(LIBNAME)_so_LDADD = $(P_BACKLINK_LDADD) $(LIBPSYSTEM_LDADD) +# $(warning $(LIBNAME)_so_LDADD = $($(LIBNAME)_so_LDADD)) include $(TOC_MAKESDIR)/SHARED_LIBS.make include $(TOC_MAKESDIR)/STATIC_LIBS.make # Run targets STATIC_LIBS and SHARED_LIBS build these. |
From: stephan b. <sg...@us...> - 2004-12-24 23:06:37
|
Update of /cvsroot/pclasses/pclasses2/src/Unicode In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8043/src/Unicode Modified Files: Makefile.toc Log Message: Mass commit: build fixes. Can now build tests using proper configure steps, at least on linux systems. Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/Unicode/Makefile.toc,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Makefile.toc 24 Dec 2004 12:44:02 -0000 1.4 +++ Makefile.toc 24 Dec 2004 23:06:27 -0000 1.5 @@ -18,13 +18,15 @@ CLEAN_FILES += $(OBJECTS) build_libs = 1 -LIBNAME = $(LIBPUNICODE_NAME) +LIBNAME = lib$(LIBPUNICODE_BASENAME) ifeq (1,$(build_libs)) STATIC_LIBS = $(LIBNAME) SHARED_LIBS = $(STATIC_LIBS) + SHARED_LIBS_LDADD = $(P_BACKLINK_LDADD) $(LIBPUNICODE_LDADD) $(LIBNAME)_a_OBJECTS = $(OBJECTS) $(LIBNAME)_so_OBJECTS = $($(LIBNAME)_a_OBJECTS) $(LIBNAME)_so_VERSION = $(PACKAGE_VERSION) +# $(LIBNAME)_so_LDADD = include $(TOC_MAKESDIR)/SHARED_LIBS.make include $(TOC_MAKESDIR)/STATIC_LIBS.make # Run targets STATIC_LIBS and SHARED_LIBS build these. |
From: stephan b. <sg...@us...> - 2004-12-24 23:06:37
|
Update of /cvsroot/pclasses/pclasses2/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8043/test Modified Files: FactoryTest.cpp Makefile.toc Log Message: Mass commit: build fixes. Can now build tests using proper configure steps, at least on linux systems. Index: FactoryTest.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/test/FactoryTest.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- FactoryTest.cpp 24 Dec 2004 19:26:41 -0000 1.3 +++ FactoryTest.cpp 24 Dec 2004 23:06:27 -0000 1.4 @@ -7,78 +7,11 @@ #include <string> #include <cassert> -#include <pclasses/Factory.h> -#include <pclasses/Plugin/Plugin.h> - - -#ifndef CERR -#define CERR std::cerr << __FILE__ << ":" << std::dec << __LINE__ << " : " -#endif - -struct TheBase -{ - - virtual ~TheBase() {} - virtual std::string classname() const = 0; -}; - -struct AType : public TheBase -{ - AType() - { - CERR << "AType()\n"; - } - virtual ~AType() - { - CERR << "~AType()\n"; - } - - virtual std::string classname() const { return "AType"; } - -}; - -struct BType : public AType -{ - BType() - { - CERR << "BType()\n"; - } - virtual ~BType() - { - CERR << "~BType()\n"; - } - virtual std::string classname() const { return "BType"; } -}; - -struct CType : public BType -{ - CType() - { - CERR << "CType()\n"; - } - virtual ~CType() - { - CERR << "~CType()\n"; - } - virtual std::string classname() const { return "CType"; } -}; +#include "FactoryTest.h" -#define PFACREG_TYPE AType -#define PFACREG_TYPE_INTERFACE TheBase -// #define PFACREG_TYPE_IS_ABSTRACT // define to install a null factory for AType -#define PFACREG_TYPE_NAME "AType" -#include <pclasses/FactoryReg.h> - -#define PFACREG_TYPE BType -#define PFACREG_TYPE_INTERFACE TheBase -#define PFACREG_TYPE_NAME "BType" -#include <pclasses/FactoryReg.h> +#include <pclasses/Plugin/Plugin.h> -#define PFACREG_TYPE CType -#define PFACREG_TYPE_INTERFACE TheBase -#define PFACREG_TYPE_NAME "CType" -#include <pclasses/FactoryReg.h> int main( int argc, char ** argv ) @@ -87,6 +20,7 @@ TheBase * a = 0; + #define CLOAD(CN) a = P::CL::classload<TheBase>( CN ); \ CERR << CN << " classload()ed? == " << a << "\n"; \ if( a ) CERR << "classname="<<a->classname()<<"\n"; \ @@ -94,15 +28,27 @@ /************************* Can't test until linking the libpclasses_xxx works. + *************************/ typedef P::Plugin::PluginManager<TheBase> PM; + PM & pm = PM::instance(); + #define PLOAD(CN) a = pm.create( CN ); \ CERR << CN << " plugin-create()ed? == " << a << "\n"; \ if( a ) CERR << "classname="<<a->classname()<<"\n"; \ delete( a ); a = 0; - *************************/ -#define LOAD(CN) CLOAD(CN) +#define LOAD(CN) CLOAD(CN); PLOAD(CN); + + try + { + pm.addPlugin( "CType" ); + // throw P::Exception( "Foo!", P_SOURCEINFO ); + } + catch( const ::P::Exception & ex ) + { + CERR << "Exception:\n"<<ex.where()<<"\n"<<ex.what()<<"\n"; + } LOAD("TheBase"); LOAD("AType"); Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/test/Makefile.toc,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Makefile.toc 24 Dec 2004 19:26:41 -0000 1.3 +++ Makefile.toc 24 Dec 2004 23:06:28 -0000 1.4 @@ -27,13 +27,26 @@ build_bins = 1 ifeq (1,$(build_bins)) - BIN_PROGRAMS = FactoryTest + BIN_PROGRAMS = FactoryTest PtrTest + BIN_PROGRAMS_LDADD = $(LIBP_TESTS_LDADD) +# Can't do these until i get the linker flags imported via toc: +# PtrTest FactoryTest_bin_OBJECTS = FactoryTest.o + FactoryTest_bin_LDADD = $(LIBPSYSTEM_CLIENT_LDADD) +# $(LIBPSYSTEM_CLIENT_LDADD) + PtrTest_bin_OBJECTS = PtrTest.o + PtrTest_bin_LDADD = $(LIBPSYSTEM_CLIENT_LDADD) # $(top_srcdir)/src/System/PathFinder.o $(wildcard $(top_srcdir)/src/System/SharedLib*.o) include $(TOC_MAKESDIR)/BIN_PROGRAMS.make # INSTALL_BINS += $(BIN_PROGRAMS) # Run target BIN_PROGRAMS to build these. endif -all: BIN_PROGRAMS +SHARED_LIBS = CType +SHARED_LIBS_LDADD = $(LIBP_TESTS_LDADD) +CType_so_OBJECTS = CType.o +include $(TOC_MAKESDIR)/SHARED_LIBS.make + + +all: SHARED_LIBS BIN_PROGRAMS |
From: stephan b. <sg...@us...> - 2004-12-24 23:06:35
|
Update of /cvsroot/pclasses/pclasses2/src/IO In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8043/src/IO Modified Files: Makefile.toc Log Message: Mass commit: build fixes. Can now build tests using proper configure steps, at least on linux systems. Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/IO/Makefile.toc,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Makefile.toc 24 Dec 2004 12:44:01 -0000 1.2 +++ Makefile.toc 24 Dec 2004 23:06:26 -0000 1.3 @@ -12,10 +12,11 @@ CLEAN_FILES += $(OBJECTS) build_libs = 1 -LIBNAME = $(LIBPIO_NAME) +LIBNAME = lib$(LIBPIO_BASENAME) ifeq (1,$(build_libs)) STATIC_LIBS = $(LIBNAME) SHARED_LIBS = $(STATIC_LIBS) + SHARED_LIBS_LDADD = $(P_BACKLINK_LDADD) $(LIBPIO_LDADD) $(LIBNAME)_a_OBJECTS = $(OBJECTS) $(LIBNAME)_so_OBJECTS = $($(LIBNAME)_a_OBJECTS) $(LIBNAME)_so_VERSION = $(PACKAGE_VERSION) |
From: stephan b. <sg...@us...> - 2004-12-24 23:05:43
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/Plugin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7914/include/pclasses/Plugin Modified Files: Plugin.h Log Message: Fixed a compile error. Added some debuggering code. Appears to basically work. :) Index: Plugin.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Plugin/Plugin.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Plugin.h 24 Dec 2004 19:15:24 -0000 1.1 +++ Plugin.h 24 Dec 2004 23:05:33 -0000 1.2 @@ -10,6 +10,10 @@ #include "pclasses/System/PathFinder.h" #include "pclasses/System/Directory.h" +#ifndef CERR +#define CERR std::cerr << __FILE__ << ":" << std::dec << __LINE__ << " : " +#endif + namespace P { namespace Plugin { @@ -113,6 +117,7 @@ */ void addPluginDir( const std::string & dir ) throw(::P::RuntimeError) { + //CERR << "addPluginDir("<<dir<<").\n"; using ::P::System::Directory; const Directory d(dir); // throws on error d.begin(); // avoid 'unused var' warning. @@ -139,12 +144,14 @@ ::P::System::SharedLib * addPlugin( const std::string & so_name ) throw(::P::RuntimeError) { + //CERR << "addPlugin("<<so_name<<").\n"; std::string fn = this->searchPath().find( so_name ); - if( ! fn ) + if( fn.empty() ) { - throw ::P::SystemError( std::string("No plugin found for '")+so_name+"'.", P_SOURCEINFO ); + throw ::P::System::SystemError( 0, (std::string("No plugin found for '")+so_name+"'.").c_str(), P_SOURCEINFO ); } ::P::System::SharedLib * shl = ::P::System::openSharedLib( fn ); + //CERR << "Opened fn="<<fn<<"\n"; this->m_holder.container().push_back( shl ); return shl; } |
From: stephan b. <sg...@us...> - 2004-12-24 23:04:52
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7761/include/pclasses Modified Files: Phoenix.h Log Message: Added throw() to dtor, to avoid errors when it phoenixes a type which has a throw() dtor. Index: Phoenix.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Phoenix.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Phoenix.h 23 Dec 2004 22:13:06 -0000 1.3 +++ Phoenix.h 24 Dec 2004 23:04:29 -0000 1.4 @@ -190,7 +190,7 @@ m_destroyed = false; } - virtual ~Phoenix() + virtual ~Phoenix() throw() { phoenix_CERR << "~Phoenix() @" << std::hex<< this << std::endl; m_destroyed = true; |