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-05-07 11:56:01
|
Update of /cvsroot/pclasses/pclasses2/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29688/src Modified Files: Factory.cpp Log Message: - Added thread-safety to Factory and System::Plugin Index: Factory.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/Factory.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Factory.cpp 6 May 2005 15:16:01 -0000 1.1 +++ Factory.cpp 7 May 2005 11:55:47 -0000 1.2 @@ -46,7 +46,7 @@ } FactoryBase* findFactory(const std::string& ifaceType, - const std::string& contextType) + const std::string& contextType) const { FactoryMap::const_iterator i = _factories.find(std::make_pair(ifaceType,contextType)); @@ -54,15 +54,23 @@ return i != _factories.end() ? i->second : 0; } + CoreMutex& mutex() + { + return _mutex; + } + private: FactoryInstanceMap() {} ~FactoryInstanceMap() {} FactoryMap _factories; + CoreMutex _mutex; }; typedef std::list<FactoryBase::LoaderFunc> FactoryLoaderList; + FactoryLoaderList FactoryLoaders; +CoreMutex FactoryLoadersMutex; FactoryBase::FactoryBase() { @@ -78,6 +86,7 @@ P_TRACE_GLOBAL() << "FactoryBase::loadType() running loaders for ifaceType=" << ifaceType << ", contextType=" << contextType << ", key=" << key; + CoreMutex::ScopedLock lck(FactoryLoadersMutex); FactoryLoaderList::const_iterator i = FactoryLoaders.begin(); while(i != FactoryLoaders.end()) { @@ -88,6 +97,7 @@ void FactoryBase::registerLoader(LoaderFunc lf) { + CoreMutex::ScopedLock lck(FactoryLoadersMutex); FactoryLoaders.push_back(lf); } @@ -95,6 +105,8 @@ const std::string& contextType, FactoryCreateFunc createFunc) { FactoryInstanceMap& instMap = FactoryInstanceMap::instance(); + + CoreMutex::ScopedLock(instMap.mutex()); FactoryBase* ret = instMap.findFactory(ifaceType, contextType); if(!ret) { |
From: Christian P. <cp...@us...> - 2005-05-07 11:55:59
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29688/include/pclasses/System Modified Files: Plugin.h Log Message: - Added thread-safety to Factory and System::Plugin Index: Plugin.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/System/Plugin.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Plugin.h 6 May 2005 15:22:46 -0000 1.1 +++ Plugin.h 7 May 2005 11:55:47 -0000 1.2 @@ -29,6 +29,7 @@ #include <pclasses/Unicode/String.h> #include <pclasses/System/PathFinder.h> #include <pclasses/System/SharedLib.h> +#include <pclasses/System/CriticalSection.h> #include <map> #include <string> @@ -38,6 +39,13 @@ namespace System { +//! Plugin manager +/*! + The plugin manager is used to dynamically load types from DLLs. + Upon application init a private type-loader hook is installed in + the FactoryBase. The type-loader gets called whenever an unknown + type-name is requested by a call to Factory<InterfaceT>::create(). +*/ class PSYSTEM_EXPORT PluginManager: public NonCopyable { public: typedef std::map<Unicode::String, SharedLib*> PluginMap; @@ -71,8 +79,9 @@ PluginManager(); ~PluginManager(); - PathFinderMap _pathFinders; - PluginMap _pluginMap; + PathFinderMap _pathFinders; + PluginMap _pluginMap; + CriticalSection _mutex; }; } // !namespace System |
From: Christian P. <cp...@us...> - 2005-05-07 11:55:59
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29688/include/pclasses Modified Files: Factory.h Log Message: - Added thread-safety to Factory and System::Plugin Index: Factory.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Factory.h,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- Factory.h 6 May 2005 15:16:01 -0000 1.22 +++ Factory.h 7 May 2005 11:55:47 -0000 1.23 @@ -28,6 +28,7 @@ #include <pclasses/Export.h> #include <pclasses/NonCopyable.h> #include <pclasses/SharingContext.h> +#include <pclasses/CoreMutex.h> #include <map> #include <list> @@ -42,6 +43,8 @@ will share the same Factory-instances. If we would put the instance- creation code into a template class each compilation unit will use it's own instance, leading to unwanted behaviour. + + All methods in this class are reentrant. */ class PCORE_EXPORT FactoryBase: public NonCopyable { public: @@ -113,6 +116,8 @@ Factory<InterfaceT> instantiations. ContextT is only used as a marker type, and is never instantiated by this class. Used cleverly, it can allow you quite a bit of freedom in what code has access to which factories. + + All methods in this class are reentrant. */ template <class InterfaceT, class ContextT = Sharing::FactoryContext> class Factory: FactoryBase { @@ -129,6 +134,7 @@ */ InterfaceT* create(const std::string& key) { + CoreMutex::ScopedLock lck(_mutex); std::string realKey = expandAlias(key); typename FactoryMap::const_iterator i = _factoryMap.find(realKey); @@ -166,6 +172,7 @@ P_TRACE(Factory) << "Register alias=" << aliasKey << " for key=" << isKey; + CoreMutex::ScopedLock lck(_mutex); _aliasMap.insert(std::make_pair(aliasKey, isKey)); } @@ -177,6 +184,7 @@ */ std::string expandAlias(const std::string& alias) const { + CoreMutex::ScopedLock lck(_mutex); P_TRACE(Factory) << "expandAlias("<<alias<<")"; typename AliasMap::const_iterator cit = _aliasMap.find(alias), cet = _aliasMap.end(); @@ -210,6 +218,7 @@ */ bool provides(const std::string& key) const { + CoreMutex::ScopedLock lck(_mutex); std::string realKey = expandAlias(key); typename FactoryMap::const_iterator i = _factoryMap.find(realKey); if(i == _factoryMap.end()) @@ -234,6 +243,7 @@ P_TRACE(Factory) << "registerFactory(): key=" << key << ", fc=" << typeid(fc).name(); + CoreMutex::ScopedLock lck(_mutex); _factoryMap.insert(std::make_pair(key, fc)); } @@ -269,6 +279,7 @@ FactoryMap _factoryMap; AliasMap _aliasMap; + mutable CoreMutex _mutex; }; } // !namespace P |
From: Christian P. <cp...@us...> - 2005-05-07 11:55:59
|
Update of /cvsroot/pclasses/pclasses2/src/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29688/src/System Modified Files: Plugin.cpp Log Message: - Added thread-safety to Factory and System::Plugin Index: Plugin.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/System/Plugin.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Plugin.cpp 6 May 2005 15:22:46 -0000 1.1 +++ Plugin.cpp 7 May 2005 11:55:47 -0000 1.2 @@ -59,12 +59,16 @@ const Directory d(dir); // throws on error d.begin(); // avoid 'unused var' warning. // ^^^ need to find a more elegant solution for that. + + CriticalSection::ScopedLock lck(_mutex); pathFinder(ifaceType).addPath( dir ); } SharedLib* PluginManager::addPlugin(const std::string& ifaceType, const Unicode::String& so_name) throw(SystemError) { + CriticalSection::ScopedLock lck(_mutex); + // look for cached entry: PluginMap::const_iterator it = _pluginMap.find( so_name ); if( _pluginMap.end() != it ) |
From: Christian P. <cp...@us...> - 2005-05-07 11:53:58
|
Update of /cvsroot/pclasses/pclasses2/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29272/src Modified Files: CoreMutex.posix.cpp Log Message: - CoreMutex must be recursive Index: CoreMutex.posix.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/CoreMutex.posix.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- CoreMutex.posix.cpp 6 May 2005 15:21:01 -0000 1.1 +++ CoreMutex.posix.cpp 7 May 2005 11:53:43 -0000 1.2 @@ -28,7 +28,11 @@ CoreMutex::CoreMutex() : _handle((unsigned long)new pthread_mutex_t) { - pthread_mutex_init((pthread_mutex_t*)_handle, 0); + pthread_mutexattr_t attrs; + pthread_mutexattr_init(&attrs); + pthread_mutexattr_settype(&attrs, PTHREAD_MUTEX_RECURSIVE); + pthread_mutex_init((pthread_mutex_t*)_handle, &attrs); + pthread_mutexattr_destroy(&attrs); } CoreMutex::~CoreMutex() |
From: Christian P. <cp...@us...> - 2005-05-07 11:52:19
|
Update of /cvsroot/pclasses/pclasses2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28775 Modified Files: configure.in Log Message: - Added --enable-debug to configure script Index: configure.in =================================================================== RCS file: /cvsroot/pclasses/pclasses2/configure.in,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- configure.in 28 Apr 2005 11:26:05 -0000 1.11 +++ configure.in 7 May 2005 11:52:11 -0000 1.12 @@ -39,6 +39,20 @@ dnl PC_CHECK_CXX_VISIBILITY +AC_MSG_CHECKING(whether to enable debugging) +debug_default="no" +AC_ARG_ENABLE(debug, [ --enable-debug=[no/yes] turn on debugging + [default=$debug_default]],, enable_debug=$debug_default) +if test "x$enable_debug" = "xyes"; then + CFLAGS="$CFLAGS -D_DEBUG" + CXXFLAGS="$CXXFLAGS -D_DEBUG" + AC_MSG_RESULT(yes) +else + CFLAGS="$CFLAGS -DNO_DEBUG" + CXXFLAGS="$CXXFLAGS -DNO_DEBUG" + AC_MSG_RESULT(no) +fi + dnl dnl compiling on big-endian architecture? dnl |
From: Christian P. <cp...@us...> - 2005-05-06 23:29:59
|
Update of /cvsroot/pclasses/pclasses2/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3997 Added Files: SocketTest.cpp Log Message: - Added SocketTest.cpp --- NEW FILE: SocketTest.cpp --- /*************************************************************************** * Copyright (C) 2005 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. * ***************************************************************************/ #include "pclasses/Net/Socket.h" #include "pclasses/Net/InetAddress.h" #include "Test.h" void SocketWritable(P::Net::SocketListener&) { std::cerr << "Socket is writable!" << std::endl; } void SocketReadable(P::Net::SocketListener&) { std::cerr << "Socket is readable!" << std::endl; } void SocketError(P::Net::SocketListener&) { std::cerr << "Socket is errorness!" << std::endl; } int main(int argc, char* argv[]) { P::Net::StreamSocket* s = new P::Net::StreamSocket(P::Net::Socket::Inet, 0); P::Net::SocketListener* l = new P::Net::SocketListener(*s); l->sigWrite.bind(P::make_function(&SocketWritable)); l->sigRead.bind(P::make_function(&SocketReadable)); l->sigError.bind(P::make_function(&SocketError)); s->connect(P::Net::InetAddress("192.168.1.1"), 80); P::System::EventQueue& evq = P::System::EventQueue::instance(); while(1) { P::System::Event ev; evq.wait(ev); std::cerr << "Dispatch." << std::endl; evq.dispatch(ev); } } |
From: Christian P. <cp...@us...> - 2005-05-06 23:27:53
|
Update of /cvsroot/pclasses/pclasses2/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3234 Modified Files: Makefile.am Added Files: TimerTest.cpp Log Message: - Added TimerTest.cpp Index: Makefile.am =================================================================== RCS file: /cvsroot/pclasses/pclasses2/test/Makefile.am,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- Makefile.am 1 Feb 2005 16:46:35 -0000 1.7 +++ Makefile.am 6 May 2005 23:27:44 -0000 1.8 @@ -2,7 +2,8 @@ METASOURCES = AUTO noinst_HEADERS = Test.h noinst_PROGRAMS = QueueTest StackTest IntTypeTest ListTest ThreadTest \ - StringTest IOTest SignalTest HTTPClientTest LogTest PtrTest CmdLineTest + StringTest IOTest SignalTest HTTPClientTest LogTest \ + PtrTest CmdLineTest SocketTest TimerTest PtrTest_SOURCES = PtrTest.cpp PtrTest_LDADD = $(top_builddir)/src/System/libpclasses_system.la $(top_builddir)/src/libpclasses.la QueueTest_SOURCES = QueueTest.cpp @@ -25,8 +26,9 @@ $(top_builddir)/src/IO/libpclasses_io.la $(top_builddir)/src/libpclasses.la -lz SignalTest_SOURCES = SignalTest.cpp HTTPClientTest_SOURCES = HTTPClientTest.cpp -HTTPClientTest_LDADD = $(top_builddir)/src/Net/libpclasses_net.la\ - $(top_builddir)/src/libpclasses.la +HTTPClientTest_LDADD = $(top_builddir)/src/libpclasses.la\ + $(top_builddir)/src/System/libpclasses_system.la\ + $(top_builddir)/src/Net/libpclasses_net.la LogTest_LDADD = $(top_builddir)/src/App/libpclasses_app.la\ $(top_builddir)/src/libpclasses.la LogTest_SOURCES = LogTest.cpp @@ -37,3 +39,13 @@ $(top_builddir)/src/App/libpclasses_app.la\ $(top_builddir)/src/libpclasses.la SignalTest_LDADD = $(top_builddir)/src/libpclasses.la +SocketTest_LDADD = $(top_builddir)/src/Unicode/libpclasses_unicode.la\ + $(top_builddir)/src/System/libpclasses_system.la\ + $(top_builddir)/src/Net/libpclasses_net.la\ + $(top_builddir)/src/IO/libpclasses_io.la\ + $(top_builddir)/src/libpclasses.la +SocketTest_SOURCES = SocketTest.cpp +TimerTest_LDADD = $(top_builddir)/src/App/libpclasses_app.la\ + $(top_builddir)/src/System/libpclasses_system.la\ + $(top_builddir)/src/libpclasses.la +TimerTest_SOURCES = TimerTest.cpp --- NEW FILE: TimerTest.cpp --- /*************************************************************************** * Copyright (C) 2005 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. * ***************************************************************************/ #include "pclasses/App/SimpleApp.h" #include "pclasses/System/Timer.h" #include <iostream> using namespace P; using namespace P::App; using namespace P::System; void timer1_expired() { std::cerr << "timer1 expired" << std::endl; } void timer2_expired() { std::cerr << "timer2 expired" << std::endl; } int main(int argc, char* argv[]) { AppDetails about; SimpleApp app(about); Timer t1; t1.start(2000, false); t1.sigExpired.bind(make_function(&timer1_expired)); Timer t2; t2.start(4000, true); t2.sigExpired.bind(make_function(&timer2_expired)); return app.run(argc, argv); } |
From: Christian P. <cp...@us...> - 2005-05-06 22:58:07
|
Update of /cvsroot/pclasses/pclasses2/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28136 Modified Files: LogTest.cpp Log Message: - Use new Factory Index: LogTest.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/test/LogTest.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- LogTest.cpp 20 Jan 2005 10:59:16 -0000 1.1 +++ LogTest.cpp 6 May 2005 22:57:59 -0000 1.2 @@ -20,7 +20,7 @@ #include "Test.h" #include "pclasses/IO/URL.h" -#include "pclasses/Plugin/Plugin.h" +#include "pclasses/System/Plugin.h" #include "pclasses/App/LogManager.h" #include "pclasses/App/LogTarget.h" #include "pclasses/App/LogChannel.h" @@ -32,15 +32,28 @@ public: void run() throw() { - Plugin::PluginManager<App::LogTarget>::instance().addPlugin("../plugins/LogTarget/Console/.libs/plog_console.so"); + System::PluginManager& pluginMgr = System::PluginManager::instance(); + + pluginMgr.addPluginDir<App::LogTarget>("../plugins/LogTarget/Console/.libs/"); + pluginMgr.addPluginDir<App::LogTarget>("../plugins/LogTarget/File/.libs/"); App::LogManager& logMgr = App::LogManager::instance(); App::LogChannel* globalChannel = logMgr.addChannel("global"); - App::LogTarget* target = logMgr.addTarget(globalChannel, "test2", "ConsoleLogTarget"); + App::LogTarget* target = logMgr.addTarget(globalChannel, "console", "ConsoleLogTarget"); target->open(IO::URL()); + App::LogTarget* target2 = logMgr.addTarget(globalChannel, "file", "FileLogTarget"); + target2->open(IO::URL("file:/home/cproch/logtest.log")); + (*globalChannel)(App::LogMessage::Debug) << "test" << std::endl; + (*globalChannel)(App::LogMessage::Info) << "test" << std::endl; + (*globalChannel)(App::LogMessage::Warning) << "test" << std::endl; + (*globalChannel)(App::LogMessage::Notice) << "test" << std::endl; + (*globalChannel)(App::LogMessage::Error) << "test" << std::endl; + + logMgr.removeTarget(globalChannel, "console"); + logMgr.removeTarget(globalChannel, "file"); } }; |
From: Christian P. <cp...@us...> - 2005-05-06 22:56:28
|
Update of /cvsroot/pclasses/pclasses2/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27686 Modified Files: ThreadTest.cpp Log Message: - Fix for long return-type of Thread::main() Index: ThreadTest.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/test/ThreadTest.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ThreadTest.cpp 28 Jan 2005 17:41:36 -0000 1.3 +++ ThreadTest.cpp 6 May 2005 22:56:19 -0000 1.4 @@ -32,7 +32,7 @@ : Thread(detach) { } - int main() + long main() { sleep(5000); if(detached()) |
From: Christian P. <cp...@us...> - 2005-05-06 16:13:46
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23170/include/pclasses/System Modified Files: Makefile.am Log Message: - Added Plugin.[h|cpp] Index: Makefile.am =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/System/Makefile.am,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- Makefile.am 14 Feb 2005 20:25:58 -0000 1.11 +++ Makefile.am 6 May 2005 16:13:07 -0000 1.12 @@ -5,4 +5,4 @@ pclasses_system_include_HEADERS = SystemError.h SharedMemory.h CriticalSection.h Mutex.h \ Condition.h Semaphore.h Thread.h SharedLib.h File.h FileInfo.h \ Directory.h SystemClock.h ProcessIO.h Process.h ThreadKey.h StorageDevice.h \ - IdeDevice.h Ps2Device.h SerialDevice.h EventQueue.h + EventQueue.h Timer.h IdeDevice.h Ps2Device.h SerialDevice.h Plugin.h |
From: Christian P. <cp...@us...> - 2005-05-06 16:13:45
|
Update of /cvsroot/pclasses/pclasses2/src/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23170/src/System Modified Files: Makefile.am Log Message: - Added Plugin.[h|cpp] Index: Makefile.am =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/System/Makefile.am,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- Makefile.am 25 Apr 2005 10:54:18 -0000 1.19 +++ Makefile.am 6 May 2005 16:13:07 -0000 1.20 @@ -56,13 +56,14 @@ if WITH_POSIX_IO IO_Sources = IOHandle.posix.cpp Pipe.posix.cpp File.posix.cpp \ FileInfo.posix.cpp Directory.posix.cpp Process.posix.cpp \ - FdListener.posix.cpp SignalListener.posix.cpp + FdListener.posix.cpp SignalListener.posix.cpp \ + SerialDevice.posix.cpp endif if WITH_WIN32_IO IO_Sources = IOHandle.win32.cpp Pipe.win32.cpp File.win32.cpp \ FileInfo.win32.cpp Directory.win32.cpp Process.win32.cpp \ - FdListener.win32.cpp + FdListener.win32.cpp SerialDevice.win32.cpp endif if WITH_POSIX_TIME @@ -73,8 +74,7 @@ Time_Sources = SystemClock.win32.cpp Timer.win32.cpp endif -System_Sources = CdRomDevice.linux.cpp Ps2Device.linux.cpp \ - SerialDevice.linux.cpp +System_Sources = CdRomDevice.linux.cpp Ps2Device.linux.cpp # IdeDevice.linux.cpp EXTRA_DIST = CriticalSection.generic.cpp CriticalSection.win32.cpp \ @@ -93,7 +93,8 @@ $(Semaphore_Sources) $(SharedMem_Sources) $(SharedLib_Sources) \ SharedLib.common.cpp FileInfo.common.cpp ProcessIO.cpp Process.common.cpp \ $(IO_Sources) File.common.cpp Pipe.common.cpp StorageDevice.common.cpp \ - $(Time_Sources) PathFinder.cpp $(System_Sources) EventQueue.cpp + $(Time_Sources) PathFinder.cpp $(System_Sources) EventQueue.cpp \ + Plugin.cpp libpclasses_system_la_LDFLAGS = -no-undefined |
From: Christian P. <cp...@us...> - 2005-05-06 16:09:48
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22726/include/pclasses Modified Files: Queue.h Log Message: - Added missing return Index: Queue.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Queue.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- Queue.h 22 Dec 2004 17:54:39 -0000 1.1.1.1 +++ Queue.h 6 May 2005 16:09:34 -0000 1.2 @@ -86,7 +86,7 @@ //! Returns the item-count currently in queue inline size_t count() const throw() - { /*@todo return LinkedItem::countAll(_front);*/ } + { /*@todo return LinkedItem::countAll(_front);*/ return 0; } //! Appends an item to the queue void push(const Type& val) |
From: Christian P. <cp...@us...> - 2005-05-06 16:09:28
|
Update of /cvsroot/pclasses/pclasses2/src/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22346/src/System Added Files: SerialDevice.posix.cpp Log Message: - Added the beginning of SerialDevice --- NEW FILE: SerialDevice.posix.cpp --- /*************************************************************************** * Copyright (C) 2005 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. * ***************************************************************************/ #include "pclasses/System/SerialDevice.h" #include "IOHandle.h" #include <termios.h> #include <unistd.h> #include <map> namespace P { namespace System { std::map<unsigned long, struct termios> SerialFlagsSave; void SerialDevice::init() throw(IO::IOError) { } void SerialDevice::setBaudRate(unsigned int baudRate) throw(IO::IOError) { if(_baudRate != baudRate) { } } void SerialDevice::setHardwareFlowControl(bool hwFlow) throw(IO::IOError) { if(_hwFlow != hwFlow) { _hwFlow = hwFlow; } } void SerialDevice::setSoftwareFlowControl(bool swFlow) throw(IO::IOError) { if(_swFlow != swFlow) { _swFlow = swFlow; } } } // !namespace System } // !namespace P |
From: Christian P. <cp...@us...> - 2005-05-06 16:09:28
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22346/include/pclasses/System Added Files: SerialDevice.h Log Message: - Added the beginning of SerialDevice --- NEW FILE: SerialDevice.h --- /*************************************************************************** * Copyright (C) 2005 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_System_SerialDevice_h #define P_System_SerialDevice_h #include <pclasses/Export.h> #include <pclasses/IO/IODevice.h> namespace P { namespace System { //! Serial device interface class class PSYSTEM_EXPORT SerialDevice: public IO::IODevice { public: enum Parity { None, Odd, Even }; SerialDevice() throw(); SerialDevice(const std::string& path, AccessMode access, ShareMode share) throw(IO::IOError); ~SerialDevice() throw(); void open(const std::string& path, AccessMode access, ShareMode share) throw(IO::IOError); void setBaudRate(unsigned int baudRate) throw(IO::IOError); unsigned int baudRate() const throw(); void setHardwareFlowControl(bool hwFlow) throw(IO::IOError); bool hardwareFlowControl() const throw(); void setSoftwareFlowControl(bool swFlow) throw(IO::IOError); bool softwareFlowControl() const throw(); protected: // IODevice related methods... void _close() throw(IO::IOError); size_t _read(char* buffer, size_t count) throw(IO::IOError); size_t _peek(char* buffer, size_t count) throw(IO::IOError); size_t _write(const char* buffer, size_t count) throw(IO::IOError); void _sync() const throw(IO::IOError); //! Returns the internal O/S handle unsigned long handle() const throw(); private: void init() throw(IO::IOError); unsigned long _handle; unsigned int _baudRate; bool _hwFlow; bool _swFlow; }; } // !namespace System } // !namespace P #endif |
From: Christian P. <cp...@us...> - 2005-05-06 16:07:50
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22111/include/pclasses/System Modified Files: Directory.h Log Message: - Added missing export macro Index: Directory.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/System/Directory.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Directory.h 27 Dec 2004 07:04:48 -0000 1.2 +++ Directory.h 6 May 2005 16:07:40 -0000 1.3 @@ -21,11 +21,10 @@ #ifndef P_System_Directory_h #define P_System_Directory_h -#include <pclasses/pclasses-config.h> +#include <pclasses/Export.h> #include <pclasses/Unicode/String.h> #include <pclasses/IO/IOError.h> -#include <string> #include <list> namespace P { @@ -33,7 +32,7 @@ namespace System { //! Filesystem Directory class -class Directory { +class PSYSTEM_EXPORT Directory { public: typedef std::list<Unicode::String> EntryList; typedef EntryList::const_iterator Iterator; |
From: Christian P. <cp...@us...> - 2005-05-06 15:32:24
|
Update of /cvsroot/pclasses/pclasses2/src/Unicode In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12388/src/Unicode Modified Files: Char.cpp Makefile.am String.cpp uctype.cpp unicodedata.cpp unicodedata.h ustring.cpp Added Files: genunicodedata.cpp Log Message: - Added c++ tool for generating unicode database. - More work on Unicode support. --- NEW FILE: genunicodedata.cpp --- /*************************************************************************** * Copyright (C) 2005 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. * ***************************************************************************/ #include <iostream> #include <fstream> #include <sstream> #include <string> #include <vector> #include <map> #include "unicodedata.h" using namespace std; using namespace P::Unicode; unsigned int line = 1; unsigned int letterCasemapNum = 0; unsigned int numberMappingNum = 0; unsigned int decompCharsNum = 0; map<string, Category> categoryMap; map<string, BidiClass> bidiClassMap; map<string, Decomposition> decompMap; std::string mirrored_to_bool(const std::string& m) { if(m == "Y") return "true"; else if(m == "N") return "false"; cerr << "Line " << line << ": Warning unknown mirrored property: " << m << endl; return "false"; } Category string_to_category(const std::string& cat) { map<string, Category>::const_iterator i = categoryMap.find(cat); if(i != categoryMap.end()) return i->second; cerr << "Line " << line << ": Warning unknown category property: " << cat << endl; return Other_NotAssigned; } BidiClass string_to_bidiClass(const std::string& bidi) { map<string, BidiClass>::const_iterator i = bidiClassMap.find(bidi); if(i != bidiClassMap.end()) return i->second; cerr << "Line " << line << ": Warning unknown bidirectional property: " << bidi << endl; return OtherNeutrals; } Decomposition string_to_decompTag(const std::string& decomp) { if(decomp.empty()) return Decomp_None; if(decomp.at(0) == '<') { string dt = decomp.substr(0, decomp.find('>')+1); map<string, Decomposition>::const_iterator i = decompMap.find(dt); if(i != decompMap.end()) return i->second; cerr << "Line " << line << ": Warning unknown decomposition tag property: " << dt << endl; } return Decomp_Standard; } vector<string> string_to_decompChars(const string& decomp) { istringstream is(decomp); string ch; vector<string> ret; while(is >> ch) { if(ch.at(0) == '<') continue; ret.push_back(ch); } return ret; } int main(int argc, char* argv[]) { ifstream dataFile(argv[1]); ofstream unicodeDataDb("unicodedata_db.cpp"); unicodeDataDb << "#include \"unicodedata.h\"" << endl; unicodeDataDb << "namespace P { namespace Unicode {" << endl; ofstream unicodeDataCasemapDb("unicodedata_casemap_db.cpp"); unicodeDataCasemapDb << "#include \"unicodedata.h\"" << endl; unicodeDataCasemapDb << "namespace P { namespace Unicode {" << endl; ofstream unicodeDataNumberDb("unicodedata_number_db.cpp"); unicodeDataNumberDb << "#include \"unicodedata.h\"" << endl; unicodeDataNumberDb << "namespace P { namespace Unicode {" << endl; ofstream unicodeDataDecompDb("unicodedata_decomp_db.cpp"); unicodeDataDecompDb << "#include \"unicodedata.h\"" << endl; unicodeDataDecompDb << "namespace P { namespace Unicode {" << endl; categoryMap.insert(make_pair("Mn", Mark_NonSpacing)); categoryMap.insert(make_pair("Mc", Mark_SpacingCombining)); categoryMap.insert(make_pair("Me", Mark_Enclosing)); categoryMap.insert(make_pair("Nd", Number_DecimalDigit)); categoryMap.insert(make_pair("Nl", Number_Letter)); categoryMap.insert(make_pair("No", Number_Other)); categoryMap.insert(make_pair("Zs", Separator_Space)); categoryMap.insert(make_pair("Zl", Separator_Line)); categoryMap.insert(make_pair("Zp", Separator_Paragraph)); categoryMap.insert(make_pair("Cc", Other_Control)); categoryMap.insert(make_pair("Cf", Other_Format)); categoryMap.insert(make_pair("Cs", Other_Surrogate)); categoryMap.insert(make_pair("Co", Other_PrivateUse)); categoryMap.insert(make_pair("Cn", Other_NotAssigned)); categoryMap.insert(make_pair("Lu", Letter_Uppercase)); categoryMap.insert(make_pair("Ll", Letter_Lowercase)); categoryMap.insert(make_pair("Lt", Letter_Titlecase)); categoryMap.insert(make_pair("Lm", Letter_Modifier)); categoryMap.insert(make_pair("Lo", Letter_Other)); categoryMap.insert(make_pair("Pc", Punctuation_Connector)); categoryMap.insert(make_pair("Pd", Punctuation_Dash)); categoryMap.insert(make_pair("Ps", Punctuation_Open)); categoryMap.insert(make_pair("Pe", Punctuation_Close)); categoryMap.insert(make_pair("Pi", Punctuation_InitialQuote)); categoryMap.insert(make_pair("Pf", Punctuation_FinalQuote)); categoryMap.insert(make_pair("Po", Punctuation_Other)); categoryMap.insert(make_pair("Sm", Symbol_Math)); categoryMap.insert(make_pair("Sc", Symbol_Currency)); categoryMap.insert(make_pair("Sk", Symbol_Modifier)); categoryMap.insert(make_pair("So", Symbol_Other)); bidiClassMap.insert(make_pair("L", LeftToRight)); bidiClassMap.insert(make_pair("LRE", LeftToRightEmbedding)); bidiClassMap.insert(make_pair("LRO", LeftToRightOverride)); bidiClassMap.insert(make_pair("R", RightToLeft)); bidiClassMap.insert(make_pair("AL", RightToLeftArabic)); bidiClassMap.insert(make_pair("RLE", RightToLeftEmbedding)); bidiClassMap.insert(make_pair("RLO", RightToLeftOverride)); bidiClassMap.insert(make_pair("PDF", PopDirectionalFormat)); bidiClassMap.insert(make_pair("EN", EuropeanNumber)); bidiClassMap.insert(make_pair("ES", EuropeanNumberSeparator)); bidiClassMap.insert(make_pair("ET", EuropeanNumberTerminator)); bidiClassMap.insert(make_pair("AN", ArabicNumber)); bidiClassMap.insert(make_pair("CS", CommonNumberSeparator)); bidiClassMap.insert(make_pair("NSM", NonSpacingMark)); bidiClassMap.insert(make_pair("BN", BoundaryNeutral)); bidiClassMap.insert(make_pair("B", ParagraphSeparator)); bidiClassMap.insert(make_pair("S", SegmentSeparator)); bidiClassMap.insert(make_pair("WS", Whitespace)); bidiClassMap.insert(make_pair("ON", OtherNeutrals)); decompMap.insert(make_pair("<font>", Decomp_Font)); decompMap.insert(make_pair("<noBreak>", Decomp_NoBreak)); decompMap.insert(make_pair("<initial>", Decomp_Initial)); decompMap.insert(make_pair("<medial>", Decomp_Medial)); decompMap.insert(make_pair("<final>", Decomp_Final)); decompMap.insert(make_pair("<isolated>", Decomp_Isolated)); decompMap.insert(make_pair("<circle>", Decomp_Encircled)); decompMap.insert(make_pair("<super>", Decomp_Superscript)); decompMap.insert(make_pair("<sub>", Decomp_Subscript)); decompMap.insert(make_pair("<vertical>", Decomp_Vertical)); decompMap.insert(make_pair("<wide>", Decomp_Wide)); decompMap.insert(make_pair("<narrow>", Decomp_Narrow)); decompMap.insert(make_pair("<small>", Decomp_Small)); decompMap.insert(make_pair("<square>", Decomp_Square)); decompMap.insert(make_pair("<fraction>", Decomp_Fraction)); decompMap.insert(make_pair("<compat>", Decomp_Compat)); unicodeDataDb << "extern letterCasemapData caseMappings[];" << endl; unicodeDataDb << "extern numberMappingData numberMappings[];" << endl; unicodeDataDb << "extern uchar_t decompChars[];" << endl; unicodeDataDb << "codePointData codePoints[] = {" << endl; unicodeDataCasemapDb << "letterCasemapData caseMappings[] = {" << endl; unicodeDataNumberDb << "numberMappingData numberMappings[] = {" << endl; unicodeDataDecompDb << "uchar_t decompChars[] = {" << endl; ostringstream tmpos; while(dataFile.good()) { string codePoint, charName, category, combining, bidi, decomp, num1, num2, num3, mirrored, description, upcasemap, lowcasemap, titcasemap, extraIndex, decompIndex, tmp; if(!getline(dataFile, codePoint, ';')) break; getline(dataFile, charName, ';'); getline(dataFile, category, ';'); getline(dataFile, combining, ';'); getline(dataFile, bidi, ';'); getline(dataFile, decomp, ';'); getline(dataFile, num1, ';'); getline(dataFile, num2, ';'); getline(dataFile, num3, ';'); getline(dataFile, mirrored, ';'); getline(dataFile, description, ';'); getline(dataFile, tmp, ';'); // ?? getline(dataFile, upcasemap, ';'); getline(dataFile, lowcasemap, ';'); getline(dataFile, titcasemap); extraIndex = "(uint16_t)-1"; decompIndex = "(uint16_t)-1"; // generate extra data for letters ... if(category.at(0) == 'L' && !(upcasemap.empty() && lowcasemap.empty() && titcasemap.empty())) { tmpos.str(""); tmpos << letterCasemapNum << " /*letter*/"; extraIndex = tmpos.str(); if(upcasemap.empty()) upcasemap = "0"; if(lowcasemap.empty()) lowcasemap = "0"; if(titcasemap.empty()) titcasemap = "0"; unicodeDataCasemapDb << " { 0x" << upcasemap <<", 0x" << lowcasemap << ", 0x" << titcasemap << " }," << endl; ++letterCasemapNum; } else if(category.at(0) == 'N' && !num3.empty()) { tmpos.str(""); tmpos << numberMappingNum << " /*number*/"; extraIndex = tmpos.str(); unicodeDataNumberDb << " { " << num3 << " }," << endl; ++numberMappingNum; } Decomposition decompTag = string_to_decompTag(decomp); if(decompTag != Decomp_None) { tmpos.str(""); tmpos << decompCharsNum; decompIndex = tmpos.str(); vector<string> decompCharV = string_to_decompChars(decomp); unicodeDataDecompDb << "/* codepoint " << codePoint << " begin */" << endl; vector<string>::const_iterator i = decompCharV.begin(); while(i != decompCharV.end()) { unicodeDataDecompDb << "0x" << *i << ", "; ++decompCharsNum; ++i; } unicodeDataDecompDb << "(uchar_t)-1, " << endl; unicodeDataDecompDb << "/* codepoint " << codePoint << " end */" << endl; ++decompCharsNum; } unicodeDataDb << "{ 0x" << codePoint << ", " << string_to_category(category) << ", " << combining << ", " << string_to_bidiClass(bidi) << ", " << decompTag << ", " << decompIndex << ", " << mirrored_to_bool(mirrored) << ", " << extraIndex << " }," << endl; ++line; } unicodeDataDb << "{ (uchar_t)-1, 0, 0, 0, 0, false, 0 }" << endl; unicodeDataDb << "};" << endl; unicodeDataDb << "} }" << endl; unicodeDataCasemapDb << "{ 0, 0, 0 } };" << endl; unicodeDataCasemapDb << "} }" << endl; unicodeDataNumberDb << "{ 0 } };" << endl; unicodeDataNumberDb << "} }" << endl; unicodeDataDecompDb << "(uchar_t)-1 };" << endl; unicodeDataDecompDb << "} }" << endl; dataFile.close(); } Index: unicodedata.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/Unicode/unicodedata.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- unicodedata.cpp 14 Jan 2005 14:46:02 -0000 1.1 +++ unicodedata.cpp 6 May 2005 15:32:11 -0000 1.2 @@ -24,8 +24,9 @@ namespace Unicode { -#include "unicodedata_extra_db.h" -#include "unicodedata_db.h" +extern codePointData codePoints[]; +extern letterCasemapData caseMappings[]; +extern numberMappingData numberMappings[]; const codePointData* lookupCodePoint(uchar_t codePoint) { @@ -40,6 +41,48 @@ return 0; } +const letterCasemapData* lookupLetterCasemapData(const codePointData* codePoint) +{ + switch(codePoint->category) + { + case Letter_Uppercase: + case Letter_Lowercase: + case Letter_Titlecase: + case Letter_Modifier: + case Letter_Other: + if(codePoint->extraIndex != (uint16_t)-1) + return &caseMappings[codePoint->extraIndex]; + break; + default: + break; + } + + return 0; +} + +const numberMappingData* lookupNumberMappingData(const codePointData* codePoint) +{ + if((codePoint->category == Number_DecimalDigit + || codePoint->category == Number_Letter) + && codePoint->extraIndex != (uint16_t)-1) + { + return &numberMappings[codePoint->extraIndex]; + } + + return 0; +} + +/* tests if we can simply ignore an unknown codepoint */ +bool isIgnorableCodePoint(uchar_t ch) +{ + if((ch >= 0x2060 && ch <= 0x206F) + || (ch >= 0xFFF0 && ch <= 0xFFFB) + || (ch >= 0xE0000 && ch <= 0xE0FFF)) + return true; + + return false; +} + Category category(uchar_t ch) { const codePointData* data = lookupCodePoint(ch); Index: Char.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/Unicode/Char.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Char.cpp 28 Apr 2005 10:21:14 -0000 1.5 +++ Char.cpp 6 May 2005 15:32:11 -0000 1.6 @@ -100,30 +100,16 @@ return isualpha(_char) == 1 ? true : false; } -int Char::toNumber() const +float Char::toNumber() const { - int ret = 0; + float ret = 0.0f; const codePointData* data = lookupCodePoint(_char); if(data) { - switch(category()) - { - case Number_DecimalDigit: - case Number_Letter: - { - const decimalDigitExtraData* extraData = - (const decimalDigitExtraData*)data->extra; - ret = extraData->num; - } - break; - - case Number_Other: - break; - - default: - break; - } + const numberMappingData* numberData = lookupNumberMappingData(data); + if(numberData) + ret = numberData->num; } return ret; @@ -152,7 +138,7 @@ bool Char::isMirrored() const { const codePointData* data = lookupCodePoint(_char); - return data->mirrored == 1 ? true : false; + return data->mirrored; } Char::Category Char::category() const Index: uctype.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/Unicode/uctype.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- uctype.cpp 26 Apr 2005 12:16:02 -0000 1.2 +++ uctype.cpp 6 May 2005 15:32:11 -0000 1.3 @@ -153,10 +153,11 @@ uchar_t toulower(uchar_t c) { const codePointData* data = lookupCodePoint(c); - if(data && data->extra) + if(data) { - const letterExtraData* extraData = (const letterExtraData*)data->extra; - return extraData->lower; + const letterCasemapData* casemapData = lookupLetterCasemapData(data); + if(casemapData) + return casemapData->lower; } return c; @@ -165,10 +166,11 @@ uchar_t touupper(uchar_t c) { const codePointData* data = lookupCodePoint(c); - if(data && data->extra) + if(data) { - const letterExtraData* extraData = (const letterExtraData*)data->extra; - return extraData->upper; + const letterCasemapData* casemapData = lookupLetterCasemapData(data); + if(casemapData) + return casemapData->upper; } return c; Index: ustring.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/Unicode/ustring.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ustring.cpp 26 Apr 2005 12:16:02 -0000 1.2 +++ ustring.cpp 6 May 2005 15:32:11 -0000 1.3 @@ -32,10 +32,7 @@ while(n-- > 0) { if(*s1 != *s2) - { - //@@fixme - return 1; - } + return (*s1 < *s2) ? -1 : +1; ++s1; ++s2; Index: unicodedata.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/Unicode/unicodedata.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- unicodedata.h 14 Jan 2005 14:46:02 -0000 1.1 +++ unicodedata.h 6 May 2005 15:32:11 -0000 1.2 @@ -93,23 +93,24 @@ //! Character Decomposition Tag enum Decomposition { - NoDecomposition, - Font, // <font> - NoBreak, // <noBreak> - Initial, // <initial> - Medial, // <medial> - Final, // <final> - Isolated, // <isolated> - Encircled, // <circle> - Superscript, // <super> - Subscript, // <sub> - Vertical, // <vertical> - Wide, // <wide> - Narrow, // <narrow> - Small, // <small> - Square, // <square> - Fraction, // <fraction> - Compat // <compat> + Decomp_None, + Decomp_Standard, + Decomp_Font, // <font> + Decomp_NoBreak, // <noBreak> + Decomp_Initial, // <initial> + Decomp_Medial, // <medial> + Decomp_Final, // <final> + Decomp_Isolated, // <isolated> + Decomp_Encircled, // <circle> + Decomp_Superscript, // <super> + Decomp_Subscript, // <sub> + Decomp_Vertical, // <vertical> + Decomp_Wide, // <wide> + Decomp_Narrow, // <narrow> + Decomp_Small, // <small> + Decomp_Square, // <square> + Decomp_Fraction, // <fraction> + Decomp_Compat // <compat> }; //! Canonical Combining Class @@ -148,22 +149,28 @@ char combining; char bidi; char decomp; - char mirrored; - void* extra; + uint16_t decompIndex; + bool mirrored; + uint16_t extraIndex; }; -struct letterExtraData { +struct letterCasemapData { uchar_t upper; uchar_t lower; uchar_t title; }; -struct decimalDigitExtraData { - int num; +struct numberMappingData { + float num; }; const codePointData* lookupCodePoint(uchar_t codePoint); +const letterCasemapData* lookupLetterCasemapData(const codePointData* codePoint); +const numberMappingData* lookupNumberMappingData(const codePointData* codePoint); + +bool isIgnorableCodePoint(uchar_t ch); + Category category(uchar_t ch); BidiClass bidiClass(uchar_t ch); Decomposition decompTag(uchar_t ch); Index: String.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/Unicode/String.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- String.cpp 28 Apr 2005 10:15:02 -0000 1.5 +++ String.cpp 6 May 2005 15:32:11 -0000 1.6 @@ -245,14 +245,12 @@ bool String::operator<(const String& str) const throw() { - //@todo String::operator< - return false; + return _str < str._str; } bool String::operator>(const String& str) const throw() { - //@todo String::operator> - return false; + return _str > str._str; } bool String::operator<=(const String& str) const throw() Index: Makefile.am =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/Unicode/Makefile.am,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- Makefile.am 26 Apr 2005 12:16:02 -0000 1.8 +++ Makefile.am 6 May 2005 15:32:11 -0000 1.9 @@ -1,15 +1,10 @@ -noinst_HEADERS = unicodedata.h unicodedata_db.h unicodedata_extra_db.h - -unicodedata_db: unicodedata_db.h unicodedata_extra_db.h - -unicodedata_db-clean: - rm -f unicodedata_db.h - rm -f unicodedata_extra_db.h +noinst_HEADERS = unicodedata.h -unicodedata_db.h unicodedata_extra_db.h: +UnicodeData.txt: wget --passive-ftp http://www.unicode.org/Public/UNIDATA/UnicodeData.txt - awk -f $(top_srcdir)/src/Unicode/unicodedata.awk UnicodeData.txt >unicodedata_db.h - rm -f UnicodeData.txt + +unicodedata_db.cpp unicodedata_casemap_db.cpp unicodedata_number_db.cpp: genunicodedata$(EXEEXT) UnicodeData.txt + $(top_builddir)/src/Unicode/genunicodedata$(EXEEXT) UnicodeData.txt INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_builddir)/src/Unicode $(all_includes) METASOURCES = AUTO @@ -18,12 +13,15 @@ CPPFLAGS = -DPUNICODE_BUILD -libpclasses_unicode_la_SOURCES = unicodedata.cpp uctype.cpp ustring.cpp Char.cpp String.cpp TextStream.cpp +libpclasses_unicode_la_SOURCES = unicodedata.cpp unicodedata_db.cpp unicodedata_casemap_db.cpp \ + unicodedata_number_db.cpp unicodedata_decomp_db.cpp uctype.cpp ustring.cpp Char.cpp String.cpp TextStream.cpp libpclasses_unicode_la_LDFLAGS = -no-undefined libpclasses_unicode_la_LIBADD = $(top_builddir)/src/libpclasses.la $(LIBICONV) -all: unicodedata_db +noinst_PROGRAMS = genunicodedata +genunicodedata_SOURCES = genunicodedata.cpp -clean: unicodedata_db-clean +CLEAN_FILES = UnicodeData.txt unicodedata_db.cpp unicodedata_casemap_db.cpp unicodedata_number_db.cpp \ + unicodedata_decomp_db.cpp |
From: Christian P. <cp...@us...> - 2005-05-06 15:32:23
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/Unicode In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12388/include/pclasses/Unicode Modified Files: Char.h Log Message: - Added c++ tool for generating unicode database. - More work on Unicode support. Index: Char.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Unicode/Char.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Char.h 28 Apr 2005 10:21:13 -0000 1.4 +++ Char.h 6 May 2005 15:32:11 -0000 1.5 @@ -98,23 +98,24 @@ //! Character Decomposition Tag enum Decomposition { - NoDecomposition, - Font, // <font> - NoBreak, // <noBreak> - Initial, // <initial> - Medial, // <medial> - Final, // <final> - Isolated, // <isolated> - Encircled, // <circle> - Superscript, // <super> - Subscript, // <sub> - Vertical, // <vertical> - Wide, // <wide> - Narrow, // <narrow> - Small, // <small> - Square, // <square> - Fraction, // <fraction> - Compat // <compat> + Decomp_None, + Decomp_Standard, + Decomp_Font, // <font> + Decomp_NoBreak, // <noBreak> + Decomp_Initial, // <initial> + Decomp_Medial, // <medial> + Decomp_Final, // <final> + Decomp_Isolated, // <isolated> + Decomp_Encircled, // <circle> + Decomp_Superscript, // <super> + Decomp_Subscript, // <sub> + Decomp_Vertical, // <vertical> + Decomp_Wide, // <wide> + Decomp_Narrow, // <narrow> + Decomp_Small, // <small> + Decomp_Square, // <square> + Decomp_Fraction, // <fraction> + Decomp_Compat // <compat> }; //! Canonical Combining Class @@ -157,7 +158,7 @@ bool isMark() const; bool isNumber() const; - int toNumber() const; + float toNumber() const; bool isLower() const; Char toLower() const; |
From: Christian P. <cp...@us...> - 2005-05-06 15:30:31
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/Plugin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12013/include/pclasses/Plugin Modified Files: Makefile.am Log Message: - Removed Plugin.h Index: Makefile.am =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Plugin/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Makefile.am 16 Jan 2005 00:08:08 -0000 1.1 +++ Makefile.am 6 May 2005 15:30:23 -0000 1.2 @@ -2,4 +2,4 @@ INCLUDES = METASOURCES = AUTO -pclasses_plugin_include_HEADERS = Plugin.h +pclasses_plugin_include_HEADERS = |
From: Christian P. <cp...@us...> - 2005-05-06 15:29:01
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11584/include/pclasses Modified Files: StringList.h Log Message: - Fix for uninitialized variable. Index: StringList.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/StringList.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- StringList.h 28 Apr 2005 12:24:45 -0000 1.2 +++ StringList.h 6 May 2005 15:28:51 -0000 1.3 @@ -66,7 +66,7 @@ return string_list(); typename StringType::size_type tokenBegin = 0; - typename StringType::size_type tokenEnd; + typename StringType::size_type tokenEnd = 0; StringType token; string_list lst; |
From: Christian P. <cp...@us...> - 2005-05-06 15:28:33
|
Update of /cvsroot/pclasses/pclasses2/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11373/src Modified Files: Makefile.am Log Message: - Added src/CoreMutex.*.cpp, include/pclasses/CoreMutex.h, src/Factory.cpp Index: Makefile.am =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/Makefile.am,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- Makefile.am 23 Apr 2005 12:00:06 -0000 1.8 +++ Makefile.am 6 May 2005 15:28:24 -0000 1.9 @@ -8,15 +8,15 @@ CPPFLAGS = -DPCORE_BUILD if WITH_POSIX_THREADS -Thread_Sources = AtomicMutex.posix.cpp +Thread_Sources = CoreMutex.posix.cpp endif if WITH_SOLARIS_THREADS -Thread_Sources = AtomicMutex.solaris.cpp +Thread_Sources = CoreMutex.solaris.cpp endif if WITH_WIN32_THREADS -Thread_Sources = AtomicMutex.win32.cpp +Thread_Sources = CoreMutex.win32.cpp endif if WITH_GCC_X86_ATOMIC_INT @@ -29,7 +29,7 @@ libpclasses_la_LDFLAGS = -no-undefined -libpclasses_la_SOURCES = Alloc.cpp Exception.cpp \ +libpclasses_la_SOURCES = Alloc.cpp Exception.cpp Factory.cpp \ ByteOrderTraits.cpp LinkedItem.cpp Time.cpp Date.cpp DateTime.cpp \ TimeSpan.cpp Trace.cpp Callback.cpp \ $(Thread_Sources) $(Atomic_Sources) |
From: Christian P. <cp...@us...> - 2005-05-06 15:28:33
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11373/include/pclasses Modified Files: Makefile.am Log Message: - Added src/CoreMutex.*.cpp, include/pclasses/CoreMutex.h, src/Factory.cpp Index: Makefile.am =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Makefile.am,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- Makefile.am 24 Apr 2005 11:50:41 -0000 1.13 +++ Makefile.am 6 May 2005 15:28:23 -0000 1.14 @@ -15,7 +15,7 @@ SharedPtr.h Alloc.h SourceInfo.h Atomic.h AtomicTraits.h ValueType.h LockTraits.h \ ByteOrderTraits.h BasicTypes.h Vector.h Algorithm.h TypeTraits.h \ Stack.h LinkedItem.h Pair.h IntTypeLimits.h Queue.h IntrusivePtr.h \ - CircularQueue.h List.h NonCopyable.h Phoenix.h Factory.h \ + CircularQueue.h List.h NonCopyable.h Phoenix.h CoreMutex.h Factory.h \ SharingContext.h Time.h Date.h DateTime.h TimeSpan.h Callback.h Signal.h \ CallbackN1.h CallbackN2.h CallbackN3.h CallbackN4.h \ Trace.h PropertyMap.h Export.h pclasses-config.h |
From: Christian P. <cp...@us...> - 2005-05-06 15:26:34
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10913/include/pclasses Modified Files: Trace.h Log Message: - Added a this-pointer to P_TRACE macro. - Added a P_TRACE_GLOBAL macro without this-pointer. Index: Trace.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Trace.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Trace.h 28 Apr 2005 10:11:36 -0000 1.2 +++ Trace.h 6 May 2005 15:26:24 -0000 1.3 @@ -37,7 +37,9 @@ private std::ostream { public: - TraceStream(TraceLog& log, const SourceInfo& si, const char* cl); + TraceStream(TraceLog& log, const SourceInfo& si, const char* cl, + const void* obj); + TraceStream(TraceLog& log, const SourceInfo& si); TraceStream(const TraceStream&); ~TraceStream(); @@ -47,14 +49,20 @@ TraceLog& _log; SourceInfo _src; std::string _class; + const void* _obj; }; class PCORE_EXPORT TraceLog { public: - TraceStream stream(const SourceInfo& si, const char* cl); + TraceStream stream(const SourceInfo& si, const char* cl, + const void* obj); + + TraceStream stream(const SourceInfo& si); + + void output(const SourceInfo& si, const std::string& msg); void output(const SourceInfo& si, const std::string& cl, - const std::string& msg); + const void* obj, const std::string& msg); static TraceLog& instance(); @@ -106,8 +114,10 @@ #if defined(_DEBUG) && !defined(NO_DEBUG) # define P_TRACE(c) NullTraceStream() +# define P_TRACE_GLOBAL(c) NullTraceStream() #else -# define P_TRACE(c) P::TraceLog::instance().stream(P_SOURCEINFO,#c)() +# define P_TRACE(c) P::TraceLog::instance().stream(P_SOURCEINFO,#c,this)() +# define P_TRACE_GLOBAL(c) P::TraceLog::instance().stream(P_SOURCEINFO)() #endif } // !namespace P |
From: Christian P. <cp...@us...> - 2005-05-06 15:26:34
|
Update of /cvsroot/pclasses/pclasses2/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10913/src Modified Files: Trace.cpp Log Message: - Added a this-pointer to P_TRACE macro. - Added a P_TRACE_GLOBAL macro without this-pointer. Index: Trace.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/Trace.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Trace.cpp 28 Apr 2005 10:11:36 -0000 1.2 +++ Trace.cpp 6 May 2005 15:26:25 -0000 1.3 @@ -24,8 +24,16 @@ namespace P { -TraceStream::TraceStream(TraceLog& log, const SourceInfo& si, const char* cl) -: std::ostream(new std::stringbuf()), _log(log), _src(si), _class(cl) +TraceStream::TraceStream(TraceLog& log, const SourceInfo& si, + const char* cl, const void* obj) +: std::ostream(new std::stringbuf()), _log(log), _src(si), + _class(cl), _obj(obj) +{ +} + +TraceStream::TraceStream(TraceLog& log, const SourceInfo& si) +: std::ostream(new std::stringbuf()), _log(log), _src(si), + _class(""), _obj(0) { } @@ -38,7 +46,10 @@ TraceStream::~TraceStream() { std::stringbuf* sb = static_cast<std::stringbuf*>(rdbuf()); - _log.output(_src, _class, sb->str()); + if(!_class.empty()) + _log.output(_src, _class, _obj, sb->str()); + else + _log.output(_src, sb->str()); delete sb; } @@ -58,16 +69,28 @@ { } -TraceStream TraceLog::stream(const SourceInfo& si, const char* cl) +TraceStream TraceLog::stream(const SourceInfo& si, const char* cl, + const void* obj) { - return TraceStream(*this, si, cl); + return TraceStream(*this, si, cl, obj); } -void TraceLog::output(const SourceInfo& si, const std::string& cl, - const std::string& msg) +TraceStream TraceLog::stream(const SourceInfo& si) +{ + return TraceStream(*this, si); +} + +void TraceLog::output(const SourceInfo& si, const std::string& cl, + const void* obj, const std::string& msg) { //std::cout << si.file() << ":" << si.line() << std::endl; - std::cout << cl << ": " << msg << std::endl; + std::cout << cl << '[' << obj << "]: " << msg << std::endl; +} + +void TraceLog::output(const SourceInfo& si, const std::string& msg) +{ + //std::cout << si.file() << ":" << si.line() << std::endl; + std::cout << msg << std::endl; } TraceLog& TraceLog::instance() |
From: Christian P. <cp...@us...> - 2005-05-06 15:25:52
|
Update of /cvsroot/pclasses/pclasses2/plugins/LogTarget/File In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10683/plugins/LogTarget/File Modified Files: FileLogTarget.cpp Log Message: - Use the new Factory code. Index: FileLogTarget.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/plugins/LogTarget/File/FileLogTarget.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- FileLogTarget.cpp 28 Apr 2005 11:24:43 -0000 1.1 +++ FileLogTarget.cpp 6 May 2005 15:25:09 -0000 1.2 @@ -18,9 +18,9 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include "pclasses/Plugin/Plugin.h" #include "pclasses/IO/IOStream.h" #include "pclasses/System/File.h" +#include "pclasses/System/Plugin.h" #include "pclasses/App/LogTarget.h" #include <iostream> @@ -75,5 +75,5 @@ IOStream* _out; }; -PLUGIN_REGISTER_TYPE(LogTarget, FileLogTarget); -PLUGIN_REGISTER_ALIAS(LogTarget, File, FileLogTarget); +P_PLUGIN_REGISTER_TYPE(LogTarget, FileLogTarget); +P_PLUGIN_REGISTER_ALIAS(LogTarget, File, FileLogTarget); |