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-29 20:12:00
|
Update of /cvsroot/pclasses/pclasses2/src/s11n/io In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17094/src/s11n/io Modified Files: Makefile.toc serializers.h Log Message: Mass commit: lots of -l/-L linker changes/fixes. Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/s11n/io/Makefile.toc,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Makefile.toc 27 Dec 2004 18:06:00 -0000 1.3 +++ Makefile.toc 29 Dec 2004 20:11:20 -0000 1.4 @@ -2,7 +2,7 @@ include toc.make -SUBDIRS = expat parens +# SUBDIRS = expat parens HEADERS = \ data_node_format.h \ @@ -13,19 +13,21 @@ DIST_FILES += $(HEADERS) +LDFLAGS += $(P_BACKLINK_LDADD) + INSTALL_PACKAGE_HEADERS += $(HEADERS) INSTALL_PACKAGE_HEADERS_DEST = $(INSTALL_PACKAGE_HEADERS_BASE)/s11n/io SYMLINK_HEADERS = $(INSTALL_PACKAGE_HEADERS) SYMLINK_HEADERS_DEST = $(top_srcdir)/include/pclasses/s11n/io include $(TOC_MAKESDIR)/SYMLINK_HEADERS.make -SOURCES = data_node_io.cpp +SOURCES = \ + data_node_io.cpp + DIST_FILES += $(SOURCES) -OBJECTS = data_node_io.o +OBJECTS = $(patsubst %.cpp,%.o,$(SOURCES)) CLEAN_FILES += $(OBJECTS) -all: SYMLINK_HEADERS subdirs $(OBJECTS) - - +all: SYMLINK_HEADERS $(OBJECTS) Index: serializers.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/s11n/io/serializers.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- serializers.h 26 Dec 2004 09:16:27 -0000 1.3 +++ serializers.h 29 Dec 2004 20:11:20 -0000 1.4 @@ -126,7 +126,10 @@ // CERR << "register_serializer(" << classname << ","<<alias<<")\n"; PM.registerFactory( classname, FACCREATE ); - PM.alias( alias, classname ); + if( ! alias.empty() ) + { + PM.alias( alias, classname ); + } PM.alias( ST().magic_cookie(), classname ); #undef PM #undef FACCREATE |
From: stephan b. <sg...@us...> - 2004-12-29 20:12:00
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17094/include/pclasses Modified Files: Factory.h Log Message: Mass commit: lots of -l/-L linker changes/fixes. Index: Factory.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Factory.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- Factory.h 26 Dec 2004 09:28:17 -0000 1.14 +++ Factory.h 29 Dec 2004 20:11:11 -0000 1.15 @@ -153,12 +153,17 @@ KeyType is a type which specifies the type of key used to look up classes, defaulting to std::string. - Both InterfaceT and KeyType must be Default Constructable, - and InterfaceT must be constructable on the heap - (e.g., via new InterfaceT()). Thus InterfaceT must not be - pointer-qualified. + For this default implementation, both InterfaceT and + KeyType must be Default Constructable, and InterfaceT must + be constructable on the heap (e.g., via new + InterfaceT()). Clients supplying FactoryCreateHook or + FactoryInstanceHook specializations may apply other + requirements to InterfaceT and ImplT - The default ipmlementation holds no per-instance state, + Thus InterfaceT must be a "plain type", without any pointer + or reference qualification. + + The default implementation holds no per-instance state, thus it can be copied quickly. Sample usage: @@ -214,7 +219,7 @@ */ AliasMap & aliases() { - return m_alias; + return ::P::Phoenix<AliasMap,ThisType>::instance(); } /** @@ -222,7 +227,7 @@ */ const AliasMap & aliases() const { - return m_alias; + return ::P::Phoenix<AliasMap,ThisType>::instance(); } /** @@ -306,7 +311,7 @@ "should" do the same, but are not strictly required to. */ - virtual ResultType create( const key_type & _key ) + virtual ResultType create( const key_type & _key ) // throw() ???? { key_type key = this->expandAliases( _key ); typename FactoryMap::const_iterator it = factoryMap().find( key ); @@ -399,12 +404,8 @@ } - private: - AliasMap m_alias; - }; // class Factory - /** NamedTypeFactory works for string-keyed types. It is expected that this will be the most-used factory |
From: stephan b. <sg...@us...> - 2004-12-29 20:11:59
|
Update of /cvsroot/pclasses/pclasses2/src/Unicode In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17094/src/Unicode Modified Files: Makefile.toc Log Message: Mass commit: lots of -l/-L linker changes/fixes. Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/Unicode/Makefile.toc,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- Makefile.toc 28 Dec 2004 19:49:05 -0000 1.7 +++ Makefile.toc 29 Dec 2004 20:11:19 -0000 1.8 @@ -16,7 +16,11 @@ SOURCES_UNICODE_GEN = unicodedata.h unicodedata_extra.h -INSTALL_HEADERS = $(SOURCES_UNICODE_GEN) +######################################################################## +# install these or not? +# INSTALL_HEADERS = $(SOURCES_UNICODE_GEN) +# INSTALL_HEADERS_DEST = $(INSTALL_HEADERS_DEST_BASE)/Unicode +######################################################################## OBJECTS = Char.o \ String.o \ |
From: stephan b. <sg...@us...> - 2004-12-29 20:11:57
|
Update of /cvsroot/pclasses/pclasses2/doc/manual In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17094/doc/manual Modified Files: pclasses2.lyx Log Message: Mass commit: lots of -l/-L linker changes/fixes. Index: pclasses2.lyx =================================================================== RCS file: /cvsroot/pclasses/pclasses2/doc/manual/pclasses2.lyx,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- pclasses2.lyx 26 Dec 2004 09:37:05 -0000 1.4 +++ pclasses2.lyx 29 Dec 2004 20:10:55 -0000 1.5 @@ -255,10 +255,23 @@ Crypto: cryptography and hasing support. \layout Itemize -s11n: object serialization support. +s11n: +\begin_inset Quotes sld +\end_inset + +extreme serialization +\begin_inset Quotes srd +\end_inset + + support. \layout Section Core Module +\begin_inset LatexCommand \label{sec:Core-Module} + +\end_inset + + \layout Standard The types in this section all live in the namespace P. @@ -300,6 +313,11 @@ \layout Subsection Phoenix +\begin_inset LatexCommand \label{sub:Phoenix} + +\end_inset + + \layout Standard A shared object provider, providing @@ -340,6 +358,11 @@ \layout Subsection Factory +\begin_inset LatexCommand \label{sub:Factory} + +\end_inset + + \layout Standard The Factory template type plays a major role in P, providing the interface @@ -367,9 +390,13 @@ Simply do the following: \layout Quote + +\family typewriter #define PFACREG_TYPE MyType \layout Quote + +\family typewriter #define PFACREG_TYPE_NAME \begin_inset Quotes sld \end_inset @@ -381,6 +408,8 @@ \layout Quote + +\family typewriter #include <pclasses/FactoryReg.h> \layout Standard @@ -431,6 +460,23 @@ /srctree/test/CType.cpp \family default for examples. +\layout Paragraph + +Via P::s11n +\layout Standard + +You do not normally need to register your if you use those types with P::s11n + (section +\begin_inset LatexCommand \ref{sec:s11n-Module} + +\end_inset + +), as s11n already installs factories for it's registered types. + There are cases where multiple registrations are useful or required, however. +\layout Standard + +See (srctree)/test/s11nTest.cpp for a complete example of registering with + s11n. \layout Subsection Signals and Slots @@ -441,6 +487,11 @@ \layout Section Unicode Module +\begin_inset LatexCommand \label{sec:Unicode-Module} + +\end_inset + + \layout Standard The types in this section all live in the namespace P::Unicode. @@ -467,6 +518,11 @@ \layout Section Plugin Module +\begin_inset LatexCommand \label{sec:Plugin-Module} + +\end_inset + + \layout Standard The types in this section all live in the namespace P::Plugin. @@ -504,6 +560,11 @@ \layout Section System Module +\begin_inset LatexCommand \label{sec:System-Module} + +\end_inset + + \layout Standard The types in this section all live in the namespace P::System. @@ -531,9 +592,19 @@ \layout Subsection Shared libraries +\begin_inset LatexCommand \label{sub:Shared-libraries} + +\end_inset + + \layout Subsubsection SharedLib +\begin_inset LatexCommand \label{sub:SharedLib} + +\end_inset + + \layout Standard Provides a platform-neutral interface into shared libraries (also called @@ -543,12 +614,22 @@ \family typewriter openSharedLibrary() +\begin_inset LatexCommand \label{sub:openSharedLibrary()} + +\end_inset + + \layout Standard This free function opens a DLL and returns a SharedLibrary handle to it. \layout Subsection Threading +\begin_inset LatexCommand \label{sub:Threading} + +\end_inset + + \layout Standard Provides platform-neutral threading facilities. @@ -567,18 +648,31 @@ \layout Section IO Module +\begin_inset LatexCommand \label{sec:IO-Module} + +\end_inset + + \layout Standard The types in this section all live in the namespace P::IO. \layout Subsection IODevice +\layout Standard + +IODevice abstracts basic device-independent i/o operations. \layout Subsection IOHandler \layout Section Net Module +\begin_inset LatexCommand \label{sec:Net-Module} + +\end_inset + + \layout Standard The types in this section all live in the namespace P::Net. @@ -591,6 +685,11 @@ \layout Section SQL Module +\begin_inset LatexCommand \label{sec:SQL-Module} + +\end_inset + + \layout Standard The types in this section all live in the namespace @@ -615,23 +714,23 @@ Result \layout Section -Signals and Slots Module -\layout Standard +Crypto Module +\begin_inset LatexCommand \label{sec:Crypto-Module} + +\end_inset -The types in this section all live in the namespace -\color red -P::??? -\color default -. -\layout Section -Crypto Module \layout Standard The types in this section all live in the namespace P::Crypto. \layout Section Util Module +\begin_inset LatexCommand \label{sec:Util-Module} + +\end_inset + + \layout Standard The types in this section all live in the namespace P::Util. @@ -647,6 +746,11 @@ \layout Section s11n Module +\begin_inset LatexCommand \label{sec:s11n-Module} + +\end_inset + + \layout Standard The types in this section all live in the namespace P::s11n. @@ -684,6 +788,11 @@ \layout Subsection SIO interface +\begin_inset LatexCommand \label{sub:SIO-interface} + +\end_inset + + \layout Standard Clients using P's s11n features are encourages to use the P::SIO API, provided @@ -692,13 +801,126 @@ <pclasses/s11n/SIO.h> \family default . +\layout Standard + +Here are examples of using the SIO interface: +\layout Quote + + +\family typewriter +#include <pclasses/s11n/SIO.h> +\layout Quote + + +\family typewriter +... +\layout Quote + + +\family typewriter +using P::SIO; +\layout Quote + + +\family typewriter +save( obj, string|stream ); +\layout Standard + +That saves using the SIO::serializerClass() Serializer, which is set via + serializerClass(classname). + Default is of course expat, because that's all we have at the moment. +\layout Standard + +Loading has 3 options, shown below. + Remember that you don't need to know the input format of a stream/file: + any loaded/loadable format will do. + That is, if s11n can find a handler for it, it will be loaded. +\layout Standard + +Loading, method #1: +\layout Quote + + +\family typewriter +MyType * t = 0; +\layout Quote + + +\family typewriter +S11nNode * node = loadNode( file|stream ); +\layout Quote + + +\family typewriter +if( node ) { +\begin_deeper +\layout Quote + + +\family typewriter +t = deserialize<MyType>( *node ); +\layout Quote + + +\family typewriter +delete node; +\end_deeper +\layout Quote + + +\family typewriter +} +\layout Standard + +Loading, method #2: +\layout Quote + + +\family typewriter +MyType t; +\layout Quote + + +\family typewriter +S11nNode * node = loadNode( file|stream ); +\layout Quote + + +\family typewriter +if( node ) { +\begin_deeper +\layout Quote + + +\family typewriter +bool worked = deserialize<MyType>( *node, t ); +\layout Quote + + +\family typewriter +delete node; +\end_deeper +\layout Quote + + +\family typewriter +} +\layout Standard + +Loading, method #3: +\layout Quote + + +\family typewriter +MyType * t = loadSerializable<MyType>( file|stream ); \layout Subsection Registering Serializables \layout Standard See (srcdir)/test/s11nTest.cpp, registrations.cpp, FactoryTest.h and CType.cpp - for a complete example of plugging in types to P::s11n. + for complete examples of plugging in types to P::s11n, including using + DLLs. \layout Subsection Loading Serializers @@ -710,23 +932,29 @@ Something like this will do the trick: \layout Quote + +\family typewriter #include <pclasses/s11n/SIO.h> // P client interface into s11n \layout Quote + +\family typewriter ... \layout Quote -::P::SIO::SerializerInterface; -\layout Quote -// NODE_TYPE is an arbitrary s11n-support data node type, like P::s11n::s11n_nod -e or data_node. +\family typewriter +// Load it via the plugin manager: \layout Quote -// Load it via the plugin manager: + +\family typewriter +using namespace P::SIO; \layout Quote -SerializerBase * ser = ::P::SIO::createSerializer( "expat" ); + +\family typewriter +SerializerInterface * ser = createSerializer( "expat" ); \layout Standard Of course, @@ -741,13 +969,18 @@ type. \layout Standard -See the file (srctree)/test/s11nTest.cpp for a full example. +See the file (srcdir)/test/s11nTest.cpp for a complete example. \layout Section Misc notes \layout Subsection Building client software with this library +\begin_inset LatexCommand \label{sub:Building-client-software} + +\end_inset + + \layout Subsubsection Including P::Classes headers @@ -767,6 +1000,12 @@ -I/P/prefix/include \family default , then your compiler will find them. + As a general rule, code belonging to a sub-namespace contained in P lives + in +\family typewriter +<pclasses/NAMESPACE/...> +\family default +, where NAMESPACE is normally the name of the module. \layout Subsubsection Linking under Microsoft DevStudio |
From: stephan b. <sg...@us...> - 2004-12-29 20:11:33
|
Update of /cvsroot/pclasses/pclasses2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17094 Modified Files: configure.pclasses2 pclasses2.kdevelop Log Message: Mass commit: lots of -l/-L linker changes/fixes. Index: configure.pclasses2 =================================================================== RCS file: /cvsroot/pclasses/pclasses2/configure.pclasses2,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- configure.pclasses2 29 Dec 2004 19:56:14 -0000 1.18 +++ configure.pclasses2 29 Dec 2004 20:10:54 -0000 1.19 @@ -198,17 +198,17 @@ toc_export LIBPSYSTEM_CFLAGS="${THREADS_CFLAGS}" toc_export LIBPUTIL_BASENAME=pclasses_util -toc_export LIBPUTIL_LDADD="${THREADS_LDADD}" +toc_export LIBPUTIL_LDADD="${THREADS_LDADD} ${LIBPSYSTEM_LDADD}" # the dep on LIBPSYSTEM_LDADD needs to go away! toc_export LIBPUTIL_CLIENT_LDADD="-l${LIBPUTIL_BASENAME}" toc_export LIBPUTIL_CFLAGS="${THREADS_CFLAGS}" toc_export LIBPS11N_BASENAME=pclasses_s11n -toc_export LIBPS11N_LDADD="" +toc_export LIBPS11N_LDADD="${LIBPUTIL_CLIENT_LDADD}" toc_export LIBPS11N_CLIENT_LDADD="-l${LIBPS11N_BASENAME}" toc_export LIBPS11N_CFLAGS="" toc_export LIBPSIO_BASENAME=pclasses_sio -toc_export LIBPSIO_LDADD="${LIBEXPAT_CLIENT_LDADD} ${LIBPS11N_CLIENT_LDADD} ${LIBPSYSTEM_CLIENT_LDADD} ${LIBPUTIL_CLIENT_LDADD}" +toc_export LIBPSIO_LDADD="${LIBPS11N_CLIENT_LDADD} ${LIBPSYSTEM_CLIENT_LDADD} ${LIBEXPAT_CLIENT_LDADD}" toc_export LIBPSIO_CLIENT_LDADD="-l${LIBPSIO_BASENAME}" toc_export LIBPSIO_CFLAGS="" Index: pclasses2.kdevelop =================================================================== RCS file: /cvsroot/pclasses/pclasses2/pclasses2.kdevelop,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- pclasses2.kdevelop 24 Dec 2004 17:48:51 -0000 1.4 +++ pclasses2.kdevelop 29 Dec 2004 20:10:54 -0000 1.5 @@ -148,6 +148,7 @@ <tree> <hidepatterns>*.o,*.lo,CVS</hidepatterns> <hidenonprojectfiles>false</hidenonprojectfiles> + <showvcsfields>false</showvcsfields> </tree> </kdevfileview> <kdevcppsupport> |
From: stephan b. <sg...@us...> - 2004-12-29 20:11:33
|
Update of /cvsroot/pclasses/pclasses2/toc/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17094/toc/tests Modified Files: toc_make.sh Log Message: Mass commit: lots of -l/-L linker changes/fixes. Index: toc_make.sh =================================================================== RCS file: /cvsroot/pclasses/pclasses2/toc/tests/toc_make.sh,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- toc_make.sh 22 Dec 2004 19:04:25 -0000 1.1 +++ toc_make.sh 29 Dec 2004 20:11:22 -0000 1.2 @@ -24,7 +24,7 @@ local relpath local shortform local tocmakeprops - for d in $(find ${TOP_SRCDIR} -name Makefile -o -name GNUMakefile -o -name Makefile.toc -o -name '*.qmake' \ + for d in $(find ${TOP_SRCDIR} -name Makefile.toc -o -name Makefile -o -name GNUMakefile -o -name '*.qmake' \ | xargs grep -E -l "include.+${themake}" | sort -u); do #echo "d=$d" >&2 thedir=$(dirname $d) |
From: stephan b. <sg...@us...> - 2004-12-29 20:11:32
|
Update of /cvsroot/pclasses/pclasses2/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17094/test Modified Files: FactoryTest.h Makefile.toc SimplePropertyStoreTest.cpp s11nTest.cpp Log Message: Mass commit: lots of -l/-L linker changes/fixes. Index: s11nTest.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/test/s11nTest.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- s11nTest.cpp 28 Dec 2004 17:32:19 -0000 1.7 +++ s11nTest.cpp 29 Dec 2004 20:11:21 -0000 1.8 @@ -1,13 +1,13 @@ #include <pclasses/s11n/s11n_debuggering_macros.h> -#include <pclasses/s11n/SIO.h> +#include <pclasses/SIO/SIO.h> #include <pclasses/s11n/io/data_node_format.h> #include <pclasses/s11n/pods_streamable.h> #include <pclasses/s11n/list.h> #include <pclasses/s11n/map.h> #include <pclasses/s11n/proxy/Time_s11n.h> -#include <pclasses/s11n/proxy/LexT_s11n.h> +// #include <pclasses/s11n/proxy/LexT_s11n.h> #include <pclasses/Util/StringTool.h> #include <memory> // auto_ptr @@ -19,8 +19,11 @@ using namespace ::P::SIO; -typedef std::list<std::string> TestListType2; -typedef std::list<P::Util::LexT> TestListType; +typedef std::list<std::string> TestListType; +typedef std::vector<std::string> TestListType2; + +// typedef std::list<P::Util::LexT> TestListType; +// typedef std::vector<P::Util::LexT> TestListType2; // compiler bug, gcc 3.3.5 20040809: // When adding :: before P in the above decl it fails // with a 'parse error before :', but it allows @@ -438,26 +441,47 @@ ++mit; } } - - CERR << "s11n_cast(list,list2)...\n"; - TestListType2 list2; - assert( s11n_cast( list, list2 ) && "s11n_cast() failed :(" ); - // ^^^ reminder: only works when list and list2 use compatible - // proxies!!! - CERR << "casted-to list (size=="<<list2.size()<<"):\n"; - save( list2, std::cout ); - CERR << "Time...\n"; - using P::Time; - using P::Date; - using P::DateTime; - Time thetime( 12, 13, 14 ); - Date thedate( 2005, 1, 30 ); - DateTime dt( thedate, thetime ); - save( thetime, std::cout ); - save( thedate, std::cout ); - save( dt, std::cout ); + if( 0 ) + { + CERR << "s11n_cast(list,list2)...\n"; + TestListType2 list2; + assert( s11n_cast( list, list2 ) && "s11n_cast() failed :(" ); + // ^^^ reminder: only works when list and list2 use compatible + // proxies!!! + CERR << "casted-to list (size=="<<list2.size()<<"):\n"; + save( list2, std::cout ); + CERR << "ACHTUNG: ^^^^^ failure here is normal when the list1/list2 proxies don't match.\n"; + } + + if( 1 ) + { + CERR << "Time...\n"; + using P::Time; + using P::Date; + using P::DateTime; + Time thetime( 12, 13, 14 ); + Date thedate( 2005, 1, 30 ); + DateTime dt( thedate, thetime ); + save( thetime, std::cout ); + save( thedate, std::cout ); + save( dt, std::cout ); + + CERR << "Using S11nNode-specific API...\n"; + NODE_TYPE tmnode; + assert( tmnode.serialize( dt ) ); + assert( save( tmnode, std::cout ) ); + + DateTime * pdt = tmnode.deserialize<DateTime>(); + assert( pdt ); + CERR << "deserialized (DateTime*) == " << *pdt<<"\n"; + delete pdt; + DateTime vdt; + assert( tmnode.deserialize( vdt ) ); + CERR << "deserialized DateTime == " << vdt<<"\n"; + + } return 0; } Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/test/Makefile.toc,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- Makefile.toc 27 Dec 2004 22:52:20 -0000 1.12 +++ Makefile.toc 29 Dec 2004 20:11:21 -0000 1.13 @@ -32,12 +32,14 @@ build_bins = 1 ifeq (1,$(build_bins)) - BIN_PROGRAMS = FactoryTest PtrTest s11nTest StringToolTest SimplePropertyStoreTest + BIN_PROGRAMS = PtrTest StringToolTest +#FactoryTest +# s11nTest SimplePropertyStoreTest BIN_PROGRAMS_LDADD = $(LIBP_TESTS_LDADD) FactoryTest_bin_OBJECTS = FactoryTest.o registrations.o - FactoryTest_bin_LDADD = $(LIBPSYSTEM_CLIENT_LDADD) $(LIBPS11N_CLIENT_LDADD) $(LIBPUTIL_CLIENT_LDADD) + FactoryTest_bin_LDADD = $(LIBPSYSTEM_CLIENT_LDADD) $(LIBPSIO_CLIENT_LDADD) $(LIBPUTIL_CLIENT_LDADD) StringToolTest_bin_OBJECTS = StringToolTest.o - StringToolTest_bin_LDADD = $(LIBPUTIL_CLIENT_LDADD) $(LIBPSYSTEM_CLIENT_LDADD) + StringToolTest_bin_LDADD = $(LIBPUTIL_CLIENT_LDADD) $(LIBPSYSTEM_CLIENT_LDADD) # LIBPSYSTEM dep needs to go away! PtrTest_bin_OBJECTS = PtrTest.o PtrTest_bin_LDADD = $(LIBPSYSTEM_CLIENT_LDADD) s11nTest_bin_OBJECTS = s11nTest.o registrations.o Index: FactoryTest.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/test/FactoryTest.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- FactoryTest.h 26 Dec 2004 08:09:26 -0000 1.5 +++ FactoryTest.h 29 Dec 2004 20:11:21 -0000 1.6 @@ -11,7 +11,7 @@ #include <pclasses/Factory.h> -#include <pclasses/s11n/SIO.h> +#include <pclasses/SIO/SIO.h> #define NODE_TYPE ::P::SIO::S11nNode #define NODETR ::P::SIO::NodeTraits Index: SimplePropertyStoreTest.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/test/SimplePropertyStoreTest.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- SimplePropertyStoreTest.cpp 28 Dec 2004 17:31:40 -0000 1.4 +++ SimplePropertyStoreTest.cpp 29 Dec 2004 20:11:21 -0000 1.5 @@ -1,6 +1,6 @@ #include <pclasses/s11n/s11n_debuggering_macros.h> -#include <pclasses/s11n/SIO.h> +#include <pclasses/SIO/SIO.h> #include <pclasses/s11n/pods_streamable.h> #include <pclasses/s11n/map.h> #include <pclasses/Util/SimplePropertyStore.h> |
From: stephan b. <sg...@us...> - 2004-12-29 20:11:32
|
Update of /cvsroot/pclasses/pclasses2/toc/sbin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17094/toc/sbin Modified Files: toc_core.sh Log Message: Mass commit: lots of -l/-L linker changes/fixes. Index: toc_core.sh =================================================================== RCS file: /cvsroot/pclasses/pclasses2/toc/sbin/toc_core.sh,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- toc_core.sh 24 Dec 2004 11:41:08 -0000 1.3 +++ toc_core.sh 29 Dec 2004 20:11:22 -0000 1.4 @@ -667,12 +667,13 @@ echo ${TOC_EMOTICON_ERROR} return $err } - echo -n "$ofile ... " + echo -en "\t\t\t$ofile ... " fstate="created" test -f "$ofile" && fstate="updated" toc_replace_file "$ofile" "$tmpfile" || fstate="up to date" - echo "$fstate" + echo -en "\r$fstate" + echo return 0 } } # end toc_atfilter_file @@ -724,7 +725,7 @@ # which need to be @-parsed toc_boldecho "==== Creating configuration-dependent files..." { - toc_test_require toc_make | toc_internal_format_endconfigure + toc_test_require toc_make # | toc_internal_format_endconfigure # toc_test_require toc_config_h | toc_internal_format_endconfigure } local clean="$(ls .toc.* 2> /dev/null)" |
From: stephan b. <sg...@us...> - 2004-12-29 20:11:31
|
Update of /cvsroot/pclasses/pclasses2/toc/make In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17094/toc/make Modified Files: makerules.SHARED_LIBS Log Message: Mass commit: lots of -l/-L linker changes/fixes. Index: makerules.SHARED_LIBS =================================================================== RCS file: /cvsroot/pclasses/pclasses2/toc/make/makerules.SHARED_LIBS,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- makerules.SHARED_LIBS 22 Dec 2004 19:04:24 -0000 1.1 +++ makerules.SHARED_LIBS 29 Dec 2004 20:11:21 -0000 1.2 @@ -10,7 +10,7 @@ exit 1 } -echo "SHARED_LIBS_COMMON_DEPS = $0 \$(SHARED_LIBS_DEPSFILE) \$(SHARED_LIBS_OBJECTS) \$(SHARED_LIBS_MAKEFILE) Makefile" +echo "SHARED_LIBS_COMMON_DEPS = $0 \$(SHARED_LIBS_DEPSFILE) \$(SHARED_LIBS_OBJECTS) \$(SHARED_LIBS_MAKEFILE) \$(TOC_MAKEFILE_NAME)" for t in $@; do sofile=$t.so cat <<EOF |
From: stephan b. <sg...@us...> - 2004-12-29 20:11:29
|
Update of /cvsroot/pclasses/pclasses2/src/s11n/proxy In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17094/src/s11n/proxy Modified Files: Time_s11n.h Log Message: Mass commit: lots of -l/-L linker changes/fixes. Index: Time_s11n.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/s11n/proxy/Time_s11n.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Time_s11n.h 28 Dec 2004 21:58:25 -0000 1.2 +++ Time_s11n.h 29 Dec 2004 20:11:20 -0000 1.3 @@ -12,8 +12,6 @@ #else -#define CONCRETE_NODE_TYPE ::P::SIO::S11nNode - //////////////////////////////////////////////////////////////////////// // Time proxy //////////////////////////////////////////////////////////////////////// @@ -28,10 +26,10 @@ { // serialize -// template <typename CONCRETE_NODE_TYPE> - bool operator()( CONCRETE_NODE_TYPE & dest, const Time & src ) const + template <typename NodeType> + bool operator()( NodeType & dest, const Time & src ) const { - typedef ::P::s11n::node_traits<CONCRETE_NODE_TYPE> TR; + typedef ::P::s11n::node_traits<NodeType> TR; TR::class_name( dest, "P::Time" ); // don't use ::classname<Time>() here: it causes an ODR violation :( # define SSET(K,F) TR::set( dest, std::string(K), src.F() ); @@ -44,10 +42,10 @@ } // deserialize -// template <typename CONCRETE_NODE_TYPE> - bool operator()( const CONCRETE_NODE_TYPE & src, Time & dest ) const + template <typename NodeType> + bool operator()( const NodeType & src, Time & dest ) const { - typedef s11n::node_traits<CONCRETE_NODE_TYPE> TR; + typedef s11n::node_traits<NodeType> TR; # define SGET(K,SF,GF) dest.SF( TR::get( src, std::string(K), dest.GF() ) ); SGET("sec", setSecond, second ); SGET("min", setMinute, minute ); @@ -80,10 +78,10 @@ { // serialize -// template <typename CONCRETE_NODE_TYPE> - bool operator()( CONCRETE_NODE_TYPE & dest, const Date & src ) const + template <typename NodeType> + bool operator()( NodeType & dest, const Date & src ) const { - typedef ::P::s11n::node_traits<CONCRETE_NODE_TYPE> TR; + typedef ::P::s11n::node_traits<NodeType> TR; TR::class_name( dest, "P::Date" ); # define SSET(K,F) TR::set( dest, std::string(K), src.F() ); SSET("year", year ); @@ -94,10 +92,10 @@ } // deserialize -// template <typename CONCRETE_NODE_TYPE> - bool operator()( const CONCRETE_NODE_TYPE & src, Date & dest ) const + template <typename NodeType> + bool operator()( const NodeType & src, Date & dest ) const { - typedef s11n::node_traits<CONCRETE_NODE_TYPE> TR; + typedef s11n::node_traits<NodeType> TR; # define SGET(K,SF,GF) dest.SF( TR::get( src, std::string(K), dest.GF() ) ); SGET("year", setYear, year ); SGET("month", setMonth, month ); @@ -129,27 +127,27 @@ { // serialize -// template <typename CONCRETE_NODE_TYPE> - bool operator()( CONCRETE_NODE_TYPE & dest, const DateTime & src ) const + template <typename NodeType> + bool operator()( NodeType & dest, const DateTime & src ) const { - typedef ::P::s11n::node_traits<CONCRETE_NODE_TYPE> TR; + typedef ::P::s11n::node_traits<NodeType> TR; TR::class_name( dest, "P::DateTime" ); using namespace ::P::s11n; - bool worked = serialize_subnode<CONCRETE_NODE_TYPE,Time>( dest, "time", src ); - worked = worked && serialize_subnode<CONCRETE_NODE_TYPE,Date>( dest, "date", src ); + bool worked = serialize_subnode<NodeType,Time>( dest, "time", src ); + worked = worked && serialize_subnode<NodeType,Date>( dest, "date", src ); return worked; } // deserialize -// template <typename CONCRETE_NODE_TYPE> - bool operator()( const CONCRETE_NODE_TYPE & src, DateTime & dest ) const + template <typename NodeType> + bool operator()( const NodeType & src, DateTime & dest ) const { - typedef s11n::node_traits<CONCRETE_NODE_TYPE> TR; + typedef s11n::node_traits<NodeType> TR; using namespace ::P::s11n; - bool worked = deserialize_subnode<CONCRETE_NODE_TYPE,Time>( src, "time", dest ); + bool worked = deserialize_subnode<NodeType,Time>( src, "time", dest ); if( worked ) { - worked = deserialize_subnode<CONCRETE_NODE_TYPE,Date>( src, "date", dest ); + worked = deserialize_subnode<NodeType,Date>( src, "date", dest ); } return worked; } @@ -162,7 +160,6 @@ # include <pclasses/s11n/reg_serializable_traits.h> #endif // p_DATETIME_REGISTERED_WITH_S11N -#undef CONCRETE_NODE_TYPE #endif // PCLASSES_S11N_INCLUDED //////////////////////////////////////////////////////////////////////// |
From: stephan b. <sg...@us...> - 2004-12-29 19:56:54
|
Update of /cvsroot/pclasses/pclasses2/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14151/lib Modified Files: Makefile.toc Log Message: Added SIO module. Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/lib/Makefile.toc,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Makefile.toc 26 Dec 2004 02:25:01 -0000 1.2 +++ Makefile.toc 29 Dec 2004 19:56:44 -0000 1.3 @@ -17,8 +17,9 @@ Unicode/lib$(LIBPUNICODE_BASENAME) \ Util/lib$(LIBPUTIL_BASENAME) \ s11n/lib$(LIBPS11N_BASENAME) \ + SIO/lib$(LIBPS11N_BASENAME) \ ) -pliblist := $(addsuffix .so*,$(pliblist)) +pliblist := $(addsuffix .so,$(pliblist)) SYM_LIST = $(pliblist) |
From: stephan b. <sg...@us...> - 2004-12-29 19:56:22
|
Update of /cvsroot/pclasses/pclasses2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14108 Modified Files: configure.pclasses2 toc.pclasses2.make.at Log Message: Added SIO module. Index: toc.pclasses2.make.at =================================================================== RCS file: /cvsroot/pclasses/pclasses2/toc.pclasses2.make.at,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- toc.pclasses2.make.at 26 Dec 2004 14:54:30 -0000 1.7 +++ toc.pclasses2.make.at 29 Dec 2004 19:56:14 -0000 1.8 @@ -1,10 +1,11 @@ + #!/do/not/make #^^^ only to help emacs out. CLEAN_FILES += $(wildcard *.o *~) -INCLUDES += -I$(top_srcdir)/include -I$(top_srcdir)/include/pclasses $(PACKAGE_INCLUDES) +INCLUDES += -I$(top_srcdir)/include $(PACKAGE_INCLUDES) # CXXFLAGS += -fPIC @@ -23,8 +24,10 @@ ######################################################################## # 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) +P_BACKLINK_LDADD = -L$(top_srcdir)/lib \ + -L$(top_srcdir)/src $(addprefix -L$(top_srcdir)/src/,System Util Unicode IO Net SIO s11n) +### ^^^^ These -L's for each module really sucks, but is unfortunately necessary +### for the time being. #################################################################################### # Linker args for in-build-tree tests, so they can link back to the in-tree @@ -47,3 +50,5 @@ @true -l$(LIBPS11N_BASENAME): @true +-l$(LIBPSIO_BASENAME): + @true Index: configure.pclasses2 =================================================================== RCS file: /cvsroot/pclasses/pclasses2/configure.pclasses2,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- configure.pclasses2 28 Dec 2004 22:11:24 -0000 1.17 +++ configure.pclasses2 29 Dec 2004 19:56:14 -0000 1.18 @@ -194,7 +194,7 @@ 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_CLIENT_LDADD="-l${LIBPSYSTEM_BASENAME} ${LIBPIO_CLIENT_LDADD} ${LIBPUNICODE_CLIENT_LDADD}" toc_export LIBPSYSTEM_CFLAGS="${THREADS_CFLAGS}" toc_export LIBPUTIL_BASENAME=pclasses_util @@ -203,10 +203,15 @@ toc_export LIBPUTIL_CFLAGS="${THREADS_CFLAGS}" toc_export LIBPS11N_BASENAME=pclasses_s11n -toc_export LIBPS11N_LDADD="${LIBEXPAT_CLIENT_LDADD}" +toc_export LIBPS11N_LDADD="" toc_export LIBPS11N_CLIENT_LDADD="-l${LIBPS11N_BASENAME}" toc_export LIBPS11N_CFLAGS="" +toc_export LIBPSIO_BASENAME=pclasses_sio +toc_export LIBPSIO_LDADD="${LIBEXPAT_CLIENT_LDADD} ${LIBPS11N_CLIENT_LDADD} ${LIBPSYSTEM_CLIENT_LDADD} ${LIBPUTIL_CLIENT_LDADD}" +toc_export LIBPSIO_CLIENT_LDADD="-l${LIBPSIO_BASENAME}" +toc_export LIBPSIO_CFLAGS="" + ######################################################################## # Enable mysql driver... if test -x "${MYSQL_CONFIG_BIN}"; then |
From: stephan b. <sg...@us...> - 2004-12-29 19:56:05
|
Update of /cvsroot/pclasses/pclasses2/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14006/src Modified Files: Makefile.toc Log Message: Added SIO subdir. Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/Makefile.toc,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- Makefile.toc 27 Dec 2004 21:46:19 -0000 1.12 +++ Makefile.toc 29 Dec 2004 19:55:55 -0000 1.13 @@ -2,8 +2,7 @@ include toc.make -SUBDIRS = Unicode System s11n IO Util Net -# Plugins +SUBDIRS = Unicode System Util s11n IO Net SIO SOURCES = Alloc.cpp \ AtomicInt.gcc-x86.cpp \ |
From: stephan b. <sg...@us...> - 2004-12-29 19:55:28
|
Update of /cvsroot/pclasses/pclasses2/src/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13880/src/Util Modified Files: StringTool.cpp Log Message: Removed s11n_debuggering_macros.h dep Index: StringTool.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/Util/StringTool.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- StringTool.cpp 26 Dec 2004 18:46:43 -0000 1.6 +++ StringTool.cpp 29 Dec 2004 19:55:07 -0000 1.7 @@ -1,5 +1,5 @@ #include <pclasses/Util/StringTool.h> -#include <pclasses/s11n/s11n_debuggering_macros.h> // CERR +//#include <pclasses/s11n/s11n_debuggering_macros.h> // CERR namespace P { namespace StringTool { |
From: stephan b. <sg...@us...> - 2004-12-29 19:54:56
|
Update of /cvsroot/pclasses/pclasses2/src/SIO In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13760/src/SIO Added Files: Makefile.toc registrations.cpp S11nNode.cpp S11nNode.h SIO.cpp SIO.h Log Message: Moved SIO & S11nNode to SIO module, to a) keep deps correct, b) make the intended client-side interface clearer (hide more of s11n from it), c) ease porting of code between s11n.net and pclasses.com. --- NEW FILE: S11nNode.h --- #ifndef s11n_S11NNODE_HPP_INCLUDED #define s11n_S11NNODE_HPP_INCLUDED 1 #include <list> #include <string> #include <pclasses/Util/SimplePropertyStore.h> #include <pclasses/s11n/traits.h> #include <pclasses/s11n/data_node_serialize.h> namespace P { namespace SIO { /** The concrete "data node" type used by serialization operations. Note that it is considered poor form to use an S11nNode's API directly, as it's type and interface may change. The only guaranty the SIO API gives regarding S11nNode's API is that NodeTraits::funcname(S11nNode &...) operations will work as expected/documented. More clearly: use NodeTraits to manipulate and query nodes, not the node API directly. In fact S11nNode's useful API is all private, so you CAN'T touch it without going through NodeTraits. :) Gotcha! The API for this class is documented in P::Util::SimplePropertyStore. The conventions for it's use in s11n are defined in the s11n library manual (http://s11n.net/download/). Reminder to the source maintainer: don't just go changing this API unless you also implement or change the node_traits type to accomodate it. */ class S11nNode : public ::P::Util::SimplePropertyStore { public: typedef ::P::s11n::node_traits<S11nNode> traits_type; typedef ::P::Util::SimplePropertyStore ParentType; /** Expected by s11n algos.*/ typedef ParentType::map_type map_type; /** Expected by s11n algos.*/ typedef map_type::key_type key; /** Expected by s11n algos.*/ typedef map_type::value_type value; /** Expected by s11n algos.*/ typedef map_type::mapped_type mapped; /** Expected by s11n algos.*/ typedef map_type::iterator iterator; /** Expected by s11n algos.*/ typedef map_type::const_iterator const_iterator; /** Expected by s11n algos.*/ typedef std::list<S11nNode *> child_list_type; S11nNode(); explicit S11nNode( const std::string & name ); virtual ~S11nNode(); S11nNode( const S11nNode & ); S11nNode & operator=( const S11nNode & ); child_list_type & children(); const child_list_type & children() const; std::string name() const; void name( const std::string & n ); void class_name( const std::string & n ); std::string class_name() const; void clear(); // WTF doesn't gcc see the inherited clear() without this??? iterator S11nNode::begin(); const_iterator S11nNode::begin() const; iterator S11nNode::end(); const_iterator S11nNode::end() const; template <typename SerializableT> bool serialize( const SerializableT & src ) { return ::P::s11n::serialize<S11nNode,SerializableT>( *this, src ); } template <typename SerializableType> SerializableType * deserialize() const { return ::P::s11n::deserialize<S11nNode,SerializableType>( *this ); } template <typename DeserializableT> bool deserialize( DeserializableT & target ) const { return ::P::s11n::deserialize<S11nNode,DeserializableT>( *this, target ); } template <typename SerializableType> bool serializeSubnode( const std::string & subnodename, const SerializableType & src ) { return ::P::s11n::serialize_subnode<S11nNode,SerializableType>( *this, subnodename, src ); } template <typename DeserializableT> DeserializableT * deserializeSubnode( const std::string & subnodename ) const { return ::P::s11n::deserialize_subnode<S11nNode,DeserializableT>( *this, subnodename ); } template <typename DeserializableT> bool deserializeSubnode(const std::string & subnodename, DeserializableT & target ) const { return ::P::s11n::deserialize_subnode<S11nNode,DeserializableT>( *this, subnodename, target ); } protected: void copy( const S11nNode & rhs ); void clear_properties(); void clear_children(); std::string m_name; // name of this node std::string m_iname; // class_name name of this node child_list_type m_children; // holds child pointers }; } } // namespace P::SIO #endif // s11n_S11NNODE_HPP_INCLUDED --- NEW FILE: registrations.cpp --- //////////////////////////////////////////////////////////////////////// // This file hard-registers the Serializers available in ps11n, // until i get them fully integrated into the dynamic load system. //////////////////////////////////////////////////////////////////////// #include <pclasses/pclasses-config.h> // PCLASSES_HAVE_LIBEXPAT #include <pclasses/SIO/SIO.h> #include <pclasses/SIO/S11nNode.h> #ifdef PCLASSES_HAVE_LIBEXPAT // KLUDGE until i get S11nNode fully integrated... # include "../s11n/io/expat/expat_serializer.h" #endif # include "../s11n/io/parens/parens_serializer.h" //////////////////////////////////////////////////////////////////////// #define SIO_KEY_DEFAULT_SERIALIZER "/P/SIO/DefaultSerializerClass" /// ^^^^^^^^^^^^^ ACHTUNG: this #define is duplicated in SIO. /// Neither of these files knows about the other, though, /// so we can't refer to it here. //////////////////////////////////////////////////////////////////////// namespace P { namespace SIO { void s11n_io_init() { #define PM SerializerPluginManager::instance() #define SREG(S,N,A) \ registerSerializer< ::P::s11n::io:: S ## _serializer< S11nNode > >( N, A ); // @fixme: be more dynamic here, autoloading // libdir/pclasses/*_serializer.so. #ifdef PCLASSES_HAVE_LIBEXPAT SREG(expat,"s11n::io::expat_serializer","expat" ); PM.alias( "P::s11n::io::expat_serializer", "s11n::io::expat_serializer" ); PM.alias( SIO_KEY_DEFAULT_SERIALIZER, "expat" ); #endif SREG(parens, "s11n::io::parens_serializer", "parens" ); PM.alias( "P::s11n::io::parens_serializer", "s11n::io::parens_serializer" ); #undef SREG #undef PM } int s11n_io_init_placeholder = (s11n_io_init(),0); }} // P::SIO --- NEW FILE: SIO.h --- #ifndef p_SIO_H_INCLUDED #define p_SIO_H_INCLUDED 1 //////////////////////////////////////////////////////////////////////// // PCLASSES_SIO_INCLUDED is the "official" way for P code to know if // SIO is included yet. #define PCLASSES_SIO_INCLUDED 1 //////////////////////////////////////////////////////////////////////// // SIO.h: // Author: stephan beal <st...@s1...> // License: LGPL, copyright(c) 2004, 2005 stephan beal // // This header is intended to provide the standard P::s11n interface, // in particular the client-side interface. // // // Reminder to maintainers of this code: it is perfectly fine for this // code to depend on any P::s11n-related code, but it is NEVER // acceptable for ANY non-SIO code in the P::s11n namespace to depend // on P::SIO!!! NEVER, EVER! // (EVER! Don't even consider it!) //////////////////////////////////////////////////////////////////////// #include <string> #include <pclasses/s11n/s11n.h> #include <pclasses/s11n/io/serializers.h> #include <pclasses/Plugin/Plugin.h> #include <pclasses/SIO/S11nNode.h> namespace P { /** The SIO namespace encapsulates the entire client-side P::s11n-related API. Clients using s11n proxies and implementing serialization code may need to use the classes in P::s11n or possibly even P::s11n::io as well. SIO is a fork/port of the s11n project: http://s11n.net It was forked specifically to take advantage of the amazing super powers which the combination of P and s11n imply :). Forks are normally evil, but this fork was done by s11n's author :). SIO is mostly API-compatible with s11nlite, but uses a different data node type, so it is not 100% usage-compable. Data files/streams should be freely exchangeable between SIO and s11nlite, however, provided a compatible parser exists on both sides of the transaction (this is likely to be the case for most available Serializers, since i currently maintain both SIO and s11n :). */ namespace SIO { /** NodeTraits provide the interface for fetching and manipulating S11nNode data. */ typedef ::P::s11n::node_traits<S11nNode> NodeTraits; /** The parent type of Serializers supported by this interface. */ typedef ::P::s11n::io::data_node_serializer<S11nNode> SerializerInterface; /** A plugin manager type for loading SerializerInterface objects. */ typedef ::P::Plugin::PluginManager<SerializerInterface> SerializerPluginManager; /** See ::P::s11n::serialize(). */ template <typename SerializableT> bool serialize( S11nNode & dest, const SerializableT & src ) { return ::P::s11n::serialize<S11nNode,SerializableT>( dest, src ); } /** See ::P::s11n::derialize(). The caller owns the returned object, which may be NULL. */ template <typename SerializableType> SerializableType * deserialize( const S11nNode & src ) { return ::P::s11n::deserialize<S11nNode,SerializableType>( src ); } /** See ::P::s11n::deserialize(). */ template <typename DeserializableT> bool deserialize( const S11nNode & src, DeserializableT & target ) { return ::P::s11n::deserialize<S11nNode,DeserializableT>( src, target ); } /** See ::P::s11n::serialize_subnode(). */ template <typename SerializableType> bool serializeSubnode( S11nNode & dest, const std::string & subnodename, const SerializableType & src ) { return ::P::s11n::serialize_subnode<S11nNode,SerializableType>( dest, subnodename, src ); } /** See ::P::s11n::deserialize_subnode(). The caller owns the returned object, which may be NULL. */ template <typename DeserializableT> DeserializableT * deserializeSubnode( const S11nNode & src, const std::string & subnodename ) { return ::P::s11n::deserialize_subnode<S11nNode,DeserializableT>( src, subnodename ); } /** See ::P::s11n::deserialize_subnode(). */ template <typename DeserializableT> bool deserializeSubnode( const S11nNode & src, const std::string & subnodename, DeserializableT & target ) { return ::P::s11n::deserialize_subnode<S11nNode,DeserializableT>( src, subnodename, target ); } /** See ::P::s11n::io::load_node(). The caller owns the returned object, which may be NULL. */ S11nNode * loadNode( std::istream & src ); /** See ::P::s11n::io::load_node(src). The caller owns the returned object, which may be NULL. */ S11nNode * loadNode( const std::string & src ); /** See ::P::s11n::io::load_serializable(). */ template <typename SerializableType> SerializableType * loadSerializable( std::istream & src ) { return ::P::s11n::io::load_serializable<S11nNode,SerializableType>( src ); } /** See ::P::s11n::io::create_serializer(). In short: it looks at the given file to determine what Serializer should be able to read it. Once IOManager support is completed this will also support URL-based lookups. The caller owns the returned object, which may be NULL. */ SerializerInterface * serializerFor( const std::string & url ); /** Saves src to dest using the default serializerClass(). Returns true on success, false on error. */ bool save( const S11nNode & src, const std::string & dest ); /** Saves src to dest using the default serializerClass(). Returns true on success, false on error. */ bool save( const S11nNode & src, std::ostream & dest ); /** Uses SerializerPluginManager to load the Serializer set via serializerClass() The caller owns the returned object, which may be NULL. */ SerializerInterface * createSerializer(); /** Uses SerializerPluginManager to load a Serializer. The caller owns the returned object, which may be NULL. */ SerializerInterface * createSerializer( const std::string & ); /** Uses serialize(src,node) to serialize src to a S11nNode then calls save(node,dest). Returns true on success, false on error. */ template <typename SerializableT> bool save( const SerializableT & src, std::ostream & dest ) { S11nNode n; return (serialize( n, src ) && save( n, dest )); } /** Serializes src to a S11nNode && returns serialize(node,url). Returns true on success, false on error. */ template <typename SerializableT> bool save( const SerializableT & src, const std::string & url ) { S11nNode n; if( ! serialize( n, src ) ) return false; return serialize( n, url ); } /** Sets the current Serializer class used by createSerializer(). Pass it a class name of a SerializerInterface type. */ void serializerClass( const std::string & ); /** Gets the name of the current default Serializer type. */ std::string serializerClass(); /** Serializes fromobj and deserializes the data by passing it to toobj. Returns false if either operation fails. SerializableT1 and SerializableT must of course be Serializables for this to work. See ::P::s11n::s11n_cast() for full details, including tips on how to use this to easily convert containers to different types. */ template <typename SerializableT1, typename SerializableT2> bool s11n_cast( const SerializableT1 & fromobj, SerializableT2 & toobj ) { return ::P::s11n::s11n_cast<S11nNode,SerializableT1,SerializableT2>( fromobj, toobj ); } /** Registers a Serializer (i/o handler) with the library. SerializerImplT must be-a SerializerInterface type. */ template <typename SerializerImplT> void registerSerializer( const std::string & classname, const std::string & alias ) { ::P::s11n::io::register_serializer< SerializerImplT >( classname, alias ); } } // namespace SIO } // namespace P #endif // p_SIO_H_INCLUDED --- NEW FILE: Makefile.toc --- #!/usr/bin/make -f include toc.make SOURCES = \ registrations.cpp \ S11nNode.cpp \ SIO.cpp HEADERS = $(wildcard *.h) OBJECTS = $(patsubst %.cpp,%.o,$(SOURCES)) INSTALL_PACKAGE_HEADERS = $(HEADERS) INSTALL_PACKAGE_HEADERS_DEST = $(INSTALL_PACKAGE_HEADERS_BASE)/SIO DIST_FILES += $(wildcard *.at) $(SOURCES) $(HEADERS) SYMLINK_HEADERS = $(INSTALL_PACKAGE_HEADERS) SYMLINK_HEADERS_DEST = $(top_srcdir)/include/pclasses/SIO include $(TOC_MAKESDIR)/SYMLINK_HEADERS.make S11NIO_DIR = $(top_srcdir)/src/s11n/io S11NIO_OBJECTS = $(S11NIO_DIR)/data_node_io.o ifeq (1,$(PCLASSES_HAVE_LIBEXPAT)) S11NIO_OBJECTS += $(S11NIO_DIR)/expat/expat_serializer.o endif S11NIO_OBJECTS += $(S11NIO_DIR)/parens/parens_serializer.o LIBNAME = lib$(LIBPSIO_BASENAME) SHARED_LIBS = $(LIBNAME) $(LIBNAME)_so_LDADD = $(P_BACKLINK_LDADD) $(LIBPSIO_LDADD) $(LIBEXPAT_CLIENT_LDADD) $(LIBNAME)_so_OBJECTS = $(OBJECTS) $(S11NIO_OBJECTS) $(LIBNAME)_so_VERSION = $(PACKAGE_VERSION) include $(TOC_MAKESDIR)/SHARED_LIBS.make all: SYMLINK_HEADERS SHARED_LIBS --- NEW FILE: S11nNode.cpp --- #include "S11nNode.h" #include <pclasses/s11n/functor.h> // object_deleter, child_pointer_deep_copier namespace P { namespace SIO { #define NODE_CLASS_NAME "S11nNode" #define NODE_DEFAULT_NAME "S11nNode" S11nNode::S11nNode() : ::P::Util::SimplePropertyStore(), m_name(NODE_DEFAULT_NAME), m_iname(NODE_CLASS_NAME) { } S11nNode::S11nNode( const std::string & name ) : ::P::Util::SimplePropertyStore(), m_name(NODE_DEFAULT_NAME), m_iname(NODE_CLASS_NAME) { } #undef NODE_CLASS_NAME #undef NODE_DEFAULT_NAME S11nNode::S11nNode( const S11nNode &rhs ) { if( &rhs == this ) return; this->copy( rhs ); } S11nNode::~S11nNode() { this->clear(); } S11nNode & S11nNode::operator=( const S11nNode & rhs ) { if( &rhs == this ) return *this; this->copy( rhs ); return *this; } S11nNode::child_list_type & S11nNode::children() { return this->m_children; } const S11nNode::child_list_type & S11nNode::children() const { return this->m_children; } void S11nNode::copy( const S11nNode & rhs ) { if ( &rhs == this ) return; this->clear(); this->name( rhs.name() ); this->class_name( rhs.class_name() ); std::copy( rhs.begin(), rhs.end(), std::insert_iterator<map_type>( this->getMap(), this->getMap().begin() ) ); std::for_each( rhs.children().begin(), rhs.children().end(), ::P::s11n::child_pointer_deep_copier<child_list_type>( this->children() ) ); } void S11nNode::clear() { this->clear_children(); this->clear_properties(); } void S11nNode::class_name( const std::string & n ) { this->m_iname = n; } std::string S11nNode::class_name()const { return this->m_iname; } void S11nNode::name( const std::string & n ) { this->m_name = n; } std::string S11nNode::name() const { return this->m_name; } void S11nNode::clear_properties() { if ( getMap().empty() ) return; getMap().erase( getMap().begin(), getMap().end() ); } void S11nNode::clear_children() { std::for_each( this->children().begin(), this->children().end(), ::P::s11n::object_deleter() ); this->children().clear(); } S11nNode::iterator S11nNode::begin() { return this->getMap().begin(); } S11nNode::const_iterator S11nNode::begin() const { return this->getMap().begin(); } S11nNode::iterator S11nNode::end() { return this->getMap().end(); } S11nNode::const_iterator S11nNode::end() const { return this->getMap().end(); } }} // P::SIO --- NEW FILE: SIO.cpp --- //////////////////////////////////////////////////////////////////////// // SIO.cpp - implementation code for SIO.h // author: st...@s1... // License: LGPL, copyright(c) 2004, 2005 stephan beal //////////////////////////////////////////////////////////////////////// #include "SIO.h" #include <pclasses/s11n/s11n_debuggering_macros.h> #define SIO_KEY_DEFAULT_SERIALIZER "/P/SIO/DefaultSerializerClass" namespace P { /** */ namespace SIO { std::string m_serializer_class = SIO_KEY_DEFAULT_SERIALIZER; SerializerInterface * serializerFor( const std::string & url ) { // @fixme: be more dynamic here: // todo: port in IManager support from "original" ps11n // once IOM is re-implemented in P2. return ::P::s11n::io::create_serializer<S11nNode>( m_serializer_class ); } SerializerInterface * createSerializer( const std::string & c ) { return SerializerPluginManager::instance().create( c ); } SerializerInterface * createSerializer() { return SerializerPluginManager::instance().create( m_serializer_class ); } bool save( const S11nNode & src, std::ostream & dest ) { typedef std::auto_ptr<SerializerInterface> SAP; SAP ser = SAP(createSerializer()); if( ! ser.get() ) { CERR << "Could not load Serializer!\n"; return false; } return ser->serialize( src, dest ); } bool save( const S11nNode & src, const std::string & dest ) { std::ofstream os(dest.c_str()); if( ! os ) return false; return save( src, os ); } S11nNode * loadNode( std::istream & src ) { return ::P::s11n::io::load_node<S11nNode>( src ); } S11nNode * loadNode( const std::string & src ) { return ::P::s11n::io::load_node<S11nNode>( src ); } void serializerClass( const std::string & c ) { m_serializer_class = c; } std::string serializerClass() { return m_serializer_class; } }} // P::SIO |
From: stephan b. <sg...@us...> - 2004-12-29 19:54:53
|
Update of /cvsroot/pclasses/pclasses2/src/s11n In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13760/src/s11n Modified Files: Makefile.toc Removed Files: S11nNode.cpp S11nNode.h SIO.cpp SIO.h Log Message: Moved SIO & S11nNode to SIO module, to a) keep deps correct, b) make the intended client-side interface clearer (hide more of s11n from it), c) ease porting of code between s11n.net and pclasses.com. --- S11nNode.h DELETED --- --- S11nNode.cpp DELETED --- --- SIO.h DELETED --- --- SIO.cpp DELETED --- Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/s11n/Makefile.toc,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- Makefile.toc 28 Dec 2004 16:11:07 -0000 1.12 +++ Makefile.toc 29 Dec 2004 19:54:43 -0000 1.13 @@ -8,12 +8,7 @@ SOURCES = \ data_node.cpp \ s11n.cpp \ - s11n_node.cpp \ - S11nNode.cpp \ - SIO.cpp - - -# string_util.cpp + s11n_node.cpp HEADERS = $(wildcard *.h) @@ -22,14 +17,12 @@ data_node \ s11n \ s11n_node \ - S11nNode \ - SIO \ ) objects: $(OBJECTS) INSTALL_PACKAGE_HEADERS = $(HEADERS) -INSTALL_PACKAGE_HEADERS_DEST = $(prefix)/include/s11n.net/s11n +INSTALL_PACKAGE_HEADERS_DEST = $(INSTALL_PACKAGE_HEADERS_BASE)/s11n DIST_FILES += $(wildcard *.at) $(SOURCES) $(HEADERS) @@ -37,11 +30,11 @@ SYMLINK_HEADERS_DEST = $(top_srcdir)/include/pclasses/s11n include $(TOC_MAKESDIR)/SYMLINK_HEADERS.make -SUBDIR_OBJECTS = io/data_node_io.o -ifeq (1,$(PCLASSES_HAVE_LIBEXPAT)) - SUBDIR_OBJECTS += io/expat/expat_serializer.o -endif - SUBDIR_OBJECTS += io/parens/parens_serializer.o +#SUBDIR_OBJECTS = io/data_node_io.o +#ifeq (1,$(PCLASSES_HAVE_LIBEXPAT)) +# SUBDIR_OBJECTS += io/expat/expat_serializer.o +#endif +#SUBDIR_OBJECTS += io/parens/parens_serializer.o # odd: always causes the .o to be rebuilt: @@ -50,7 +43,7 @@ SHARED_LIBS = libpclasses_s11n -libpclasses_s11n_so_LDADD = $(LIBEXPAT_CLIENT_LDADD) +libpclasses_s11n_so_LDADD = $(LIBPS11N_LDADD) libpclasses_s11n_so_OBJECTS = $(OBJECTS) $(SUBDIR_OBJECTS) libpclasses_s11n_so_VERSION = $(PACKAGE_VERSION) include $(TOC_MAKESDIR)/SHARED_LIBS.make |
From: stephan b. <sg...@us...> - 2004-12-29 19:52:07
|
Update of /cvsroot/pclasses/pclasses2/src/SIO In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13169/src/SIO Log Message: Directory /cvsroot/pclasses/pclasses2/src/SIO added to the repository |
From: Marc D. <ma...@us...> - 2004-12-28 23:25:22
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31702/include/pclasses/Util Modified Files: Makefile.am Log Message: added Any to Makefile Index: Makefile.am =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Util/Makefile.am,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Makefile.am 28 Dec 2004 23:00:16 -0000 1.2 +++ Makefile.am 28 Dec 2004 23:25:12 -0000 1.3 @@ -1,3 +1,3 @@ INCLUDES = METASOURCES = AUTO -pkginclude_HEADERS = LexT.h ManagedThread.h Prefs.h SimplePropertyStore.h StringTool.h ThreadPool.h Variant.h WorkQueue.h +pkginclude_HEADERS = Any.h LexT.h ManagedThread.h Prefs.h SimplePropertyStore.h StringTool.h ThreadPool.h Variant.h WorkQueue.h |
From: stephan b. <sg...@us...> - 2004-12-28 23:02:23
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27375/include/pclasses/Util Modified Files: Prefs.h Log Message: Now compiles under P2, but has a dep on IO, which means IO almost certainly has a circular dep on the Util module. Index: Prefs.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Util/Prefs.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Prefs.h 28 Dec 2004 22:55:51 -0000 1.2 +++ Prefs.h 28 Dec 2004 23:02:13 -0000 1.3 @@ -4,6 +4,7 @@ #include <pclasses/Util/Variant.h> #include <pclasses/Exception.h> +#include <pclasses/IO/IOError.h> // ACHTUNG: (Util <==> IO) circular dep #include <string> #include <list> @@ -98,8 +99,8 @@ Prefs(PrefsStore* store = 0, const std::string& name = "root"); virtual ~Prefs(); virtual void clear(); - virtual void load() throw(P::IOError); - virtual void save() throw(P::IOError); + virtual void load() throw(P::IO::IOError); + virtual void save() throw(P::IO::IOError); Section& root(); const Section& root() const; PrefsStore* store(); @@ -115,8 +116,8 @@ public: PrefsStore() {} virtual ~PrefsStore() {} - virtual void load(Prefs::Section& root) throw(P::IOError) = 0; - virtual void update(Prefs::Section& root) throw(P::IOError) = 0; + virtual void load(Prefs::Section& root) throw(P::IO::IOError) = 0; + virtual void update(Prefs::Section& root) throw(P::IO::IOError) = 0; }; } // namespace P |
From: stephan b. <sg...@us...> - 2004-12-28 23:02:22
|
Update of /cvsroot/pclasses/pclasses2/src/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27375/src/Util Modified Files: Prefs.cpp Log Message: Now compiles under P2, but has a dep on IO, which means IO almost certainly has a circular dep on the Util module. Index: Prefs.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/Util/Prefs.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Prefs.cpp 28 Dec 2004 22:55:51 -0000 1.2 +++ Prefs.cpp 28 Dec 2004 23:02:13 -0000 1.3 @@ -1,5 +1,4 @@ #include "pclasses/Util/Prefs.h" - #include <sstream> #include <iostream> @@ -110,14 +109,14 @@ } -void Prefs::load() throw(P::IOError) { +void Prefs::load() throw(P::IO::IOError) { if(!_store) return; clear(); _store->load(_root); } -void Prefs::save() throw(P::IOError) { +void Prefs::save() throw(P::IO::IOError) { if(!_store) return; _store->update(_root); } |
From: stephan b. <sg...@us...> - 2004-12-28 23:01:13
|
Update of /cvsroot/pclasses/pclasses2/src/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27029/src/Util Modified Files: Makefile.am Makefile.toc Log Message: Added newer sources. Index: Makefile.am =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/Util/Makefile.am,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Makefile.am 28 Dec 2004 22:46:03 -0000 1.2 +++ Makefile.am 28 Dec 2004 23:01:01 -0000 1.3 @@ -1,6 +1,7 @@ INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include $(all_includes) METASOURCES = AUTO lib_LTLIBRARIES = libpclasses_util.la -libpclasses_util_la_SOURCES = ManagedThread.cpp SimplePropertyStore.cpp StringTool.cpp ThreadPool.cpp WorkQueue.cpp +libpclasses_util_la_SOURCES = ManagedThread.cpp Prefs.cpp SimplePropertyStore.cpp StringTool.cpp ThreadPool.cpp Variant.cpp WorkQueue.cpp +# ^^^^^^ is it legal to backslash-escape newlines in Automake? libpclasses_util_la_LIBADD = $(top_builddir)/src/System/libpclasses_system.la \ $(top_builddir)/src/libpclasses.la Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/Util/Makefile.toc,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- Makefile.toc 27 Dec 2004 22:33:28 -0000 1.7 +++ Makefile.toc 28 Dec 2004 23:01:02 -0000 1.8 @@ -2,19 +2,17 @@ include toc.make SOURCES = \ ManagedThread.cpp \ + Prefs.cpp \ SimplePropertyStore.cpp \ StringTool.cpp \ ThreadPool.cpp \ + Variant.cpp \ WorkQueue.cpp DIST_FILES += $(SOURCES) OBJECTS = \ - ManagedThread.o \ - SimplePropertyStore.o \ - StringTool.o \ - ThreadPool.o \ - WorkQueue.o + $(patsubst %.cpp,%.o,$(SOURCES)) CLEAN_FILES += $(OBJECTS) |
From: Marc D. <ma...@us...> - 2004-12-28 23:01:07
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26991/include/pclasses/Util Added Files: Any.h Log Message: added Any class to Util module --- NEW FILE: Any.h --- /* * P::Classes - Portable C++ Application Framework * Copyright (C) 2000-2003 Christian Prochnow <cp...@se...> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Based on boost::any Copyright Kevlin Henney, 2000, 2001, 2002. All rights reserved. */ #ifndef _P_Util_Any_h_ #define _P_Util_Any_h_ #include <algorithm> #include <typeinfo> #include <iostream> namespace P { namespace Util { //! Container that can hold every type /*! \ingroup core */ class Any { public: Any() : m_data(0) { } Any(const Any& val) : m_data(val.m_data ? val.m_data->clone() : 0) { } template <typename ValueType> Any(const ValueType& val) : m_data(new holder<ValueType>(val)) { } ~Any() { if(m_data) delete m_data; } Any& swap(Any& rhs) { std::swap(m_data, rhs.m_data); return *this; } template <typename ValueType> Any& operator=(const ValueType& rhs) { Any(rhs).swap(*this); return *this; } Any& operator=(const Any& rhs) { Any(rhs).swap(*this); return *this; } inline bool empty() const { return !m_data; } const std::type_info& type() const { return m_data ? m_data->type() : typeid(void); } template <typename ValueType> friend ValueType* any_cast(Any* val); friend std::ostream& operator<<(std::ostream& os, const Any& val); private: class holder_iface { public: virtual ~holder_iface() { } virtual const std::type_info& type() const = 0; virtual holder_iface* clone() const = 0; virtual void output(std::ostream& os) const = 0; }; template <typename ValueType> class holder: public holder_iface { public: holder(const ValueType& val) : m_value(val) { } virtual const std::type_info& type() const { return typeid(ValueType); } virtual holder_iface* clone() const { return new holder(m_value); } virtual void output(std::ostream& os) const { os << m_value; } private: ValueType m_value; }; private: holder_iface* m_data; }; //! Bad any-cast /*! \ingroup core */ class BadAnyCast: public std::bad_cast { public: virtual const char* what() const throw() { return "BadAnyCast: failed conversion using P::any_cast"; } }; //! Cast from any to type /*! \ingroup core */ template <typename ValueType> ValueType* any_cast(Any* operand) { return operand && operand->type() == typeid(ValueType) ? &static_cast<Any::holder<ValueType>*>(operand->m_data)->m_value : 0; } //! Cast from any to const-type /*! \ingroup core */ template <typename ValueType> const ValueType* any_cast(const Any* operand) { return any_cast<ValueType>(const_cast<Any*>(operand)); } //! Cast from any to value /*! \ingroup core */ template <typename ValueType> ValueType any_cast(const Any& operand) throw(BadAnyCast) { const ValueType* result = any_cast<ValueType>(&operand); if(!result) throw BadAnyCast(); return *result; } //! Any stream output operator /*! \ingroup core */ std::ostream& operator<<(std::ostream& os, const Any& val) { val.m_data->output(os); return os; } } } #endif |
From: stephan b. <sg...@us...> - 2004-12-28 23:00:25
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26927/include/pclasses/Util Modified Files: Makefile.am Makefile.toc Log Message: Updated headers. Index: Makefile.am =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Util/Makefile.am,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- Makefile.am 22 Dec 2004 17:54:41 -0000 1.1.1.1 +++ Makefile.am 28 Dec 2004 23:00:16 -0000 1.2 @@ -1,3 +1,3 @@ INCLUDES = METASOURCES = AUTO -pkginclude_HEADERS = ManagedThread.h ThreadPool.h WorkQueue.h +pkginclude_HEADERS = LexT.h ManagedThread.h Prefs.h SimplePropertyStore.h StringTool.h ThreadPool.h Variant.h WorkQueue.h Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Util/Makefile.toc,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Makefile.toc 27 Dec 2004 22:33:27 -0000 1.5 +++ Makefile.toc 28 Dec 2004 23:00:16 -0000 1.6 @@ -2,12 +2,7 @@ include toc.make HEADERS = \ - LexT.h \ - ManagedThread.h \ - SimplePropertyStore.h \ - StringTool.h \ - ThreadPool.h \ - WorkQueue.h + $(wildcard *.h) DIST_FILES += $(HEADERS) |
From: stephan b. <sg...@us...> - 2004-12-28 22:56:27
|
Update of /cvsroot/pclasses/pclasses2/src/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26069/src/Util Modified Files: Prefs.cpp Variant.cpp Log Message: Ported headers to p2 conventions. Still missing some exceptions ports, though. Index: Variant.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/Util/Variant.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Variant.cpp 28 Dec 2004 22:36:43 -0000 1.1 +++ Variant.cpp 28 Dec 2004 22:55:51 -0000 1.2 @@ -1,4 +1,4 @@ -#include "Variant.h" +#include "pclasses/Util/Variant.h" #include <sstream> #include <iostream> Index: Prefs.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/Util/Prefs.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Prefs.cpp 28 Dec 2004 22:36:43 -0000 1.1 +++ Prefs.cpp 28 Dec 2004 22:55:51 -0000 1.2 @@ -1,4 +1,4 @@ -#include "Prefs.h" +#include "pclasses/Util/Prefs.h" #include <sstream> #include <iostream> |
From: stephan b. <sg...@us...> - 2004-12-28 22:56:12
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26069/include/pclasses/Util Modified Files: Prefs.h Variant.h Log Message: Ported headers to p2 conventions. Still missing some exceptions ports, though. Index: Prefs.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Util/Prefs.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Prefs.h 28 Dec 2004 22:36:43 -0000 1.1 +++ Prefs.h 28 Dec 2004 22:55:51 -0000 1.2 @@ -1,9 +1,9 @@ #ifndef Pext_Prefs_h #define Pext_Prefs_h -#include <Variant.h> +#include <pclasses/Util/Variant.h> -#include <pclasses/pexception.h> +#include <pclasses/Exception.h> #include <string> #include <list> Index: Variant.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Util/Variant.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Variant.h 28 Dec 2004 22:36:43 -0000 1.1 +++ Variant.h 28 Dec 2004 22:55:51 -0000 1.2 @@ -208,7 +208,7 @@ } } -#include <Variant.tpp> +// #include <Variant.tpp> #endif |