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: Christian P. <cp...@us...> - 2005-01-24 01:20:20
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/Unicode In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7811/Unicode Modified Files: ustring.h Log Message: File was encoded with win32 crlf - fixed. Added export-macro. Index: ustring.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Unicode/ustring.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ustring.h 14 Jan 2005 14:46:01 -0000 1.1 +++ ustring.h 24 Jan 2005 01:20:09 -0000 1.2 @@ -1,116 +1,117 @@ -/*************************************************************************** - * Copyright (C) 2004 by Christian Prochnow * - * cp...@se... * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * - * published by the Free Software Foundation; either version 2 of the * - * License, or (at your option) any later version. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU Library General Public * - * License along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#ifndef P_Unicode_ustring_h -#define P_Unicode_ustring_h - -#include <pclasses/Unicode/uctype.h> -#include <string> - -namespace P { - -namespace Unicode { - -typedef off_t ustreampos; -struct ustate_t { }; - -int umemcmp(const uchar_t* s1, const uchar_t* s2, size_t n); -size_t ucslen(const uchar_t* s); -const uchar_t* umemchr(const uchar_t* s, size_t n, uchar_t a); -uchar_t* umemmove(uchar_t* s1, const uchar_t* s2, size_t n); -uchar_t* umemcpy(uchar_t* s1, const uchar_t* s2, size_t n); -uchar_t* umemset(uchar_t* s, size_t n, uchar_t a); - -} // !namespace Unicode - -} // !namespace P - -namespace std { - -template<> struct char_traits<P::Unicode::uchar_t> { - - typedef P::Unicode::uchar_t char_type; - typedef P::uint32_t int_type; - typedef streamoff off_type; - typedef P::Unicode::ustreampos pos_type; - typedef P::Unicode::ustate_t state_type; - - static void assign(char_type& c1, const char_type& c2) - { c1 = c2; } - - static bool eq(const char_type& c1, const char_type& c2) - { return c1 == c2; } - - static bool lt(const char_type& c1, const char_type& c2) - { return P::Unicode::umemcmp(&c1, &c2, 1) < 0; } - - static int compare(const char_type* c1, const char_type* c2, size_t n) - { return P::Unicode::umemcmp(c1, c2, n); } - - static size_t length(const char_type* s) - { return P::Unicode::ucslen(s); } - - static const char_type* find(const char_type* s, size_t n, - const char_type& a) - { return P::Unicode::umemchr(s, a, n); } - - static char_type* move(char_type* s1, const char_type* s2, int_type n) - { return P::Unicode::umemmove(s1, s2, n); } - - static char_type* copy(char_type* s1, const char_type* s2, size_t n) - { return P::Unicode::umemcpy(s1, s2, n); } - - static char_type* assign(char_type* s, size_t n, char_type a) - { return P::Unicode::umemset(s, a, n); } - - static char_type to_char_type(const int_type& c) - { return char_type(c); } - - static int_type to_int_type(const char_type& c) - { return int_type(c); } - - static bool eq_int_type(const int_type& c1, const int_type& c2) - { return c1 == c2; } - - static int_type eof() - { return static_cast<int_type>(UEOF); } - - static int_type not_eof(const int_type& c) - { return eq_int_type(c, eof()) ? 0 : c; } - -}; - -} - -namespace P { - -namespace Unicode { - -typedef std::basic_string<uchar_t, - std::char_traits<uchar_t>, - std::allocator<uchar_t> > ustring; - -ustring str(const char* str); - -} // !namespace Unicode - -} // !namespace P - -#endif +/*************************************************************************** + * Copyright (C) 2004 by Christian Prochnow * + * cp...@se... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 2 of the * + * License, or (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef P_Unicode_ustring_h +#define P_Unicode_ustring_h + +#include <pclasses/Export.h> +#include <pclasses/Unicode/uctype.h> +#include <string> + +namespace P { + +namespace Unicode { + +typedef off_t ustreampos; +struct ustate_t { }; + +PUNICODE_EXPORT int umemcmp(const uchar_t* s1, const uchar_t* s2, size_t n); +PUNICODE_EXPORT size_t ucslen(const uchar_t* s); +PUNICODE_EXPORT const uchar_t* umemchr(const uchar_t* s, size_t n, uchar_t a); +PUNICODE_EXPORT uchar_t* umemmove(uchar_t* s1, const uchar_t* s2, size_t n); +PUNICODE_EXPORT uchar_t* umemcpy(uchar_t* s1, const uchar_t* s2, size_t n); +PUNICODE_EXPORT uchar_t* umemset(uchar_t* s, size_t n, uchar_t a); + +} // !namespace Unicode + +} // !namespace P + +namespace std { + +template<> struct char_traits<P::Unicode::uchar_t> { + + typedef P::Unicode::uchar_t char_type; + typedef P::uint32_t int_type; + typedef streamoff off_type; + typedef P::Unicode::ustreampos pos_type; + typedef P::Unicode::ustate_t state_type; + + static void assign(char_type& c1, const char_type& c2) + { c1 = c2; } + + static bool eq(const char_type& c1, const char_type& c2) + { return c1 == c2; } + + static bool lt(const char_type& c1, const char_type& c2) + { return P::Unicode::umemcmp(&c1, &c2, 1) < 0; } + + static int compare(const char_type* c1, const char_type* c2, size_t n) + { return P::Unicode::umemcmp(c1, c2, n); } + + static size_t length(const char_type* s) + { return P::Unicode::ucslen(s); } + + static const char_type* find(const char_type* s, size_t n, + const char_type& a) + { return P::Unicode::umemchr(s, a, n); } + + static char_type* move(char_type* s1, const char_type* s2, int_type n) + { return P::Unicode::umemmove(s1, s2, n); } + + static char_type* copy(char_type* s1, const char_type* s2, size_t n) + { return P::Unicode::umemcpy(s1, s2, n); } + + static char_type* assign(char_type* s, size_t n, char_type a) + { return P::Unicode::umemset(s, a, n); } + + static char_type to_char_type(const int_type& c) + { return char_type(c); } + + static int_type to_int_type(const char_type& c) + { return int_type(c); } + + static bool eq_int_type(const int_type& c1, const int_type& c2) + { return c1 == c2; } + + static int_type eof() + { return static_cast<int_type>(UEOF); } + + static int_type not_eof(const int_type& c) + { return eq_int_type(c, eof()) ? 0 : c; } + +}; + +} + +namespace P { + +namespace Unicode { + +typedef std::basic_string<uchar_t, + std::char_traits<uchar_t>, + std::allocator<uchar_t> > ustring; + +PUNICODE_EXPORT ustring str(const char* str); + +} // !namespace Unicode + +} // !namespace P + +#endif |
From: Christian P. <cp...@us...> - 2005-01-24 01:19:36
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/Unicode In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7640/Unicode Modified Files: Char.h String.h TextStream.h uctype.h Log Message: Added export-macros. Index: Char.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Unicode/Char.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Char.h 23 Dec 2004 04:32:17 -0000 1.1 +++ Char.h 24 Jan 2005 01:19:26 -0000 1.2 @@ -21,6 +21,7 @@ #ifndef P_Unicode_Char_h #define P_Unicode_Char_h +#include <pclasses/Export.h> #include <pclasses/BasicTypes.h> #include <cwchar> @@ -29,7 +30,7 @@ namespace Unicode { //! UNICODE 4.0 Compliant character class -class Char { +class PUNICODE_EXPORT Char { public: //! General category enum Category { Index: String.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Unicode/String.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- String.h 27 Dec 2004 07:00:31 -0000 1.2 +++ String.h 24 Jan 2005 01:19:26 -0000 1.3 @@ -21,6 +21,7 @@ #ifndef P_Unicode_String_h #define P_Unicode_String_h +#include <pclasses/Export.h> #include <pclasses/BasicTypes.h> #include <pclasses/Alloc.h> #include <pclasses/SharedPtr.h> @@ -33,7 +34,7 @@ namespace Unicode { -class String { +class PUNICODE_EXPORT String { public: enum { npos = (size_t)-1 @@ -62,7 +63,7 @@ String left(size_t length) const throw(OutOfMemory, OutOfBounds); String right(size_t length) const throw(OutOfMemory, OutOfBounds); - class Iterator { + class PUNICODE_EXPORT Iterator { public: Iterator(Char* current); Iterator(const Iterator& iter); @@ -85,7 +86,7 @@ Char* _current; }; - class ConstIterator { + class PUNICODE_EXPORT ConstIterator { public: ConstIterator(const Char* current); ConstIterator(const ConstIterator& iter); Index: uctype.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Unicode/uctype.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- uctype.h 14 Jan 2005 14:46:01 -0000 1.1 +++ uctype.h 24 Jan 2005 01:19:26 -0000 1.2 @@ -21,6 +21,7 @@ #ifndef P_Unicode_uctype_h #define P_Unicode_uctype_h +#include <pclasses/Export.h> #include <pclasses/BasicTypes.h> namespace P { @@ -29,21 +30,21 @@ typedef uint32_t uchar_t; -int isualnum(uchar_t c); -int isualpha(uchar_t c); +PUNICODE_EXPORT int isualnum(uchar_t c); +PUNICODE_EXPORT int isualpha(uchar_t c); -int isucntrl(uchar_t c); -int isudigit(uchar_t c); -int isugraph(uchar_t c); -int isulower(uchar_t c); -int isuprint(uchar_t c); -int isupunct(uchar_t c); -int isuspace(uchar_t c); -int isuupper(uchar_t c); +PUNICODE_EXPORT int isucntrl(uchar_t c); +PUNICODE_EXPORT int isudigit(uchar_t c); +PUNICODE_EXPORT int isugraph(uchar_t c); +PUNICODE_EXPORT int isulower(uchar_t c); +PUNICODE_EXPORT int isuprint(uchar_t c); +PUNICODE_EXPORT int isupunct(uchar_t c); +PUNICODE_EXPORT int isuspace(uchar_t c); +PUNICODE_EXPORT int isuupper(uchar_t c); -uchar_t touchar(char c); -uchar_t toulower(uchar_t c); -uchar_t touupper(uchar_t c); +PUNICODE_EXPORT uchar_t touchar(char c); +PUNICODE_EXPORT uchar_t toulower(uchar_t c); +PUNICODE_EXPORT uchar_t touupper(uchar_t c); #define UEOF ((P::Unicode::uchar_t)-1) Index: TextStream.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Unicode/TextStream.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- TextStream.h 23 Dec 2004 04:32:17 -0000 1.1 +++ TextStream.h 24 Jan 2005 01:19:26 -0000 1.2 @@ -21,6 +21,7 @@ #ifndef P_Unicode_TextStream_h #define P_Unicode_TextStream_h +#include <pclasses/Export.h> #include <pclasses/IntTypes.h> #include <pclasses/CircularQueue.h> #include <pclasses/Unicode/String.h> @@ -29,14 +30,14 @@ namespace Unicode { -class TextStreamBuffer { +class PUNICODE_EXPORT TextStreamBuffer { public: TextStreamBuffer(); ~TextStreamBuffer(); }; -class TextStream { +class PUNICODE_EXPORT TextStream { public: //! Number format @@ -100,10 +101,10 @@ }; -TextStream& endl(TextStream& strm); -TextStream& dec(TextStream& strm); -TextStream& hex(TextStream& strm); -TextStream& oct(TextStream& strm); +PUNICODE_EXPORT TextStream& endl(TextStream& strm); +PUNICODE_EXPORT TextStream& dec(TextStream& strm); +PUNICODE_EXPORT TextStream& hex(TextStream& strm); +PUNICODE_EXPORT TextStream& oct(TextStream& strm); } // !namespace Unicode |
From: Christian P. <cp...@us...> - 2005-01-24 01:19:36
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7640 Modified Files: Alloc.h Log Message: Added export-macros. Index: Alloc.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Alloc.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- Alloc.h 22 Dec 2004 17:54:38 -0000 1.1.1.1 +++ Alloc.h 24 Jan 2005 01:19:25 -0000 1.2 @@ -18,9 +18,10 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#ifndef _P_Alloc_h_ -#define _P_Alloc_h_ +#ifndef P_Alloc_h +#define P_Alloc_h +#include <pclasses/Export.h> #include <pclasses/IntTypes.h> #include <pclasses/Exception.h> #include <new> @@ -28,14 +29,14 @@ namespace P { //! Out-of-memory exception -class OutOfMemory: public RuntimeError { +class PCORE_EXPORT OutOfMemory: public RuntimeError { public: OutOfMemory(const SourceInfo& si) throw(); ~OutOfMemory(); }; //! Allocator base-class -class Allocator { +class PCORE_EXPORT Allocator { public: Allocator(); virtual ~Allocator(); @@ -45,7 +46,7 @@ }; //! Allocator using malloc() -class MallocAllocator: public Allocator { +class PCORE_EXPORT MallocAllocator: public Allocator { public: MallocAllocator(); ~MallocAllocator(); |
From: Christian P. <cp...@us...> - 2005-01-24 01:19:36
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/IO In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7640/IO Modified Files: StringDevice.h Log Message: Added export-macros. Index: StringDevice.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/IO/StringDevice.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- StringDevice.h 17 Jan 2005 21:55:23 -0000 1.2 +++ StringDevice.h 24 Jan 2005 01:19:25 -0000 1.3 @@ -1,11 +1,13 @@ #ifndef P_IO_STRINGDEVICE_HPP_INCLUDED #define P_IO_STRINGDEVICE_HPP_INCLUDED 1 -#include "pclasses/IO/IODevice.h" -#include "pclasses/Unicode/String.h" +#include <pclasses/Export.h> +#include <pclasses/IO/IODevice.h> +#include <pclasses/Unicode/String.h> -namespace P { namespace IO { +namespace P { +namespace IO { /** StringDevice is an experiment to get to know the IO layer @@ -14,7 +16,7 @@ @@fixme .. implementation is out of sync!! */ - class StringDevice : public IODevice + class PIO_EXPORT StringDevice : public IODevice { public: typedef ::P::Unicode::String StringType; |
From: Christian P. <cp...@us...> - 2005-01-24 01:19:35
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7640/System Modified Files: SharedLib.h SystemClock.h SystemError.h Thread.h ThreadKey.h Log Message: Added export-macros. Index: ThreadKey.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/System/ThreadKey.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ThreadKey.h 16 Jan 2005 01:57:16 -0000 1.2 +++ ThreadKey.h 24 Jan 2005 01:19:25 -0000 1.3 @@ -18,6 +18,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ +#include <pclasses/Export.h> #include <pclasses/NonCopyable.h> #include <pclasses/System/SystemError.h> @@ -33,7 +34,7 @@ This class should not be used directly, instead you should use the ThreadKey template class. */ -class ThreadKeyImpl: public NonCopyable { +class PSYSTEM_EXPORT ThreadKeyImpl: public NonCopyable { public: ThreadKeyImpl() throw(SystemError); ~ThreadKeyImpl() throw(); Index: SystemClock.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/System/SystemClock.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- SystemClock.h 28 Dec 2004 20:34:19 -0000 1.2 +++ SystemClock.h 24 Jan 2005 01:19:25 -0000 1.3 @@ -21,6 +21,7 @@ #ifndef P_System_SystemClock_h #define P_System_SystemClock_h +#include <pclasses/Export.h> #include <pclasses/DateTime.h> #include <string> @@ -28,7 +29,7 @@ namespace System { -class SystemClock { +class PSYSTEM_EXPORT SystemClock { public: //! Operation mode for now() enum NowMode { Index: Thread.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/System/Thread.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Thread.h 16 Jan 2005 00:33:27 -0000 1.2 +++ Thread.h 24 Jan 2005 01:19:25 -0000 1.3 @@ -21,6 +21,7 @@ #ifndef P_System_Thread_h #define P_System_Thread_h +#include <pclasses/Export.h> #include <pclasses/Exception.h> #include <pclasses/NonCopyable.h> #include <pclasses/System/SystemError.h> @@ -29,7 +30,7 @@ namespace System { -class Thread: public NonCopyable { +class PSYSTEM_EXPORT Thread: public NonCopyable { public: Thread(bool detached) throw(); virtual ~Thread() throw(); Index: SystemError.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/System/SystemError.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- SystemError.h 23 Dec 2004 04:32:17 -0000 1.2 +++ SystemError.h 24 Jan 2005 01:19:25 -0000 1.3 @@ -21,6 +21,7 @@ #ifndef P_System_SystemError_h #define P_System_SystemError_h +#include <pclasses/Export.h> #include <pclasses/SourceInfo.h> #include <pclasses/Exception.h> #include <pclasses/Unicode/String.h> @@ -30,7 +31,7 @@ namespace System { //! System error class -class SystemError: public RuntimeError { +class PSYSTEM_EXPORT SystemError: public RuntimeError { public: //! System error constructor /*! Index: SharedLib.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/System/SharedLib.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- SharedLib.h 27 Dec 2004 23:30:30 -0000 1.8 +++ SharedLib.h 24 Jan 2005 01:19:25 -0000 1.9 @@ -22,14 +22,11 @@ #define P_System_SharedLib_h #include <pclasses/pclasses-config.h> +#include <pclasses/Export.h> #include <pclasses/NonCopyable.h> #include <pclasses/Unicode/String.h> #include <pclasses/System/SystemError.h> -#ifdef PCLASSES_WITH_STL -# include <string> -#endif - namespace P { namespace System { @@ -47,7 +44,7 @@ \endcode \author Christian Prochnow <cp...@se...> */ -class SharedLib: public NonCopyable { +class PSYSTEM_EXPORT SharedLib: public NonCopyable { public: //! Function binding mode enum BindMode { @@ -113,7 +110,7 @@ by this function and will be cleaned up during application shut-down (post-main()). */ -SharedLib *openSharedLib( const std::string & path ) throw(RuntimeError); +PSYSTEM_EXPORT SharedLib *openSharedLib( const std::string & path ) throw(RuntimeError); } // !namespace System |
From: Christian P. <cp...@us...> - 2005-01-24 01:17:29
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7111 Modified Files: BasicTypes.h Log Message: Fixed type. Index: BasicTypes.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/BasicTypes.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- BasicTypes.h 22 Dec 2004 17:54:38 -0000 1.1.1.1 +++ BasicTypes.h 24 Jan 2005 01:17:19 -0000 1.2 @@ -65,8 +65,8 @@ typedef unsigned long uint64_t; #elif PCLASSES_SIZEOF__INT64 == 8 #define PCLASSES_HAVE_64BIT_INT 1 - typedef __in64 int64_t; - typedef unsigned __in64 uint64_t; + typedef __int64 int64_t; + typedef unsigned __int64 uint64_t; #elif PCLASSES_SIZEOF_LONG_LONG == 8 #define PCLASSES_HAVE_64BIT_INT 1 typedef long long int64_t; |
From: Christian P. <cp...@us...> - 2005-01-23 13:51:49
|
Update of /cvsroot/pclasses/pclasses2/src/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22926/src/Util Modified Files: WorkQueue.cpp Log Message: Fixed list usage. Index: WorkQueue.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/Util/WorkQueue.cpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- WorkQueue.cpp 22 Dec 2004 17:54:35 -0000 1.1.1.1 +++ WorkQueue.cpp 23 Jan 2005 13:51:39 -0000 1.2 @@ -152,7 +152,7 @@ { while(_numThreads > numThreads) { - List<WorkerThread*>::Iterator i = _threads.begin(); + list<WorkerThread*>::iterator i = _threads.begin(); WorkerThread* thread = *i; thread->stop(); thread->join(); @@ -165,7 +165,7 @@ { WorkerThread* thread = new WorkerThread(_queue); thread->start(); - _threads.append(thread); + _threads.push_back(thread); ++_numThreads; } } |
From: Christian P. <cp...@us...> - 2005-01-23 13:51:49
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22926/include/pclasses/Util Modified Files: WorkQueue.h Log Message: Fixed list usage. Index: WorkQueue.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Util/WorkQueue.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- WorkQueue.h 22 Dec 2004 17:54:41 -0000 1.1.1.1 +++ WorkQueue.h 23 Jan 2005 13:51:38 -0000 1.2 @@ -96,7 +96,7 @@ private: WorkQueue& _queue; unsigned int _numThreads; - List<WorkerThread*> _threads; + list<WorkerThread*> _threads; }; } // !namespace Utils |
From: Christian P. <cp...@us...> - 2005-01-23 13:32:04
|
Update of /cvsroot/pclasses/pclasses2/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18785/test Modified Files: Makefile.am Log Message: Added System module to linkage of ListTest (needed for Locking). Index: Makefile.am =================================================================== RCS file: /cvsroot/pclasses/pclasses2/test/Makefile.am,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Makefile.am 20 Jan 2005 11:00:35 -0000 1.5 +++ Makefile.am 23 Jan 2005 13:31:54 -0000 1.6 @@ -12,7 +12,8 @@ IntTypeTest_SOURCES = IntTypeTest.cpp IntTypeTest_LDADD = $(top_builddir)/src/libpclasses.la ListTest_SOURCES = ListTest.cpp -ListTest_LDADD = $(top_builddir)/src/libpclasses.la +ListTest_LDADD = $(top_builddir)/src/libpclasses.la \ + $(top_builddir)/src/System/libpclasses_system.la ThreadTest_SOURCES = ThreadTest.cpp ThreadTest_LDADD = $(top_builddir)/src/System/libpclasses_system.la\ $(top_builddir)/src/libpclasses.la |
From: Christian P. <cp...@us...> - 2005-01-23 13:31:08
|
Update of /cvsroot/pclasses/pclasses2/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18616/test Modified Files: ListTest.cpp Log Message: Use CriticalSection for list-test. Index: ListTest.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/test/ListTest.cpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- ListTest.cpp 22 Dec 2004 17:54:37 -0000 1.1.1.1 +++ ListTest.cpp 23 Jan 2005 13:30:59 -0000 1.2 @@ -20,6 +20,7 @@ #include "Test.h" #include "pclasses/List.h" +#include "pclasses/System/CriticalSection.h" namespace P { @@ -27,30 +28,30 @@ public: void run() throw() { - List<int> l; + list<int, P::System::CriticalSection> l; P_TEST(l.empty()); - P_TEST(l.count() == 0); + P_TEST(l.size() == 0); - l.append(1); + l.push_back(1); P_TEST(l.front() == 1); P_TEST(l.back() == 1); - l.append(2); + l.push_back(2); P_TEST(l.front() == 1); P_TEST(l.back() == 2); - l.prepend(0); + l.push_front(0); P_TEST(l.front() == 0); P_TEST(l.back() == 2); - P_TEST(l.count() == 3); + P_TEST(l.size() == 3); - List<int> l2(l); + list<int, P::System::CriticalSection> l2(l); P_TEST(!l2.empty()); - P_TEST(l == l2); + //P_TEST(l == l2); l2.clear(); P_TEST(l2.empty()); |
From: Christian P. <cp...@us...> - 2005-01-23 13:30:37
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18251/include/pclasses Modified Files: List.h Log Message: Drop own List-implementation. Inherit from std::list introducing locking. Index: List.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/List.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- List.h 22 Dec 2004 17:54:39 -0000 1.1.1.1 +++ List.h 23 Jan 2005 13:30:27 -0000 1.2 @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2004 by Christian Prochnow * + * Copyright (C) 2005 by Christian Prochnow * * cp...@se... * * * * This program is free software; you can redistribute it and/or modify * @@ -18,242 +18,247 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#ifndef _P_List_h_ -#define _P_List_h_ - -#include <pclasses/LinkedItem.h> -#include <pclasses/Algorithm.h> +#ifndef P_List_h +#define P_List_h + +#include <pclasses/LockTraits.h> +#include <list> +#include <memory> namespace P { -//! List-iterator base class -class ListIteratorBase { - public: - ListIteratorBase(DLinkedItemBase* node) - : _node(node) - { } +//! STL-based list-iterator with locking-support +template < + typename _Tp, typename _Ref, typename _Ptr, + typename _MutexT, typename _LockT +> +struct _List_iterator: public std::_List_iterator<_Tp, _Ref, _Ptr> +{ + typedef std::_List_iterator<_Tp, _Ref, _Ptr> BaseType; - ListIteratorBase(const ListIteratorBase& iter) - : _node(iter._node) - { } + typedef typename BaseType::iterator iterator; + typedef typename BaseType::const_iterator const_iterator; - ~ListIteratorBase() - { } + typedef typename BaseType::value_type value_type; + typedef typename BaseType::pointer pointer; + typedef typename BaseType::reference reference; - void inc() - { _node = _node->next; } + _List_iterator(typename BaseType::_Node* __x, _MutexT& mtx) + : BaseType(__x), _lock(mtx) + { } - void dec() - { _node = _node->prev; } + _List_iterator(const BaseType& __i, _MutexT& mtx) + : BaseType(__i), _lock(mtx) + { } - DLinkedItemBase* node() const - { return _node; } + _List_iterator(const _List_iterator& __l) + : BaseType(__l), _lock(__l._lock) + { } - bool operator==(const ListIteratorBase& iter) const - { return (_node == iter._node); } + _LockT _lock; +}; - bool operator!=(const ListIteratorBase& iter) const - { return (_node != iter._node); } - private: - DLinkedItemBase* _node; -}; +//! STL-based list with optional locking +/*! + \todo add list operations [23.2.2.4] +*/ +template < + typename _Tp, + typename _MutexT = Traits::VoidMutex, + typename _Alloc = std::allocator<_Tp> +> +class list: protected std::list<_Tp, _Alloc> +{ + typedef std::list<_Tp, _Alloc> BaseType; -//! List-iterator -template <class Type, class RefType, class PtrType> -class ListIterator: public ListIteratorBase { public: - typedef DLinkedItem<Type> DLinkedItem; - - ListIterator(DLinkedItem* node) - : ListIteratorBase(node) - { } + typedef typename BaseType::value_type value_type; + typedef typename BaseType::pointer pointer; + typedef typename BaseType::const_pointer const_pointer; + typedef typename BaseType::reference reference; + typedef typename BaseType::const_reference const_reference; + typedef typename BaseType::size_type size_type; + typedef typename BaseType::difference_type difference_type; + typedef typename BaseType::allocator_type allocator_type; - ListIterator(const ListIterator& iter) - : ListIteratorBase(iter) - { } + typedef Traits::LockTraits<_MutexT> locktraits_type; + typedef typename locktraits_type::MutexType mutex_type; + typedef typename locktraits_type::ReadLock read_lock; + typedef typename locktraits_type::WriteLock write_lock; - ~ListIterator() - { } + typedef _List_iterator<_Tp,_Tp&,_Tp*, + mutex_type, write_lock> iterator; + typedef _List_iterator<_Tp,const _Tp&, + const _Tp*, mutex_type, read_lock> const_iterator; + typedef std::reverse_iterator<const_iterator> const_reverse_iterator; + typedef std::reverse_iterator<iterator> reverse_iterator; - RefType operator*() const - { return static_cast<DLinkedItem*>(node())->data; } + explicit + list(const allocator_type& __a = allocator_type()) + : BaseType(__a) { } - PtrType operator->() const - { return &(operator*()); } + list(size_type __n, const value_type& __value, + const allocator_type& __a = allocator_type()) + : BaseType(__a) + { insert(begin(), __n, __value); } - ListIterator& operator++() - { - inc(); - return *this; - } + explicit + list(size_type __n) + : BaseType(allocator_type()) + { insert(begin(), __n, value_type()); } - ListIterator operator++(int) - { - ListIterator tmp = *this; - inc(); - return tmp; - } + list(const list& __x) + : BaseType(__x.get_allocator()) + { insert(begin(), __x.begin(), __x.end()); } - ListIterator& operator--() + template <typename _InputIterator> + list(_InputIterator __first, _InputIterator __last, + const allocator_type& __a = allocator_type()) + : BaseType(__a) + { insert(begin(), __first, __last); } + + ~list() + { } + + list& operator=(const list& __x) { - dec(); + write_lock lck1(_mutex); + read_lock lck2(__x._mutex); + BaseType::operator=(__x); return *this; } - ListIterator operator--(int) - { - ListIterator tmp = *this; - dec(); - return tmp; + void assign(size_type __n, const value_type& __val) + { + write_lock lck(_mutex); + BaseType::assign(__n, __val); } -}; -//! List template class -template <class Type> -class List { - public: - typedef DLinkedItem<Type> DLinkedItem; - typedef ListIterator<Type,Type&,Type*> Iterator; - typedef ListIterator<Type,const Type&, const Type*> ConstIterator; - - List() throw() - : _data(new DLinkedItem()) + template <typename _InputIterator> + void assign(_InputIterator __first, _InputIterator __last) { - _data->prev = _data->next = _data; + write_lock lck(_mutex); + BaseType::assign(_first, _last); } - List(const List& l) - : _data(new DLinkedItem()) - { - _data->prev = _data->next = _data; - for(ConstIterator i = l.begin(); i != l.end(); i++) - append(*i); - } + allocator_type get_allocator() const + { return BaseType::get_allocator(); } - ~List() throw() + iterator begin() { - clear(); - delete _data; + typedef typename BaseType::_Node _Node; + _Node* n = static_cast<_Node*>(this->_M_node->_M_next); + return iterator(n, _mutex); } - void swap(List& b) throw() - { - DLinkedItem* tmp = static_cast<DLinkedItem*>(_data); - _data = b._data; - b._data = tmp; + const_iterator begin() const + { + typedef typename BaseType::_Node _Node; + _Node* n = static_cast<_Node*>(this->_M_node->_M_next); + return const_iterator(n, _mutex); } - void clear() throw() - { - DLinkedItemBase* curr = _data->next; - while(curr != _data) - { - DLinkedItemBase* tmp = curr->next; - delete static_cast<DLinkedItem*>(curr); - curr = tmp; - } + iterator end() + { return iterator(_M_node, _mutex); } - _data->prev = _data->next = _data; - } + const_iterator end() const + { return const_iterator(_M_node, _mutex); } - bool empty() const throw() - { return (_data->next == _data); } + bool empty() const + { + read_lock lck(_mutex); + return BaseType::empty(); + } - size_t count() const throw() - { return distance(begin(), end()); } - - Iterator begin() throw() - { return Iterator(static_cast<DLinkedItem*>(_data->next)); } + size_type size() const + { return std::distance(begin(), end()); } - ConstIterator begin() const throw() - { return ConstIterator(static_cast<DLinkedItem*>(_data->next)); } + size_type max_size() const + { return size_type(-1); } - Iterator end() throw() - { return Iterator(_data); } + void resize(size_type __new_size, const value_type& __x) + { + write_lock lck(_mutex); + BaseType::resize(__new_size, __x); + } - ConstIterator end() const throw() - { return ConstIterator(_data); } + void resize(size_type __new_size) + { + write_lock lck(_mutex); + BaseType::resize(__new_size, value_type()); + } - Type& front() throw() + value_type front() { return *begin(); } - const Type& front() const throw() + value_type front() const { return *begin(); } - Type& back() throw() + value_type back() { return *(--end()); } - const Type& back() const throw() + value_type back() const { return *(--end()); } - Iterator insert(Iterator pos, const Type& val) - { - DLinkedItem* tmp = - new DLinkedItem(static_cast<DLinkedItem*>(pos.node()->prev), - val, static_cast<DLinkedItem*>(pos.node())); - pos.node()->prev->next = tmp; - pos.node()->prev = tmp; - return Iterator(tmp); + void push_front(const value_type& __x) + { + write_lock lck(_mutex); + BaseType::push_front(__x); } - template <class InputIterator> - void insert(Iterator pos, InputIterator first, InputIterator last) - { - for(; first != last; ++first) - insert(pos, *first); + void push_back(const value_type& __x) + { + write_lock lck(_mutex); + BaseType::push_back(__x); } - Iterator prepend(const Type& val) - { return insert(begin(), val); } - - Iterator append(const Type& val) - { return insert(end(), val); } + void pop_front() + { erase(begin()); } - Iterator erase(Iterator pos) throw() + void pop_back() { - DLinkedItemBase* next = pos.node()->next; - DLinkedItemBase* prev = pos.node()->prev; - DLinkedItem* n = static_cast<DLinkedItem*>(pos.node()); - prev->next = next; - next->prev = prev; - delete n; - return Iterator(static_cast<DLinkedItem*>(next)); + iterator __tmp = end(); + erase(--__tmp); } - Iterator erase(Iterator first, Iterator last) throw() + iterator insert(iterator __position, const value_type& __x) + { return iterator(BaseType::insert(__position, __x), _mutex); } + + void insert(iterator __pos, size_type __n, const value_type& __x) + { BaseType::insert(__pos, __n, __x); } + + template<typename _InputIterator> + void insert(iterator __pos, _InputIterator __first, _InputIterator __last) + { BaseType::insert(__pos, __first, __last); } + + iterator erase(iterator __position) + { return iterator(BaseType::erase(__position), _mutex); } + + iterator erase(iterator __first, iterator __last) { - for(; first != last; ++first) - erase(first); - return last; + while (__first != __last) + erase(__first++); + return __last; } - List& operator=(const List& rhs) - { - List(rhs).swap(*this); - return *this; + void swap(list& __x) + { + write_lock lck1(_mutex); + write_lock lck2(__x._mutex); + BaseType::swap(__x); } - bool operator==(const List& rhs) const - { - ConstIterator endlh = end(), ilh = begin(); - ConstIterator endrh = rhs.end(), irh = rhs.begin(); - while(ilh != endlh && irh != endrh && *ilh == *irh) - { - ++ilh; - ++irh; - } - return (ilh == endlh && irh == endrh); + void clear() + { + write_lock lck(_mutex); + BaseType::clear(); } private: - mutable DLinkedItem* _data; + mutable mutex_type _mutex; }; -template <class Type> -inline void swap(List<Type>& a, List<Type>& b) throw() -{ a.swap(b); } - } // !namespace P #endif |
From: Christian P. <cp...@us...> - 2005-01-23 13:29:05
|
Update of /cvsroot/pclasses/pclasses2/src/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17913/src/System Modified Files: Mutex.posix.cpp Log Message: Linux timed-mutex is not recursive!! Bad hack needed! - do not create timed mutex on linux (for now). Index: Mutex.posix.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/System/Mutex.posix.cpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- Mutex.posix.cpp 22 Dec 2004 17:54:36 -0000 1.1.1.1 +++ Mutex.posix.cpp 23 Jan 2005 13:28:55 -0000 1.2 @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2004 by Christian Prochnow * + * Copyright (C) 2004,2005 by Christian Prochnow * * cp...@se... * * * * This program is free software; you can redistribute it and/or modify * @@ -48,12 +48,13 @@ pthread_mutexattr_t attr; pthread_mutexattr_init(&attr); - // Linux needs this for timed locking to work - #ifdef PCLASSES_HAVE_PTHREAD_MUTEX_TIMED_NP - pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_TIMED_NP); - #else + // Linux needs this for timed locking to work + // @fixme .. linux timed-mutex is not recursive!!!!!!!!!! + //#ifdef PCLASSES_HAVE_PTHREAD_MUTEX_TIMED_NP + //pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_TIMED_NP); + //#else pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); - #endif + //#endif if(name) { |
From: Christian P. <cp...@us...> - 2005-01-23 13:28:11
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17607/include/pclasses/System Modified Files: Mutex.h CriticalSection.h Log Message: Added copy-ctor and assignment operator to Mutex::ScopedLock and CriticalSection::ScopedLock. Index: Mutex.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/System/Mutex.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- Mutex.h 22 Dec 2004 17:54:42 -0000 1.1.1.1 +++ Mutex.h 23 Jan 2005 13:28:00 -0000 1.2 @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2004 by Christian Prochnow * + * Copyright (C) 2004,2005 by Christian Prochnow * * cp...@se... * * * * This program is free software; you can redistribute it and/or modify * @@ -126,13 +126,16 @@ } \endcode */ - class ScopedLock: public NonCopyable { + class ScopedLock { public: ScopedLock(Mutex& mutex) throw(SystemError); + ScopedLock(const ScopedLock& lck) throw(SystemError); ~ScopedLock() throw(); void release() throw(SystemError); + ScopedLock& operator=(Mutex& mutex) throw(SystemError); + ScopedLock& operator=(const ScopedLock& lck) throw(SystemError); private: Mutex* _mutex; Index: CriticalSection.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/System/CriticalSection.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- CriticalSection.h 22 Dec 2004 17:54:41 -0000 1.1.1.1 +++ CriticalSection.h 23 Jan 2005 13:28:00 -0000 1.2 @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2004 by Christian Prochnow * + * Copyright (C) 2004,2005 by Christian Prochnow * * cp...@se... * * * * This program is free software; you can redistribute it and/or modify * @@ -81,13 +81,16 @@ } \endcode */ - class ScopedLock: public NonCopyable { + class ScopedLock { public: ScopedLock(CriticalSection& cs) throw(); + ScopedLock(const ScopedLock& lck) throw(); ~ScopedLock() throw(); void release() throw(); + ScopedLock& operator=(CriticalSection& cs) throw(); + ScopedLock& operator=(const ScopedLock& lck) throw(); private: CriticalSection* _cs; |
From: Christian P. <cp...@us...> - 2005-01-23 13:28:10
|
Update of /cvsroot/pclasses/pclasses2/src/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17607/src/System Modified Files: Mutex.cpp CriticalSection.cpp Log Message: Added copy-ctor and assignment operator to Mutex::ScopedLock and CriticalSection::ScopedLock. Index: CriticalSection.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/System/CriticalSection.cpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- CriticalSection.cpp 22 Dec 2004 17:54:36 -0000 1.1.1.1 +++ CriticalSection.cpp 23 Jan 2005 13:28:00 -0000 1.2 @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2004 by Christian Prochnow * + * Copyright (C) 2004,2005 by Christian Prochnow * * cp...@se... * * * * This program is free software; you can redistribute it and/or modify * @@ -30,6 +30,13 @@ cs.lock(); } +CriticalSection::ScopedLock::ScopedLock(const ScopedLock& lck) throw() +: _cs(lck._cs) +{ + if(_cs) + _cs->lock(); +} + CriticalSection::ScopedLock::~ScopedLock() throw() { release(); @@ -53,6 +60,16 @@ return *this; } +CriticalSection::ScopedLock& + CriticalSection::ScopedLock::operator=(const ScopedLock& lck) throw() +{ + release(); + _cs = lck._cs; + if(_cs) + _cs->lock(); + return *this; +} + } // !namespace System } // !namespace P Index: Mutex.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/System/Mutex.cpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- Mutex.cpp 22 Dec 2004 17:54:35 -0000 1.1.1.1 +++ Mutex.cpp 23 Jan 2005 13:28:00 -0000 1.2 @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2004 by Christian Prochnow * + * Copyright (C) 2004,2005 by Christian Prochnow * * cp...@se... * * * * This program is free software; you can redistribute it and/or modify * @@ -30,6 +30,13 @@ mutex.lock(); } +Mutex::ScopedLock::ScopedLock(const ScopedLock& lck) throw(SystemError) +: _mutex(lck._mutex) +{ + if(_mutex) + _mutex->lock(); +} + Mutex::ScopedLock::~ScopedLock() throw() { try { release(); } @@ -54,6 +61,17 @@ return *this; } +Mutex::ScopedLock& Mutex::ScopedLock::operator=(const ScopedLock& lck) + throw(SystemError) +{ + release(); + _mutex = lck._mutex; + if(_mutex) + _mutex->lock(); + return *this; +} + + } // !namespace System } // !namespace P |
From: stephan b. <sg...@us...> - 2005-01-23 01:15:53
|
Update of /cvsroot/pclasses/pclasses2/doc/manual In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15635 Modified Files: pclasses2.lyx Log Message: 3rd commit attempt: insigificantly small text changes Index: pclasses2.lyx =================================================================== RCS file: /cvsroot/pclasses/pclasses2/doc/manual/pclasses2.lyx,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- pclasses2.lyx 20 Jan 2005 01:44:10 -0000 1.7 +++ pclasses2.lyx 23 Jan 2005 01:15:42 -0000 1.8 @@ -63,9 +63,12 @@ What is P::Classes? \layout Standard -P::Classes, or simply P, is a C++ library aiming to provide a generic applicatio -n framework. - Thing +P::Classes, or simply P, is a C++ library aiming to provide +\emph on +the +\emph default + generic application framework. + Think \begin_inset Quotes sld \end_inset @@ -223,6 +226,9 @@ \layout Subsection Credits +\layout Standard + +In approximate order of appearance... \layout Itemize Christian Prochnow (Germany): author, project lead and main developer. @@ -254,7 +260,7 @@ Gregor Jehle (Germany): w-w-webmaster. \layout Itemize -Bernhard Hieke (Germany): father figure and a really nice guy. +Bernhard Hieke (Germany): funder, father figure, and a hell of a nice guy. \layout Itemize stephan beal (Germany): likes to write docs and break old code/conventions. @@ -283,6 +289,9 @@ Unicode: Unicode string support. \layout Itemize +Crypto: cryptography and hashing support. +\layout Itemize + IO: device-independent i/o support. \layout Itemize @@ -295,13 +304,10 @@ Net: network-transparent i/o support. \layout Itemize -SQL: db-neutral SQL support. -\layout Itemize - Util: general utility code. \layout Itemize -Crypto: cryptography and hasing support. +SQL: db-neutral SQL support. \layout Itemize SIO: @@ -454,6 +460,14 @@ Here are some of the options: \layout Paragraph +Basic approach +\layout Standard + + +\color red +TODO: document the macros Christian posted in mid-January. +\layout Paragraph + Supermacro \layout Standard |
From: stephan b. <sg...@us...> - 2005-01-23 01:13:31
|
Update of /cvsroot/pclasses/pclasses2/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15123 Modified Files: Date.cpp Log Message: added a cast to avoid a warning "comp between unsigned/signed" Index: Date.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/Date.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Date.cpp 19 Jan 2005 23:31:01 -0000 1.4 +++ Date.cpp 23 Jan 2005 01:13:20 -0000 1.5 @@ -173,8 +173,8 @@ Date& Date::operator+=(const TimeSpan& sp) throw() { - int tmp = (int)_day + sp.days(); - while ( tmp && tmp > daysInMonth(_month, _year) ) + int tmp = (int)_day + sp.days(); + while ( tmp && tmp > (int)daysInMonth(_month, _year) ) { tmp -= daysInMonth(_month, _year); if ( _month == 2 && isInLeapYear() ) |
From: Loof, D. <dl...@us...> - 2005-01-22 10:31:08
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19234/include/pclasses Modified Files: DateTime.h Log Message: add export Index: DateTime.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/DateTime.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- DateTime.h 22 Jan 2005 10:17:26 -0000 1.5 +++ DateTime.h 22 Jan 2005 10:30:59 -0000 1.6 @@ -60,8 +60,8 @@ DateTime& operator+=(const TimeSpan& sp) throw(); DateTime& operator-=(const TimeSpan& sp) throw(); - friend DateTime operator+(const DateTime& dt, const TimeSpan& sp) throw(); - friend DateTime operator-(const DateTime& dt, const TimeSpan& sp) throw(); + friend PCORE_EXPORT DateTime operator+(const DateTime& dt, const TimeSpan& sp) throw(); + friend PCORE_EXPORT DateTime operator-(const DateTime& dt, const TimeSpan& sp) throw(); static DateTime fromTime_t(time_t t) throw(); |
From: Loof, D. <dl...@us...> - 2005-01-22 10:17:36
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17168/include/pclasses Modified Files: DateTime.h Log Message: add operators Index: DateTime.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/DateTime.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- DateTime.h 20 Jan 2005 22:49:40 -0000 1.4 +++ DateTime.h 22 Jan 2005 10:17:26 -0000 1.5 @@ -24,6 +24,7 @@ #include <pclasses/Export.h> #include <pclasses/Date.h> #include <pclasses/Time.h> +#include <pclasses/TimeSpan.h> #include <string> #include <iostream> @@ -56,6 +57,12 @@ bool operator==(const DateTime& dt) const throw(); bool operator!=(const DateTime& dt) const throw(); + DateTime& operator+=(const TimeSpan& sp) throw(); + DateTime& operator-=(const TimeSpan& sp) throw(); + + friend DateTime operator+(const DateTime& dt, const TimeSpan& sp) throw(); + friend DateTime operator-(const DateTime& dt, const TimeSpan& sp) throw(); + static DateTime fromTime_t(time_t t) throw(); friend PCORE_EXPORT std::ostream& operator << (std::ostream& os, const DateTime& dt); |
From: Loof, D. <dl...@us...> - 2005-01-22 10:17:35
|
Update of /cvsroot/pclasses/pclasses2/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17168/src Modified Files: DateTime.cpp Log Message: add operators Index: DateTime.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/DateTime.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- DateTime.cpp 27 Dec 2004 06:57:05 -0000 1.3 +++ DateTime.cpp 22 Jan 2005 10:17:25 -0000 1.4 @@ -119,6 +119,101 @@ Time(ltm->tm_hour, ltm->tm_min, ltm->tm_sec)); } +DateTime& DateTime::operator+=(const TimeSpan& sp) throw() +{ + unsigned int dayoverflow = 0; + unsigned int tmp = usec() + sp.usecs(); + if ( tmp > (1000 * 1000) - 1 ) + { + tmp -= 1000 * 1000; + setSecond(second() + 1); + } + setUsec(tmp); + + tmp = second() + sp.seconds(); + if ( tmp > 59 ) + { + tmp -= 60; + setMinute(minute() + 1); + } + setSecond(tmp); + + tmp = minute() + sp.minutes(); + if ( tmp > 59 ) + { + tmp -= 60; + setHour(hour() + 1); + } + setMinute(tmp); + + tmp = hour() + sp.hours(); + if ( tmp > 23 ) + { + tmp -= 24; + ++dayoverflow; + } + setHour(tmp); + + TimeSpan tmpts(sp.days() + dayoverflow); + Date::operator+=(tmpts); + + return *this; +} + +DateTime& DateTime::operator-=(const TimeSpan& sp) throw() +{ + unsigned int underflow = 0; + int tmp = usec() - sp.usecs(); + if ( tmp < 0 ) + { + tmp += 1000 * 1000; + setSecond(second() - 1); + } + setUsec(tmp); + + tmp = second() - sp.seconds(); + if ( tmp < 0 ) + { + tmp += 60; + setMinute(minute() -1); + } + setSecond(tmp); + + tmp = minute() - sp.minutes(); + if ( tmp < 0 ) + { + tmp += 60; + setHour(hour() -1); + } + setMinute(tmp); + + tmp = hour() - sp.hours(); + if ( tmp < 0 ) + { + tmp += 24; + ++underflow; + } + setHour(tmp); + + TimeSpan tmpts(sp.days() + underflow); + Date::operator-=(tmpts); + return *this; +} + +DateTime operator+(const DateTime& dt, const TimeSpan& sp) throw() +{ + DateTime ret = dt; + ret += sp; + return ret; +} + +DateTime operator-(const DateTime& dt, const TimeSpan& sp) throw() +{ + DateTime ret = dt; + ret -= sp; + return ret; +} + std::ostream& operator << (std::ostream& os, const DateTime& dt) { os << (Date&)dt << ' ' << (Time&)dt << ' ' << dt.timeZone(); |
From: Marc D. <ma...@us...> - 2005-01-21 14:51:18
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30878/pclasses2/include/pclasses Modified Files: Signal.h Log Message: template related fixes for gcc 3.4.x. Index: Signal.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Signal.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Signal.h 11 Jan 2005 14:50:52 -0000 1.3 +++ Signal.h 21 Jan 2005 14:51:10 -0000 1.4 @@ -97,11 +97,14 @@ template <typename RetType> class Signal0: public SignalBase0<RetType> { public: + typedef SignalBase0<RetType> BaseType; + + public: RetType fire() const { RetType ret = RetType(); - typename CallbackList::const_iterator i = _slots.begin(); - while(i != _slots.end()) + typename BaseType::CallbackList::const_iterator i = this->_slots.begin(); + while(i != this->_slots.end()) { ret = (*i)->exec(); if(ret) @@ -161,12 +164,14 @@ //! Signal with one argument template <typename RetType, typename ArgType1> class Signal1: public SignalBase1<RetType, ArgType1> { + typedef SignalBase1<RetType, ArgType1> BaseType; + public: RetType fire(ArgType1 arg1) const { RetType ret = RetType(); - typename CallbackList::const_iterator i = _slots.begin(); - while(i != _slots.end()) + typename BaseType::CallbackList::const_iterator i = this->_slots.begin(); + while(i != this->_slots.end()) { ret = (*i)->exec(arg1); if(ret) @@ -181,11 +186,13 @@ //! Signal with one arguments (void specialisation) template <typename ArgType1> class Signal1<void, ArgType1>: public SignalBase1<void, ArgType1> { + typedef SignalBase1<void, ArgType1> BaseType; + public: void fire(ArgType1 arg1) const { - typename CallbackList::const_iterator i = _slots.begin(); - while(i != _slots.end()) + typename BaseType::CallbackList::const_iterator i = this->_slots.begin(); + while(i != this->_slots.end()) { (*i)->exec(arg1); ++i; @@ -227,12 +234,14 @@ //! Signal with two arguments template <typename RetType, typename ArgType1, typename ArgType2> class Signal2: public SignalBase2<RetType, ArgType1, ArgType2> { + typedef SignalBase2<RetType, ArgType1, ArgType2> BaseType; + public: RetType fire(ArgType1 arg1, ArgType2 arg2) const { RetType ret = RetType(); - typename CallbackList::const_iterator i = _slots.begin(); - while(i != _slots.end()) + typename BaseType::CallbackList::const_iterator i = this->_slots.begin(); + while(i != this->_slots.end()) { ret = (*i)->exec(arg1, arg2); if(ret) @@ -247,11 +256,12 @@ //! Signal with two arguments (void specialisation) template <typename ArgType1, typename ArgType2> class Signal2<void, ArgType1, ArgType2>: public SignalBase2<void, ArgType1, ArgType2> { + typedef SignalBase2<void, ArgType1, ArgType2> BaseType; public: void fire(ArgType1 arg1, ArgType2 arg2) const { - typename CallbackList::const_iterator i = _slots.begin(); - while(i != _slots.end()) + typename BaseType::CallbackList::const_iterator i = this->_slots.begin(); + while(i != this->_slots.end()) { (*i)->exec(arg1, arg2); ++i; |
From: Christian P. <cp...@us...> - 2005-01-21 10:27:12
|
Update of /cvsroot/pclasses/pclasses2/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5366/test Modified Files: CmdLineTest.cpp Log Message: Updated the CmdLineTest app. Index: CmdLineTest.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/test/CmdLineTest.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- CmdLineTest.cpp 20 Jan 2005 19:56:30 -0000 1.2 +++ CmdLineTest.cpp 21 Jan 2005 10:26:55 -0000 1.3 @@ -20,25 +20,28 @@ #include "Test.h" #include "pclasses/App/CmdLine.h" +#include "Test.h" using namespace P; using namespace P::App; -CmdLineFlag cmdLineOpt1("f", "flag", "Test flag (optional)"); -CmdLineValue cmdLineVal1("v", "value", "Test value"); -CmdLineValue cmdLineVal2("v2", "value2", "Test value with default", -"testdefault"); - -CmdLineOption* opts[] = { - &cmdLineOpt1, - &cmdLineVal1, - &cmdLineVal2, - 0 -}; - int main(int argc, char* argv[]) { + CmdLineFlag cmdLineHelp("h", "help", "Show this help"); + CmdLineFlag cmdLineOpt1("f", "flag", "Test flag (optional)"); + CmdLineValue cmdLineVal1("v", "value", "Test value"); + + CmdLineValue cmdLineVal2("v2", "value2", "Test value with default"); + cmdLineVal2.setValue("default"); + + CmdLineOption* opts[] = { + &cmdLineOpt1, + &cmdLineVal1, + &cmdLineVal2, + 0 + }; + CmdLineParser p(opts); try { @@ -47,8 +50,19 @@ catch(CmdLineError& err) { std::cout << err.what() << std::endl; - std::cout << "Usage:" << std::endl; + std::cout << "Available options:" << std::endl; + p.dumpHelp(std::cout); + } + + if(cmdLineHelp.isset()) + { p.dumpHelp(std::cout); } + else + { + std::cout << "f set: " << cmdLineOpt1.isset() << std::endl; + std::cout << "v value: '" << cmdLineVal1.value() << "'" << std::endl; + std::cout << "v2 value: '" << cmdLineVal2.value() << "'" << std::endl; + } } |
From: Christian P. <cp...@us...> - 2005-01-21 09:21:17
|
Update of /cvsroot/pclasses/pclasses2/src/App In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24324/src/App Modified Files: CmdLine.cpp Log Message: Removed default values from ctor. Index: CmdLine.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/App/CmdLine.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- CmdLine.cpp 20 Jan 2005 19:56:29 -0000 1.4 +++ CmdLine.cpp 21 Jan 2005 09:21:07 -0000 1.5 @@ -21,7 +21,7 @@ #include "pclasses/App/CmdLine.h" #include <sstream> #include <iomanip> -#include <iostream> +#include <list> namespace P { @@ -71,10 +71,8 @@ } CmdLineFlag::CmdLineFlag(const std::string& shortOpt, - const std::string& longOpt, const std::string& helpText, - bool defaultVal, bool required) -: CmdLineOption(shortOpt, longOpt, helpText, required, false), - _defaultVal(defaultVal) + const std::string& longOpt, const std::string& helpText, bool required) +: CmdLineOption(shortOpt, longOpt, helpText, required, false) { } @@ -95,18 +93,16 @@ CmdLineValue::CmdLineValue(const std::string& shortOpt, - const std::string& longOpt, const std::string& helpText, - const std::string& defaultVal) -: CmdLineOption(shortOpt, longOpt, helpText, false, true), - _defaultVal(defaultVal) + const std::string& longOpt, const std::string& helpText) +: CmdLineOption(shortOpt, longOpt, helpText, false, true) { + _isset = true; } CmdLineValue::CmdLineValue(const std::string& shortOpt, const std::string& longOpt, const std::string& helpText, bool required) -: CmdLineOption(shortOpt, longOpt, helpText, required, true), - _defaultVal("") +: CmdLineOption(shortOpt, longOpt, helpText, required, true) { } @@ -176,18 +172,19 @@ void CmdLineParser::parse(int argc, char* argv[]) throw(CmdLineError) { _unnamedValues.clear(); - CmdLineOption* opt = 0; - std::string optName, optVal; + CmdLineOption* opt = 0; + std::list<CmdLineOption*> foundOpts; std::string tmp; for(int i = 1; i < argc; ++i) { tmp = argv[i]; - if(tmp.size() > 1 && tmp[0] == '-') + if(!opt && tmp.size() > 1 && tmp[0] == '-') { bool isLongOpt = false; + std::string optName, optVal; // long option? if(tmp.size() > 2 && tmp[1] == '-') @@ -217,7 +214,7 @@ // unknown option ... if(!opt) - throw CmdLineError("Unknown command line option: " + + throw CmdLineError("Unknown command-line argument: " + std::string(argv[i]), P_SOURCEINFO); // do we have value for this option ....? @@ -225,12 +222,14 @@ // option values for flags are simply discarded if(pos != std::string::npos) { + foundOpts.push_back(opt); opt->setValue(optVal); opt = 0; } // option does not need a value... else if(!opt->needValue()) { + foundOpts.push_back(opt); opt->setValue(std::string()); opt = 0; } @@ -241,6 +240,7 @@ // the value is for the current option... if(opt) { + foundOpts.push_back(opt); opt->setValue(tmp); opt = 0; } @@ -251,6 +251,50 @@ } } } + + // we started parsing a option, but the value is missing. + if(opt) + { + std::ostringstream errOs; + errOs << "Value for command-line argument '"; + if(opt->shortName().size() > 0) + errOs << "-" << opt->shortName(); + else + errOs << "--" << opt->longName(); + errOs << "' is missing." << std::endl; + + throw CmdLineError(errOs.str(), P_SOURCEINFO); + } + + // search for required option which where not found + int i = 0; + while(_opts[i]) + { + if(*foundOpts.begin() == _opts[i]) + { + // we processed this option .. remove it from the foundOpts list + foundOpts.erase(foundOpts.begin()); + } + else + { + // this options is required .. and we did not process it + // do not yiel the error when !isset() (respects default values) + if(_opts[i]->required() && !_opts[i]->isset()) + { + std::ostringstream errOs; + errOs << "Required command-line argument '"; + if(_opts[i]->shortName().size() > 0) + errOs << "-" << _opts[i]->shortName(); + else + errOs << "--" << _opts[i]->longName(); + errOs << "' missing." << std::endl; + + throw CmdLineError(errOs.str(), P_SOURCEINFO); + } + } + + ++i; + } } const std::string& CmdLineParser::value(unsigned int index) const @@ -269,6 +313,7 @@ void CmdLineParser::parse(const std::string& cmdline) throw(CmdLineError) { + //@fixme throw CmdLineError("Not implemented", P_SOURCEINFO); } |
From: Christian P. <cp...@us...> - 2005-01-21 09:21:15
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/App In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24324/include/pclasses/App Modified Files: CmdLine.h Log Message: Removed default values from ctor. Index: CmdLine.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/App/CmdLine.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- CmdLine.h 20 Jan 2005 19:56:29 -0000 1.4 +++ CmdLine.h 21 Jan 2005 09:21:07 -0000 1.5 @@ -68,26 +68,23 @@ class PAPP_EXPORT CmdLineFlag: public CmdLineOption { public: CmdLineFlag(const std::string& shortOpt, const std::string& longOpt, - const std::string& helpText, bool defaultVal = false, - bool required = false); + const std::string& helpText, bool required = false); ~CmdLineFlag(); void setValue(const std::string& val); std::string value() const throw(); - private: - bool _defaultVal; }; //! Command-line value class PAPP_EXPORT CmdLineValue: public CmdLineOption { public: CmdLineValue(const std::string& shortOpt, const std::string& longOpt, - const std::string& helpText, const std::string& defaultVal); + const std::string& helpText); CmdLineValue(const std::string& shortOpt, const std::string& longOpt, - const std::string& helpText, bool requird = false); + const std::string& helpText, bool required); ~CmdLineValue(); @@ -95,7 +92,6 @@ std::string value() const throw(); private: - std::string _defaultVal; std::string _value; }; |
From: Christian P. <cp...@us...> - 2005-01-20 22:51:04
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24344/include/pclasses Modified Files: TimeSpan.h Log Message: Added export macros. Index: TimeSpan.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/TimeSpan.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- TimeSpan.h 26 Dec 2004 16:45:49 -0000 1.1 +++ TimeSpan.h 20 Jan 2005 22:50:56 -0000 1.2 @@ -21,6 +21,7 @@ #ifndef P_TimeSpan_h #define P_TimeSpan_h +#include <pclasses/Export.h> #include <pclasses/Exception.h> namespace P { @@ -30,7 +31,7 @@ This class is used to add or subtract a timespan from a Date, Time or DateTime object. */ -class TimeSpan { +class PCORE_EXPORT TimeSpan { public: TimeSpan(unsigned int days = 0, unsigned int hours = 0, unsigned int minutes = 0, unsigned int seconds = 0, @@ -66,10 +67,10 @@ TimeSpan& operator+=(const TimeSpan& sp) throw(OverflowError); TimeSpan& operator-=(const TimeSpan& sp) throw(); - friend TimeSpan operator+(const TimeSpan& sp1, const TimeSpan& sp2) + friend PCORE_EXPORT TimeSpan operator+(const TimeSpan& sp1, const TimeSpan& sp2) throw(OverflowError); - friend TimeSpan operator-(const TimeSpan& sp1, const TimeSpan& sp2) + friend PCORE_EXPORT TimeSpan operator-(const TimeSpan& sp1, const TimeSpan& sp2) throw(); private: |
From: Christian P. <cp...@us...> - 2005-01-20 22:49:49
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23953/include/pclasses Modified Files: Date.h DateTime.h Time.h Log Message: Added export macros. Index: Date.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Date.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Date.h 19 Jan 2005 16:25:58 -0000 1.3 +++ Date.h 20 Jan 2005 22:49:40 -0000 1.4 @@ -21,6 +21,7 @@ #ifndef P_Date_h #define P_Date_h +#include <pclasses/Export.h> #include <pclasses/Exception.h> #include <pclasses/TimeSpan.h> #include <iostream> @@ -35,7 +36,7 @@ }; //! Date class -class Date { +class PCORE_EXPORT Date { public: //! Enumeration of weekdays enum weekDay_t { @@ -104,8 +105,8 @@ Date& operator+=(const TimeSpan& sp) throw(); Date& operator-=(const TimeSpan& sp) throw(); - friend Date operator+(const Date& d, const TimeSpan& sp) throw(); - friend Date operator-(const Date& d, const TimeSpan& sp) throw(); + friend PCORE_EXPORT Date operator+(const Date& d, const TimeSpan& sp) throw(); + friend PCORE_EXPORT Date operator-(const Date& d, const TimeSpan& sp) throw(); //! Returns the number of days in month static unsigned int daysInMonth(unsigned int month, unsigned int year) @@ -114,7 +115,7 @@ //! Test if the given year is a leap year static bool isLeapYear(unsigned int year) throw(); - friend std::ostream& operator << (std::ostream& os, const Date& d); + friend PCORE_EXPORT std::ostream& operator << (std::ostream& os, const Date& d); private: unsigned short _year; Index: Time.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Time.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Time.h 19 Jan 2005 18:49:38 -0000 1.3 +++ Time.h 20 Jan 2005 22:49:40 -0000 1.4 @@ -21,6 +21,7 @@ #ifndef P_Time_h #define P_Time_h +#include <pclasses/Export.h> #include <pclasses/Exception.h> #include <pclasses/TimeSpan.h> #include <iostream> @@ -35,7 +36,7 @@ }; //! Time class -class Time { +class PCORE_EXPORT Time { public: Time(unsigned int hour = 0, unsigned int minute = 0, unsigned int second = 0, unsigned int usec = 0) throw(InvalidTime); @@ -68,10 +69,10 @@ Time& operator+=(const TimeSpan& sp) throw(); Time& operator-=(const TimeSpan& sp) throw(); - friend Time operator+(const Time& t, const TimeSpan& sp) throw(); - friend Time operator-(const Time& t, const TimeSpan& sp) throw(); + friend PCORE_EXPORT Time operator+(const Time& t, const TimeSpan& sp) throw(); + friend PCORE_EXPORT Time operator-(const Time& t, const TimeSpan& sp) throw(); - friend std::ostream& operator << (std::ostream& os, const Time& t); + friend PCORE_EXPORT std::ostream& operator << (std::ostream& os, const Time& t); private: unsigned char _hour; Index: DateTime.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/DateTime.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- DateTime.h 27 Dec 2004 06:57:05 -0000 1.3 +++ DateTime.h 20 Jan 2005 22:49:40 -0000 1.4 @@ -21,6 +21,7 @@ #ifndef P_DateTime_h #define P_DateTime_h +#include <pclasses/Export.h> #include <pclasses/Date.h> #include <pclasses/Time.h> @@ -31,7 +32,7 @@ namespace P { //! Date/time class -class DateTime: public Date, public Time { +class PCORE_EXPORT DateTime: public Date, public Time { public: DateTime(); DateTime(const Date& d, const Time& t, const std::string& tzname = ""); @@ -57,7 +58,7 @@ static DateTime fromTime_t(time_t t) throw(); - friend std::ostream& operator << (std::ostream& os, const DateTime& dt); + friend PCORE_EXPORT std::ostream& operator << (std::ostream& os, const DateTime& dt); private: std::string _tzname; |