complement-svn Mailing List for Complement (Page 16)
Status: Pre-Alpha
Brought to you by:
complement
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(61) |
Nov
(76) |
Dec
(39) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(33) |
Feb
(41) |
Mar
(16) |
Apr
|
May
(22) |
Jun
(14) |
Jul
(64) |
Aug
(60) |
Sep
(35) |
Oct
(34) |
Nov
(10) |
Dec
(5) |
2008 |
Jan
(4) |
Feb
(24) |
Mar
(10) |
Apr
(30) |
May
(15) |
Jun
(50) |
Jul
(20) |
Aug
(7) |
Sep
(8) |
Oct
(10) |
Nov
|
Dec
|
From: <com...@us...> - 2007-07-11 17:56:04
|
Revision: 1603 http://svn.sourceforge.net/complement/?rev=1603&view=rev Author: complement Date: 2007-07-11 10:56:00 -0700 (Wed, 11 Jul 2007) Log Message: ----------- Condition replaced by condition Modified Paths: -------------- branches/complement-xmt/explore/include/mt/shm.h branches/complement-xmt/explore/include/mt/xmt.h branches/complement-xmt/explore/include/sockios/sockmgr.cc branches/complement-xmt/explore/include/sockios/sockmgr.h branches/complement-xmt/explore/include/stem/Cron.h branches/complement-xmt/explore/include/stem/EvManager.h branches/complement-xmt/explore/lib/mt/ChangeLog branches/complement-xmt/explore/lib/sockios/ChangeLog branches/complement-xmt/explore/lib/stem/ChangeLog branches/complement-xmt/explore/test/mt/lfs.cc branches/complement-xmt/explore/test/mt/mt_test.cc branches/complement-xmt/explore/test/mt/signal-1.cc branches/complement-xmt/explore/test/mt/signal-3.cc branches/complement-xmt/explore/test/sockios/bytes_in_socket.cc branches/complement-xmt/explore/test/sockios/bytes_in_socket2.cc branches/complement-xmt/explore/test/sockios/client-wc.cc branches/complement-xmt/explore/test/sockios/close_socket.cc branches/complement-xmt/explore/test/sockios/sockios_test.cc branches/complement-xmt/explore/test/stem/Echo.h branches/complement-xmt/explore/test/stem/NameService.h branches/complement-xmt/explore/test/stem/Node.h branches/complement-xmt/explore/test/stem/NodeDL.h branches/complement-xmt/explore/test/stem/unit_test.cc Modified: branches/complement-xmt/explore/include/mt/shm.h =================================================================== --- branches/complement-xmt/explore/include/mt/shm.h 2007-07-11 07:35:11 UTC (rev 1602) +++ branches/complement-xmt/explore/include/mt/shm.h 2007-07-11 17:56:00 UTC (rev 1603) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <07/06/14 10:16:59 ptr> +// -*- C++ -*- Time-stamp: <07/07/11 20:52:38 ptr> /* * Copyright (c) 2006, 2007 @@ -70,7 +70,7 @@ }; template <> -struct ipc_sharable<xmt::__Condition<true> > +struct ipc_sharable<xmt::__condition<true> > { typedef std::__true_type is_ipc_sharable; }; Modified: branches/complement-xmt/explore/include/mt/xmt.h =================================================================== --- branches/complement-xmt/explore/include/mt/xmt.h 2007-07-11 07:35:11 UTC (rev 1602) +++ branches/complement-xmt/explore/include/mt/xmt.h 2007-07-11 17:56:00 UTC (rev 1603) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <07/06/14 10:15:07 ptr> +// -*- C++ -*- Time-stamp: <07/07/11 20:51:27 ptr> /* * Copyright (c) 1997-1999, 2002-2007 @@ -182,7 +182,7 @@ #endif // !_WIN32 -template <bool SCOPE> class __Condition; +template <bool SCOPE> class __condition; // if parameter SCOPE (process scope) true, PTHREAD_PROCESS_SHARED will // be used; otherwise PTHREAD_PROCESS_PRIVATE. @@ -264,7 +264,7 @@ #ifndef __FIT_WIN32THREADS private: - friend class __Condition<SCOPE>; + friend class __condition<SCOPE>; #endif }; @@ -365,7 +365,7 @@ #ifndef __FIT_WIN32THREADS private: - friend class __Condition<SCOPE>; + friend class __condition<SCOPE>; #endif }; @@ -968,10 +968,10 @@ }; template <bool SCOPE> -class __Condition +class __condition { public: - __Condition() : + __condition() : _val( true ) { #ifdef __FIT_WIN32THREADS @@ -993,7 +993,7 @@ #endif } - ~__Condition() + ~__condition() { #ifdef __FIT_WIN32THREADS CloseHandle( _cond ); @@ -1045,15 +1045,11 @@ int try_wait() { -#if defined(__FIT_WIN32THREADS) - _lock.lock(); -#endif -#if defined(__FIT_UITHREADS) || defined(_PTHREADS) basic_lock<__mutex<false,SCOPE> > _x1( _lock ); -#endif + if ( _val == false ) { #ifdef __FIT_WIN32THREADS - _lock.unlock(); + _x1.unlock(); if ( WaitForSingleObject( _cond, -1 ) == WAIT_FAILED ) { return -1; } @@ -1073,27 +1069,24 @@ return ret; #endif } -#if defined(__FIT_WIN32THREADS) - _lock.unlock(); -#endif + return 0; } int wait() { -#ifdef __FIT_WIN32THREADS - MT_LOCK( _lock ); + basic_lock<__mutex<false,SCOPE> > lk( _lock ); _val = false; + +#ifdef __FIT_WIN32THREADS ResetEvent( _cond ); - MT_UNLOCK( _lock ); + lk.unlock(); if ( WaitForSingleObject( _cond, -1 ) == WAIT_FAILED ) { return -1; } return 0; #endif #if defined(_PTHREADS) || defined(__FIT_UITHREADS) - basic_lock<__mutex<false,SCOPE> > lk( _lock ); - _val = false; int ret; while ( !_val ) { ret = @@ -1161,11 +1154,11 @@ bool _val; private: - __Condition( const __Condition& ) + __condition( const __condition& ) { } }; -typedef __Condition<false> Condition; +typedef __condition<false> condition; template <bool SCOPE> class __Semaphore @@ -1526,7 +1519,7 @@ # ifndef __hpux // sorry, POSIX threads don't have suspend/resume calls, so it should // be simulated via cond_wait - __Condition<false> _suspend; + __condition<false> _suspend; # endif #endif #ifdef __FIT_WIN32THREADS @@ -1549,7 +1542,7 @@ }; template <bool SCOPE> -int __Condition<SCOPE>::try_wait_time( const ::timespec *abstime ) +int __condition<SCOPE>::try_wait_time( const ::timespec *abstime ) { #if defined(__FIT_WIN32THREADS) MT_LOCK( _lock ); @@ -1605,7 +1598,7 @@ } template <bool SCOPE> -int __Condition<SCOPE>::try_wait_delay( const ::timespec *interval ) +int __condition<SCOPE>::try_wait_delay( const ::timespec *interval ) { #if defined(__FIT_WIN32THREADS) MT_LOCK( _lock ); @@ -1667,7 +1660,7 @@ } template <bool SCOPE> -int __Condition<SCOPE>::wait_time( const ::timespec *abstime ) +int __condition<SCOPE>::wait_time( const ::timespec *abstime ) { #ifdef __FIT_WIN32THREADS MT_LOCK( _lock ); @@ -1717,7 +1710,7 @@ } template <bool SCOPE> -int __Condition<SCOPE>::wait_delay( const ::timespec *interval ) +int __condition<SCOPE>::wait_delay( const ::timespec *interval ) { #ifdef __FIT_WIN32THREADS MT_LOCK( _lock ); Modified: branches/complement-xmt/explore/include/sockios/sockmgr.cc =================================================================== --- branches/complement-xmt/explore/include/sockios/sockmgr.cc 2007-07-11 07:35:11 UTC (rev 1602) +++ branches/complement-xmt/explore/include/sockios/sockmgr.cc 2007-07-11 17:56:00 UTC (rev 1603) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <07/02/01 19:50:14 ptr> +// -*- C++ -*- Time-stamp: <07/07/11 21:14:42 ptr> /* * Copyright (c) 1997-1999, 2002, 2003, 2005-2007 @@ -29,7 +29,7 @@ template <class Connect> void sockmgr_stream_MP<Connect>::_open( sock_base::stype t ) { - MT_REENTRANT( _fd_lck, _1 ); + xmt::scoped_lock lk(_fd_lck); if ( is_open_unsafe() ) { if ( t == sock_base::sock_stream ) { _accept = &_Self_type::accept_tcp; @@ -204,7 +204,7 @@ } if ( _pfd[0].revents != 0 ) { - MT_REENTRANT( _fd_lck, _1 ); + xmt::scoped_lock lk(_fd_lck); if ( !is_open_unsafe() ) { // may be already closed return false; } @@ -224,7 +224,7 @@ if ( cl_new->s.rdbuf()->in_avail() > 0 ) { // this is the case when user read from sockstream // in ctor above; push processing of this stream - MT_REENTRANT( _dlock, _1 ); + xmt::scoped_lock lk(_dlock); _conn_pool.push_back( --_M_c.end() ); _pool_cnd.set( true ); _observer_cnd.set( true ); @@ -404,7 +404,7 @@ if ( stream.is_open() && stream.good() ) { if ( stream.rdbuf()->in_avail() > 0 ) { // socket has buffered data, push it back to queue - MT_REENTRANT( me->_dlock, _1 ); + xmt::scoped_lock lk(me->_dlock); me->_conn_pool.push_back( c ); me->_observer_cnd.set( true ); me->_pool_cnd.set( true ); @@ -428,7 +428,7 @@ for ( idle_count = 0; idle_count < 2; ++idle_count ) { { - MT_REENTRANT( me->_dlock, _1 ); + xmt::scoped_lock lk(me->_dlock); if ( !me->_follow ) { break; } @@ -481,7 +481,7 @@ // std::swap( pool_size[0], pool_size[1] ); std::rotate( pool_size, pool_size, pool_size + 3 ); { - MT_REENTRANT( me->_dlock, _1 ); + xmt::scoped_lock lk(me->_dlock); pool_size[2] = static_cast<int>(me->_conn_pool.size()); tpop = me->_tpop; } @@ -535,7 +535,7 @@ template <class Connect> void sockmgr_stream_MP_SELECT<Connect>::_open( sock_base::stype t ) { - MT_REENTRANT( _fd_lck, _1 ); + xmt::scoped_lock lk(_fd_lck); if ( is_open_unsafe() ) { if ( t == sock_base::sock_stream ) { _accept = &_Self_type::accept_tcp; @@ -655,11 +655,11 @@ FD_ZERO( &_pfde ); // *** Set all listen sockets here... - MT_LOCK( _fd_lck ); + _fd_lck.lock(); FD_SET( fd_unsafe(), &_pfdr ); FD_SET( fd_unsafe(), &_pfde ); _fdmax = fd_unsafe(); - MT_UNLOCK( _fd_lck ); + _fd_lck.unlock(); for ( typename container_type::iterator i = _M_c.begin(); i != _M_c.end(); ++i ) { if ( (*i)->s->is_open() ) { FD_SET( (*i)->s->rdbuf()->fd(), &_pfdr ); @@ -677,7 +677,7 @@ return 0; // poll wait infinite, so it can't return 0 (timeout), so it return -1. } - MT_REENTRANT( _fd_lck, _1 ); + xmt::scoped_lock lk(_fd_lck); if ( !is_open_unsafe() || FD_ISSET( fd_unsafe(), &_pfde ) ) { // may be already closed return 0; } Modified: branches/complement-xmt/explore/include/sockios/sockmgr.h =================================================================== --- branches/complement-xmt/explore/include/sockios/sockmgr.h 2007-07-11 07:35:11 UTC (rev 1602) +++ branches/complement-xmt/explore/include/sockios/sockmgr.h 2007-07-11 17:56:00 UTC (rev 1603) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <07/02/12 14:50:57 ptr> +// -*- C++ -*- Time-stamp: <07/07/11 20:57:31 ptr> /* * Copyright (c) 1997-1999, 2002, 2003, 2005-2007 @@ -85,19 +85,19 @@ public: bool is_open() const - { MT_REENTRANT( _fd_lck, _1 ); return is_open_unsafe(); } + { xmt::scoped_lock lk(_fd_lck); return is_open_unsafe(); } bool good() const { return _state == ios_base::goodbit; } sock_base::socket_type fd() const - { MT_REENTRANT( _fd_lck, _1 ); return fd_unsafe(); } + { xmt::scoped_lock lk(_fd_lck); return fd_unsafe(); } __FIT_DECLSPEC void shutdown( sock_base::shutdownflg dir ); void setoptions( sock_base::so_t optname, bool on_off = true, int __v = 0 ) { - MT_REENTRANT( _fd_lck, _1 ); + xmt::scoped_lock lk(_fd_lck); setoptions_unsafe( optname, on_off, __v ); } @@ -114,7 +114,7 @@ protected: xmt::mutex _fd_lck; - xmt::Condition _loop_cnd; + xmt::condition _loop_cnd; }; class ConnectionProcessorTemplate_MP // As reference @@ -293,14 +293,14 @@ _fd_sequence _pfd; int _cfd; // sock_base::socket_type _connect_pool_sequence _conn_pool; - xmt::Condition _pool_cnd; + xmt::condition _pool_cnd; xmt::mutex _dlock; timespec _tpop; xmt::mutex _flock; bool _follow; - xmt::Condition _observer_cnd; + xmt::condition _observer_cnd; timespec _busylimit; // start new thread to process incoming // requests, if processing thread busy // more then _busylimit Modified: branches/complement-xmt/explore/include/stem/Cron.h =================================================================== --- branches/complement-xmt/explore/include/stem/Cron.h 2007-07-11 07:35:11 UTC (rev 1602) +++ branches/complement-xmt/explore/include/stem/Cron.h 2007-07-11 17:56:00 UTC (rev 1603) @@ -1,7 +1,7 @@ -// -*- C++ -*- Time-stamp: <06/12/15 03:20:55 ptr> +// -*- C++ -*- Time-stamp: <07/07/11 21:20:12 ptr> /* - * Copyright (c) 1998, 2002, 2003, 2005 + * Copyright (c) 1998, 2002, 2003, 2005, 2007 * Petr Ovtchenkov * * Copyright (c) 1999-2001 @@ -18,9 +18,7 @@ #include <config/feature.h> #endif -#ifndef __IOSFWD__ #include <iosfwd> -#endif #ifndef __stem_EventHandler_h #include <stem/EventHandler.h> @@ -157,7 +155,7 @@ static xmt::Thread::ret_code _loop( void * ); xmt::Thread _thr; - xmt::Condition cond; + xmt::condition cond; typedef __CronEntry value_type; typedef std::priority_queue<value_type, Modified: branches/complement-xmt/explore/include/stem/EvManager.h =================================================================== --- branches/complement-xmt/explore/include/stem/EvManager.h 2007-07-11 07:35:11 UTC (rev 1602) +++ branches/complement-xmt/explore/include/stem/EvManager.h 2007-07-11 17:56:00 UTC (rev 1603) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <07/03/12 17:18:41 ptr> +// -*- C++ -*- Time-stamp: <07/07/11 21:17:27 ptr> /* * Copyright (c) 1995-1999, 2002, 2003, 2005, 2006 @@ -123,31 +123,31 @@ bool is_avail( addr_type id ) const { - MT_REENTRANT( _lock_heap, _x1 ); + xmt::scoped_lock lk( _lock_heap ); return unsafe_is_avail(id); } const std::string who_is( addr_type id ) const { - MT_REENTRANT( _lock_iheap, _x1 ); + xmt::scoped_lock lk( _lock_iheap ); return unsafe_who_is( id ); } const std::string annotate( addr_type id ) const { - MT_REENTRANT( _lock_iheap, _x1 ); + xmt::scoped_lock lk( _lock_iheap ); return unsafe_annotate( id ); } void change_announce( addr_type id, const std::string& info ) { - MT_REENTRANT( _lock_iheap, _x1 ); + xmt::scoped_lock lk( _lock_iheap ); unsafe_change_announce( id, info ); } void change_announce( addr_type id, const char *info ) { - MT_REENTRANT( _lock_iheap, _x1 ); + xmt::scoped_lock lk( _lock_iheap ); unsafe_change_announce( id, info ); } @@ -155,7 +155,7 @@ void push( const Event& e ) { - MT_REENTRANT( _lock_queue, _x1 ); + xmt::scoped_lock lk( _lock_queue ); in_ev_queue.push_back( e ); _cnd_queue.set( true ); } @@ -253,7 +253,7 @@ xmt::mutex _lock_xheap; xmt::mutex _lock_queue; - xmt::Condition _cnd_queue; + xmt::condition _cnd_queue; static std::string inv_key_str; xmt::mutex _lock_tr; Modified: branches/complement-xmt/explore/lib/mt/ChangeLog =================================================================== --- branches/complement-xmt/explore/lib/mt/ChangeLog 2007-07-11 07:35:11 UTC (rev 1602) +++ branches/complement-xmt/explore/lib/mt/ChangeLog 2007-07-11 17:56:00 UTC (rev 1603) @@ -1,3 +1,7 @@ +2007-07-11 Petr Ovtchenkov <pt...@is...> + + * xmt.h, shm.h: Condition replaced by condition. + 2007-06-29 Petr Ovtchenkov <pt...@is...> * xmt.h, xmt.cc, uid.cc, thr_mgr.cc: replace Locker by scoped_lock. Modified: branches/complement-xmt/explore/lib/sockios/ChangeLog =================================================================== --- branches/complement-xmt/explore/lib/sockios/ChangeLog 2007-07-11 07:35:11 UTC (rev 1602) +++ branches/complement-xmt/explore/lib/sockios/ChangeLog 2007-07-11 17:56:00 UTC (rev 1603) @@ -1,3 +1,7 @@ +2007-07-11 Petr Ovtchenkov <pt...@is...> + + * sockmgr.h, sockmgr.cc: Condition replaced by condition. + 2007-06-29 Petr Ovtchenkov <pt...@is...> * sockmgr.cc, sockios_test.cc: replace Locker by scoped_lock. Modified: branches/complement-xmt/explore/lib/stem/ChangeLog =================================================================== --- branches/complement-xmt/explore/lib/stem/ChangeLog 2007-07-11 07:35:11 UTC (rev 1602) +++ branches/complement-xmt/explore/lib/stem/ChangeLog 2007-07-11 17:56:00 UTC (rev 1603) @@ -1,3 +1,7 @@ +2007-07-11 Petr Ovtchenkov <pt...@is...> + + * EvManager.h, Cron.h: Condition replaced by condition. + 2007-06-29 Petr Ovtchenkov <pt...@is...> * NetTransport.cc, EvManager.cc: replace Locker by scoped_lock. Modified: branches/complement-xmt/explore/test/mt/lfs.cc =================================================================== --- branches/complement-xmt/explore/test/mt/lfs.cc 2007-07-11 07:35:11 UTC (rev 1602) +++ branches/complement-xmt/explore/test/mt/lfs.cc 2007-07-11 17:56:00 UTC (rev 1603) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <06/12/15 10:44:27 ptr> +// -*- C++ -*- Time-stamp: <07/07/11 21:22:41 ptr> /* * Copyright (c) 2004, 2006 @@ -30,7 +30,7 @@ static mutex m; static mutex b; static int cnt = 0; -static Condition cnd; +static condition cnd; static Thread::ret_code thread_func( void * ) { Modified: branches/complement-xmt/explore/test/mt/mt_test.cc =================================================================== --- branches/complement-xmt/explore/test/mt/mt_test.cc 2007-07-11 07:35:11 UTC (rev 1602) +++ branches/complement-xmt/explore/test/mt/mt_test.cc 2007-07-11 17:56:00 UTC (rev 1603) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <07/03/12 20:39:47 ptr> +// -*- C++ -*- Time-stamp: <07/07/11 21:25:32 ptr> /* * Copyright (c) 2006, 2007 @@ -383,7 +383,7 @@ // cerr << "Error on shmat" << endl; // } - xmt::__Condition<true>& fcnd = *new( buf ) xmt::__Condition<true>(); + xmt::__condition<true>& fcnd = *new( buf ) xmt::__condition<true>(); fcnd.set( false ); try { @@ -414,7 +414,7 @@ catch ( ... ) { } - (&fcnd)->~__Condition<true>(); + (&fcnd)->~__condition<true>(); shmdt( buf ); shmctl( id, IPC_RMID, &ds ); @@ -440,7 +440,7 @@ // cerr << "Error on shmat" << endl; // } - xmt::__Condition<true>& fcnd = *new( buf ) xmt::__Condition<true>(); + xmt::__condition<true>& fcnd = *new( buf ) xmt::__condition<true>(); fcnd.set( false ); pid_t my_pid = xmt::getpid(); @@ -451,7 +451,7 @@ // Child code BOOST_CHECK( my_pid == xmt::getppid() ); - *reinterpret_cast<pid_t *>(static_cast<char *>(buf) + sizeof(xmt::__Condition<true>)) = xmt::getpid(); + *reinterpret_cast<pid_t *>(static_cast<char *>(buf) + sizeof(xmt::__condition<true>)) = xmt::getpid(); fcnd.set( true ); @@ -467,7 +467,7 @@ fcnd.try_wait(); - BOOST_CHECK( *reinterpret_cast<pid_t *>(static_cast<char *>(buf) + sizeof(xmt::__Condition<true>)) == child.pid() ); + BOOST_CHECK( *reinterpret_cast<pid_t *>(static_cast<char *>(buf) + sizeof(xmt::__condition<true>)) == child.pid() ); int stat; BOOST_CHECK( waitpid( child.pid(), &stat, 0 ) == child.pid() ); @@ -478,7 +478,7 @@ catch ( ... ) { } - (&fcnd)->~__Condition<true>(); + (&fcnd)->~__condition<true>(); shmdt( buf ); shmctl( id, IPC_RMID, &ds ); @@ -643,7 +643,7 @@ seg.allocate( fname, 1024, xmt::shm_base::create | xmt::shm_base::exclusive, 0660 ); xmt::allocator_shm<char,0> shm; - xmt::__Condition<true>& fcnd = *new( shm.allocate( sizeof(xmt::__Condition<true>) ) ) xmt::__Condition<true>(); + xmt::__condition<true>& fcnd = *new( shm.allocate( sizeof(xmt::__condition<true>) ) ) xmt::__condition<true>(); fcnd.set( false ); try { xmt::fork(); @@ -674,8 +674,8 @@ catch ( ... ) { } - (&fcnd)->~__Condition<true>(); - shm.deallocate( reinterpret_cast<char *>(&fcnd), sizeof(xmt::__Condition<true>) ); + (&fcnd)->~__condition<true>(); + shm.deallocate( reinterpret_cast<char *>(&fcnd), sizeof(xmt::__condition<true>) ); seg.deallocate(); fs::remove( fname ); } @@ -699,9 +699,9 @@ seg.allocate( fname, 4*4096, xmt::shm_base::create | xmt::shm_base::exclusive, 0660 ); xmt::shm_name_mgr<0>& nm = seg.name_mgr(); - xmt::allocator_shm<xmt::__Condition<true>,0> shm; + xmt::allocator_shm<xmt::__condition<true>,0> shm; - xmt::__Condition<true>& fcnd = *new ( shm.allocate( 1 ) ) xmt::__Condition<true>(); + xmt::__condition<true>& fcnd = *new ( shm.allocate( 1 ) ) xmt::__condition<true>(); nm.named( fcnd, test_Condition_Object ); fcnd.set( false ); @@ -722,7 +722,7 @@ } xmt::shm_name_mgr<0>& nm_ch = seg_ch.name_mgr(); - xmt::__Condition<true>& fcnd_ch = nm_ch.named<xmt::__Condition<true> >( test_Condition_Object ); + xmt::__condition<true>& fcnd_ch = nm_ch.named<xmt::__condition<true> >( test_Condition_Object ); fcnd_ch.set( true ); } catch ( const xmt::shm_bad_alloc& err ) { @@ -754,7 +754,7 @@ BOOST_CHECK_MESSAGE( false, "Fail in fork" ); } - (&fcnd)->~__Condition<true>(); + (&fcnd)->~__condition<true>(); shm.deallocate( &fcnd, 1 ); seg.deallocate(); fs::remove( fname ); @@ -794,9 +794,9 @@ try { xmt::shm_name_mgr<1>& nm = seg1.name_mgr(); - xmt::allocator_shm<xmt::__Condition<true>,1> shm; + xmt::allocator_shm<xmt::__condition<true>,1> shm; - xmt::__Condition<true>& fcnd = *new ( shm.allocate( 1 ) ) xmt::__Condition<true>(); + xmt::__condition<true>& fcnd = *new ( shm.allocate( 1 ) ) xmt::__condition<true>(); nm.named( fcnd, ObjName ); fcnd.set( false ); @@ -805,10 +805,10 @@ try { xmt::shm_name_mgr<1>& nm_ch = seg1.name_mgr(); - xmt::allocator_shm<xmt::__Condition<true>,1> shm_ch; - xmt::__Condition<true>& fcnd_ch = nm_ch.named<xmt::__Condition<true> >( ObjName ); + xmt::allocator_shm<xmt::__condition<true>,1> shm_ch; + xmt::__condition<true>& fcnd_ch = nm_ch.named<xmt::__condition<true> >( ObjName ); fcnd_ch.set( true ); - nm_ch.release<xmt::__Condition<true> >( ObjName ); + nm_ch.release<xmt::__condition<true> >( ObjName ); } catch ( const std::invalid_argument& err ) { BOOST_CHECK_MESSAGE( false, "error report: " << err.what() ); @@ -820,9 +820,9 @@ int stat; BOOST_CHECK( waitpid( child.pid(), &stat, 0 ) == child.pid() ); } - nm.release<xmt::__Condition<true> >( ObjName ); // fcnd should be destroyed here + nm.release<xmt::__condition<true> >( ObjName ); // fcnd should be destroyed here - xmt::__Condition<true>& fcnd1 = *new ( shm.allocate( 1 ) ) xmt::__Condition<true>(); + xmt::__condition<true>& fcnd1 = *new ( shm.allocate( 1 ) ) xmt::__condition<true>(); nm.named( fcnd1, ObjName ); // ObjName should be free here fcnd1.set( false ); @@ -831,10 +831,10 @@ try { xmt::shm_name_mgr<1>& nm_ch = seg1.name_mgr(); - xmt::allocator_shm<xmt::__Condition<true>,1> shm_ch; - xmt::__Condition<true>& fcnd_ch = nm_ch.named<xmt::__Condition<true> >( ObjName ); + xmt::allocator_shm<xmt::__condition<true>,1> shm_ch; + xmt::__condition<true>& fcnd_ch = nm_ch.named<xmt::__condition<true> >( ObjName ); fcnd_ch.set( true ); - nm_ch.release<xmt::__Condition<true> >( ObjName ); + nm_ch.release<xmt::__condition<true> >( ObjName ); } catch ( const std::invalid_argument& err ) { BOOST_CHECK_MESSAGE( false, "error report: " << err.what() ); @@ -847,7 +847,7 @@ int stat; BOOST_CHECK( waitpid( child.pid(), &stat, 0 ) == child.pid() ); } - nm.release<xmt::__Condition<true> >( ObjName ); // fcnd should be destroyed here + nm.release<xmt::__condition<true> >( ObjName ); // fcnd should be destroyed here xmt::allocator_shm<xmt::__Barrier<true>,1> shm_b; xmt::__Barrier<true>& b = *new ( shm_b.allocate( 1 ) ) xmt::__Barrier<true>(); Modified: branches/complement-xmt/explore/test/mt/signal-1.cc =================================================================== --- branches/complement-xmt/explore/test/mt/signal-1.cc 2007-07-11 07:35:11 UTC (rev 1602) +++ branches/complement-xmt/explore/test/mt/signal-1.cc 2007-07-11 17:56:00 UTC (rev 1603) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <06/12/16 00:28:34 ptr> +// -*- C++ -*- Time-stamp: <07/07/11 21:21:38 ptr> /* * Copyright (c) 2003, 2006 @@ -33,7 +33,7 @@ static int v = 0; -static Condition cnd; +static condition cnd; extern "C" { static void handler( int ); Modified: branches/complement-xmt/explore/test/mt/signal-3.cc =================================================================== --- branches/complement-xmt/explore/test/mt/signal-3.cc 2007-07-11 07:35:11 UTC (rev 1602) +++ branches/complement-xmt/explore/test/mt/signal-3.cc 2007-07-11 17:56:00 UTC (rev 1603) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <06/12/16 00:35:45 ptr> +// -*- C++ -*- Time-stamp: <07/07/11 21:22:05 ptr> /* * Copyright (c) 2003, 2006 @@ -38,7 +38,7 @@ static int v = 0; -static Condition cnd; +static condition cnd; extern "C" { static void handler( int ); Modified: branches/complement-xmt/explore/test/sockios/bytes_in_socket.cc =================================================================== --- branches/complement-xmt/explore/test/sockios/bytes_in_socket.cc 2007-07-11 07:35:11 UTC (rev 1602) +++ branches/complement-xmt/explore/test/sockios/bytes_in_socket.cc 2007-07-11 17:56:00 UTC (rev 1603) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <06/10/10 20:35:08 ptr> +// -*- C++ -*- Time-stamp: <07/07/11 21:35:39 ptr> /* * @@ -43,7 +43,7 @@ extern int port; extern xmt::mutex pr_lock; -static Condition cnd; +static condition cnd; class ConnectionProcessor4 // dummy variant { Modified: branches/complement-xmt/explore/test/sockios/bytes_in_socket2.cc =================================================================== --- branches/complement-xmt/explore/test/sockios/bytes_in_socket2.cc 2007-07-11 07:35:11 UTC (rev 1602) +++ branches/complement-xmt/explore/test/sockios/bytes_in_socket2.cc 2007-07-11 17:56:00 UTC (rev 1603) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <06/10/10 21:31:27 ptr> +// -*- C++ -*- Time-stamp: <07/07/11 21:36:14 ptr> /* * @@ -34,7 +34,7 @@ extern int port; extern xmt::mutex pr_lock; -static Condition cnd; +static condition cnd; class ConnectionProcessor7 // dummy variant { Modified: branches/complement-xmt/explore/test/sockios/client-wc.cc =================================================================== --- branches/complement-xmt/explore/test/sockios/client-wc.cc 2007-07-11 07:35:11 UTC (rev 1602) +++ branches/complement-xmt/explore/test/sockios/client-wc.cc 2007-07-11 17:56:00 UTC (rev 1603) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <07/01/29 17:48:29 ptr> +// -*- C++ -*- Time-stamp: <07/07/11 21:34:07 ptr> /* * Copyright (c) 2004, 2006 @@ -28,7 +28,7 @@ Suspicious processing with FreeBSD and OpenBSD servers. */ -static Condition cnd_close; +static condition cnd_close; class Srv // { @@ -67,7 +67,7 @@ #endif static srv_type *srv_p; -Condition cnd; +condition cnd; Thread::ret_code server_proc( void * ) { Modified: branches/complement-xmt/explore/test/sockios/close_socket.cc =================================================================== --- branches/complement-xmt/explore/test/sockios/close_socket.cc 2007-07-11 07:35:11 UTC (rev 1602) +++ branches/complement-xmt/explore/test/sockios/close_socket.cc 2007-07-11 17:56:00 UTC (rev 1603) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <06/08/04 12:03:39 ptr> +// -*- C++ -*- Time-stamp: <07/07/11 21:34:53 ptr> /* * @@ -64,7 +64,7 @@ // with Input line prompt } -Condition cnd2; +condition cnd2; void ConnectionProcessor3::connect( std::sockstream& s ) { @@ -103,7 +103,7 @@ pr_lock.unlock(); } -Condition cnd1; +condition cnd1; // Condition cnd2; std::sockstream *psock = 0; Modified: branches/complement-xmt/explore/test/sockios/sockios_test.cc =================================================================== --- branches/complement-xmt/explore/test/sockios/sockios_test.cc 2007-07-11 07:35:11 UTC (rev 1602) +++ branches/complement-xmt/explore/test/sockios/sockios_test.cc 2007-07-11 17:56:00 UTC (rev 1603) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <07/02/26 17:18:51 ptr> +// -*- C++ -*- Time-stamp: <07/07/11 21:40:23 ptr> /* * @@ -26,7 +26,7 @@ const char fname[] = "/tmp/sockios_test.shm"; xmt::shm_alloc<0> seg; -xmt::allocator_shm<xmt::__Condition<true>,0> shm_cnd; +xmt::allocator_shm<xmt::__condition<true>,0> shm_cnd; xmt::allocator_shm<xmt::__Barrier<true>,0> shm_b; sockios_test::sockios_test() @@ -228,10 +228,10 @@ void sockios_test::sigpipe() { try { - xmt::__Condition<true>& fcnd = *new ( shm_cnd.allocate( 1 ) ) xmt::__Condition<true>(); + xmt::__condition<true>& fcnd = *new ( shm_cnd.allocate( 1 ) ) xmt::__condition<true>(); fcnd.set( false ); - xmt::__Condition<true>& tcnd = *new ( shm_cnd.allocate( 1 ) ) xmt::__Condition<true>(); + xmt::__condition<true>& tcnd = *new ( shm_cnd.allocate( 1 ) ) xmt::__condition<true>(); tcnd.set( false ); try { @@ -284,9 +284,9 @@ } } - (&tcnd)->~__Condition<true>(); + (&tcnd)->~__condition<true>(); shm_cnd.deallocate( &tcnd, 1 ); - (&fcnd)->~__Condition<true>(); + (&fcnd)->~__condition<true>(); shm_cnd.deallocate( &fcnd, 1 ); } catch ( xmt::shm_bad_alloc& err ) { @@ -304,7 +304,7 @@ void connect( std::sockstream& ); void close(); - static xmt::__Condition<true> *cnd; + static xmt::__condition<true> *cnd; }; long_msg_processor::long_msg_processor( std::sockstream& ) @@ -329,15 +329,15 @@ cnd->set( true ); } -xmt::__Condition<true> *long_msg_processor::cnd; +xmt::__condition<true> *long_msg_processor::cnd; void sockios_test::long_msg() { try { - xmt::__Condition<true>& fcnd = *new ( shm_cnd.allocate( 1 ) ) xmt::__Condition<true>(); + xmt::__condition<true>& fcnd = *new ( shm_cnd.allocate( 1 ) ) xmt::__condition<true>(); fcnd.set( false ); - xmt::__Condition<true>& srv_cnd = *new ( shm_cnd.allocate( 1 ) ) xmt::__Condition<true>(); + xmt::__condition<true>& srv_cnd = *new ( shm_cnd.allocate( 1 ) ) xmt::__condition<true>(); srv_cnd.set( false ); long_msg_processor::cnd = &srv_cnd; @@ -380,10 +380,10 @@ } - (&fcnd)->~__Condition<true>(); + (&fcnd)->~__condition<true>(); shm_cnd.deallocate( &fcnd, 1 ); - (&srv_cnd)->~__Condition<true>(); + (&srv_cnd)->~__condition<true>(); shm_cnd.deallocate( &srv_cnd, 1 ); } catch ( xmt::shm_bad_alloc& err ) { @@ -469,7 +469,7 @@ xmt::Thread::ret_code thread_entry( void *par ) { xmt::Thread::ret_code rt; - xmt::Condition& cnd = *reinterpret_cast<xmt::Condition *>(par); + xmt::condition& cnd = *reinterpret_cast<xmt::condition *>(par); // sem.wait(); // wait server for listen us sockstream sock( "localhost", ::port ); @@ -489,7 +489,7 @@ void sockios_test::read0() { try { - xmt::__Condition<true>& fcnd = *new ( shm_cnd.allocate( 1 ) ) xmt::__Condition<true>(); + xmt::__condition<true>& fcnd = *new ( shm_cnd.allocate( 1 ) ) xmt::__condition<true>(); xmt::__Barrier<true>& b = *new ( shm_b.allocate( 1 ) ) xmt::__Barrier<true>(); ConnectionProcessor5::b = &b; // nm.named( fcnd, 1 ); @@ -499,7 +499,7 @@ xmt::fork(); // <---- key line fcnd.try_wait(); // wait server for listen us - xmt::Condition cnd; + xmt::condition cnd; cnd.set( false ); xmt::Thread thr( thread_entry, &cnd ); @@ -532,7 +532,7 @@ (&b)->~__Barrier<true>(); shm_b.deallocate( &b, 1 ); - (&fcnd)->~__Condition<true>(); + (&fcnd)->~__condition<true>(); shm_cnd.deallocate( &fcnd, 1 ); } catch ( xmt::shm_bad_alloc& err ) { @@ -550,10 +550,10 @@ void connect( std::sockstream& ); void close(); - static xmt::Condition cnd; + static xmt::condition cnd; }; -xmt::Condition ConnectionProcessor6::cnd; +xmt::condition ConnectionProcessor6::cnd; ConnectionProcessor6::ConnectionProcessor6( std::sockstream& s ) { @@ -633,10 +633,10 @@ void connect( std::sockstream& ); void close(); - static xmt::Condition cnd; + static xmt::condition cnd; }; -xmt::Condition LongBlockReader::cnd; +xmt::condition LongBlockReader::cnd; LongBlockReader::LongBlockReader( std::sockstream& s ) { Modified: branches/complement-xmt/explore/test/stem/Echo.h =================================================================== --- branches/complement-xmt/explore/test/stem/Echo.h 2007-07-11 07:35:11 UTC (rev 1602) +++ branches/complement-xmt/explore/test/stem/Echo.h 2007-07-11 17:56:00 UTC (rev 1603) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <06/10/11 00:56:13 ptr> +// -*- C++ -*- Time-stamp: <07/07/11 21:45:09 ptr> /* * Copyright (c) 2006 @@ -28,7 +28,7 @@ void echo( const stem::Event& ); void regme( const stem::Event& ); - xmt::Condition cnd; + xmt::condition cnd; private: DECLARE_RESPONSE_TABLE( StEMecho, stem::EventHandler ); @@ -50,7 +50,7 @@ const std::string mess; private: - xmt::Condition cnd; + xmt::condition cnd; DECLARE_RESPONSE_TABLE( EchoClient, stem::EventHandler ); }; @@ -72,7 +72,7 @@ const std::string mess; private: - xmt::Condition cnd; + xmt::condition cnd; DECLARE_RESPONSE_TABLE( PeerClient, stem::EventHandler ); }; Modified: branches/complement-xmt/explore/test/stem/NameService.h =================================================================== --- branches/complement-xmt/explore/test/stem/NameService.h 2007-07-11 07:35:11 UTC (rev 1602) +++ branches/complement-xmt/explore/test/stem/NameService.h 2007-07-11 17:56:00 UTC (rev 1603) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <06/11/24 19:33:11 ptr> +// -*- C++ -*- Time-stamp: <07/07/11 21:47:37 ptr> /* * Copyright (c) 2006 @@ -36,7 +36,7 @@ nsrecords_type::container_type lst; private: - xmt::Condition cnd; + xmt::condition cnd; DECLARE_RESPONSE_TABLE( Naming, stem::EventHandler ); }; Modified: branches/complement-xmt/explore/test/stem/Node.h =================================================================== --- branches/complement-xmt/explore/test/stem/Node.h 2007-07-11 07:35:11 UTC (rev 1602) +++ branches/complement-xmt/explore/test/stem/Node.h 2007-07-11 17:56:00 UTC (rev 1603) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <06/09/29 22:53:43 ptr> +// -*- C++ -*- Time-stamp: <07/07/11 21:47:25 ptr> /* * @@ -31,7 +31,7 @@ int v; private: - xmt::Condition cnd; + xmt::condition cnd; DECLARE_RESPONSE_TABLE( Node, stem::EventHandler ); }; @@ -52,7 +52,7 @@ int v; private: - xmt::Condition cnd; + xmt::condition cnd; DECLARE_RESPONSE_TABLE( NewNode, stem::EventHandler ); }; Modified: branches/complement-xmt/explore/test/stem/NodeDL.h =================================================================== --- branches/complement-xmt/explore/test/stem/NodeDL.h 2007-07-11 07:35:11 UTC (rev 1602) +++ branches/complement-xmt/explore/test/stem/NodeDL.h 2007-07-11 17:56:00 UTC (rev 1603) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <06/09/29 22:50:51 ptr> +// -*- C++ -*- Time-stamp: <07/07/11 21:47:58 ptr> /* * @@ -30,7 +30,7 @@ int v; private: - xmt::Condition cnd; + xmt::condition cnd; DECLARE_RESPONSE_TABLE( NodeDL, stem::EventHandler ); }; @@ -51,7 +51,7 @@ int v; private: - xmt::Condition cnd; + xmt::condition cnd; DECLARE_RESPONSE_TABLE( NewNodeDL, stem::EventHandler ); }; Modified: branches/complement-xmt/explore/test/stem/unit_test.cc =================================================================== --- branches/complement-xmt/explore/test/stem/unit_test.cc 2007-07-11 07:35:11 UTC (rev 1602) +++ branches/complement-xmt/explore/test/stem/unit_test.cc 2007-07-11 17:56:00 UTC (rev 1603) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <07/03/12 21:20:54 ptr> +// -*- C++ -*- Time-stamp: <07/07/11 21:46:57 ptr> /* * Copyright (c) 2002, 2003, 2006 @@ -295,7 +295,7 @@ const char fname[] = "/tmp/stem_test.shm"; xmt::shm_alloc<0> seg; -xmt::allocator_shm<xmt::__Condition<true>,0> shm_cnd; +xmt::allocator_shm<xmt::__condition<true>,0> shm_cnd; xmt::allocator_shm<xmt::__Barrier<true>,0> shm_b; void stem_test::shm_init() @@ -316,7 +316,7 @@ void stem_test::echo_net() { - xmt::__Condition<true>& fcnd = *new ( shm_cnd.allocate( 1 ) ) xmt::__Condition<true>(); + xmt::__condition<true>& fcnd = *new ( shm_cnd.allocate( 1 ) ) xmt::__condition<true>(); fcnd.set( false ); try { @@ -369,7 +369,7 @@ } } - (&fcnd)->~__Condition<true>(); + (&fcnd)->~__condition<true>(); shm_cnd.deallocate( &fcnd, 1 ); // cerr << "Fine\n"; @@ -381,7 +381,7 @@ { try { xmt::__Barrier<true>& b = *new ( shm_b.allocate( 1 ) ) xmt::__Barrier<true>(); - xmt::__Condition<true>& c = *new ( shm_cnd.allocate( 1 ) ) xmt::__Condition<true>(); + xmt::__condition<true>& c = *new ( shm_cnd.allocate( 1 ) ) xmt::__condition<true>(); c.set( false ); @@ -439,7 +439,7 @@ BOOST_CHECK( waitpid( child.pid(), &stat, 0 ) == child.pid() ); } - (&c)->~__Condition<true>(); + (&c)->~__condition<true>(); shm_cnd.deallocate( &c, 1 ); (&b)->~__Barrier<true>(); shm_b.deallocate( &b, 1 ); @@ -477,13 +477,13 @@ pid_t fpid; - xmt::__Condition<true>& fcnd = *new ( shm_cnd.allocate( 1 ) ) xmt::__Condition<true>(); + xmt::__condition<true>& fcnd = *new ( shm_cnd.allocate( 1 ) ) xmt::__condition<true>(); fcnd.set( false ); - xmt::__Condition<true>& pcnd = *new ( shm_cnd.allocate( 1 ) ) xmt::__Condition<true>(); + xmt::__condition<true>& pcnd = *new ( shm_cnd.allocate( 1 ) ) xmt::__condition<true>(); pcnd.set( false ); - xmt::__Condition<true>& scnd = *new ( shm_cnd.allocate( 1 ) ) xmt::__Condition<true>(); + xmt::__condition<true>& scnd = *new ( shm_cnd.allocate( 1 ) ) xmt::__condition<true>(); scnd.set( false ); try { @@ -653,17 +653,17 @@ srv.wait(); } - (&fcnd)->~__Condition<true>(); + (&fcnd)->~__condition<true>(); shm_cnd.deallocate( &fcnd, 1 ); - (&pcnd)->~__Condition<true>(); + (&pcnd)->~__condition<true>(); shm_cnd.deallocate( &pcnd, 1 ); - (&scnd)->~__Condition<true>(); + (&scnd)->~__condition<true>(); shm_cnd.deallocate( &scnd, 1 ); } void stem_test::boring_manager() { - xmt::__Condition<true>& fcnd = *new ( shm_cnd.allocate( 1 ) ) xmt::__Condition<true>(); + xmt::__condition<true>& fcnd = *new ( shm_cnd.allocate( 1 ) ) xmt::__condition<true>(); fcnd.set( false ); try { @@ -707,7 +707,7 @@ srv.wait(); } - (&fcnd)->~__Condition<true>(); + (&fcnd)->~__condition<true>(); shm_cnd.deallocate( &fcnd, 1 ); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2007-07-11 07:35:15
|
Revision: 1602 http://svn.sourceforge.net/complement/?rev=1602&view=rev Author: complement Date: 2007-07-11 00:35:11 -0700 (Wed, 11 Jul 2007) Log Message: ----------- test functions return int, conditional run (from dependency) Modified Paths: -------------- trunk/complement/explore/app/exam/suite.cc trunk/complement/explore/app/exam/suite.h trunk/complement/explore/app/exam/zero.cc Modified: trunk/complement/explore/app/exam/suite.cc =================================================================== --- trunk/complement/explore/app/exam/suite.cc 2007-07-10 17:12:18 UTC (rev 1601) +++ trunk/complement/explore/app/exam/suite.cc 2007-07-11 07:35:11 UTC (rev 1602) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <07/07/08 23:39:10 ptr> +// -*- C++ -*- Time-stamp: <07/07/11 11:10:45 ptr> #include "suite.h" #include <boost/graph/breadth_first_search.hpp> @@ -11,61 +11,87 @@ using namespace std; using namespace boost; +using namespace detail; +namespace detail { -template <class VertexList, class Tag> +template <class Tag> struct vertex_recorder : - public base_visitor<vertex_recorder<VertexList,Tag> > + public base_visitor<vertex_recorder<Tag> > { typedef Tag event_filter; - vertex_recorder(VertexList& pa) : - m_vertex(pa) + vertex_recorder(test_suite& ts) : + _suite(ts) { } template <class Vertex, class Graph> void operator()(Vertex v, const Graph& g) - { m_vertex.push_back( v ); } + { _suite.run_test_case( v ); } - VertexList& m_vertex; + test_suite& _suite; }; -template <class VertexList, class Tag> -vertex_recorder<VertexList, Tag> record_vertexes(VertexList& pa, Tag) -{ return vertex_recorder<VertexList, Tag>(pa); } +template <class Tag> +vertex_recorder<Tag> record_vertexes(test_suite& ts, Tag) +{ return vertex_recorder<Tag>(ts); } +template <class Tag> +struct skip_recorder : + public base_visitor<skip_recorder<Tag> > +{ + typedef Tag event_filter; + + skip_recorder(test_suite& ts) : + _suite(ts) + { } + + template <class Edge, class Graph> + void operator()(Edge e, const Graph& g) + { + // typename graph_traits<Graph>::vertex_descriptor u = boost::source( e, g ); + // typename graph_traits<Graph>::vertex_descriptor v = boost::target( e, g ); + _suite.check_test_case( boost::source( e, g ), boost::target( e, g ) ); + } + + test_suite& _suite; +}; + +template <class Tag> +skip_recorder<Tag> record_skip(test_suite& ts, Tag) +{ return skip_recorder<Tag>(ts); } + +int _root_func() +{ + return 0; +} + +} // namespace detail + test_suite::test_suite() : root( add_vertex( white_color, g ) ) { color = get( vertex_color, g ); testcase = get( vertex_testcase, g ); - _test[root] = 0; + _test[root].tc = detail::make_test_case( detail::call( _root_func ) ); + _test[root].state = 0; } test_suite::~test_suite() { for ( test_case_map_type::iterator i = _test.begin(); i != _test.end(); ++i ) { - delete i->second; + delete i->second.tc; } } void test_suite::girdle() { stack<vertex_t> buffer; - list<vertex_t> v; breadth_first_visit( g, root, buffer, - make_bfs_visitor(record_vertexes(v,on_discover_vertex())), + make_bfs_visitor( + make_pair( record_vertexes(*this,on_discover_vertex()), + record_skip(*this,on_examine_edge()) ) ), color ); - - v.pop_front(); // remove root, it empty - - for ( list<vertex_t>::const_iterator i = v.begin(); i != v.end(); ++i ) { - try { - (*_test[*i])(); - } - catch ( ... ) { - } - } } void test_suite::girdle( test_suite::test_case_type start ) @@ -73,18 +99,10 @@ stack<vertex_t> buffer; list<vertex_t> v; breadth_first_visit( g, start, buffer, - make_bfs_visitor(record_vertexes(v,on_discover_vertex())), + make_bfs_visitor( + make_pair( record_vertexes(*this,on_discover_vertex()), + record_skip(*this,on_examine_edge()) ) ), color ); - - v.pop_front(); // remove root, it empty - - for ( list<vertex_t>::const_iterator i = v.begin(); i != v.end(); ++i ) { - try { - (*_test[*i])(); - } - catch ( ... ) { - } - } } @@ -92,7 +110,8 @@ { vertex_t v = add_vertex( white_color, g); add_edge( root, v, g ); - _test[v] = detail::make_test_case( detail::call( f ) ); + _test[v].tc = detail::make_test_case( detail::call( f ) ); + _test[v].state = 0; return v; } @@ -101,7 +120,8 @@ { vertex_t v = add_vertex( white_color, g); add_edge( depends, v, g ); - _test[v] = detail::make_test_case( detail::call( f ) ); + _test[v].tc = detail::make_test_case( detail::call( f ) ); + _test[v].state = 0; return v; } @@ -140,4 +160,25 @@ (*test_suite::_report)( file, line, cnd, expr ); } +void test_suite::run_test_case( test_suite::vertex_t v ) +{ + try { + if ( _test[v].state == 0 ) { + if ( (*_test[v].tc)() != 0 ) { + _test[v].state = fail; + } + } + } + catch ( ... ) { + _test[v].state = fail; + } +} + +void test_suite::check_test_case( test_suite::vertex_t u, test_suite::vertex_t v ) +{ + if ( _test[u].state != 0 ) { + _test[v].state = skip; + } +} + } // namespace exam Modified: trunk/complement/explore/app/exam/suite.h =================================================================== --- trunk/complement/explore/app/exam/suite.h 2007-07-10 17:12:18 UTC (rev 1601) +++ trunk/complement/explore/app/exam/suite.h 2007-07-11 07:35:11 UTC (rev 1602) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <07/07/08 23:40:05 ptr> +// -*- C++ -*- Time-stamp: <07/07/11 11:02:41 ptr> #ifndef __suite_h #define __suite_h @@ -22,7 +22,7 @@ { virtual ~call_impl() { } - virtual void invoke() = 0; + virtual int invoke() = 0; }; template <typename F> @@ -34,8 +34,8 @@ _f( f ) { } - virtual void invoke() - { _f(); } + virtual int invoke() + { return _f(); } private: F _f; @@ -44,7 +44,7 @@ class dummy { public: - virtual void f() + virtual int f() { } private: virtual ~dummy() @@ -55,7 +55,7 @@ class method_invoker { public: - typedef void (TC::*mf_type)(); + typedef int (TC::*mf_type)(); explicit method_invoker( TC& instance, mf_type f ) : _inst(instance), @@ -67,8 +67,8 @@ _func( m._func ) { } - void operator()() - { (_inst.*_func)(); } + int operator()() + { return (_inst.*_func)(); } private: method_invoker& operator =( const method_invoker<TC>& ) @@ -88,8 +88,8 @@ call( F f ) { new (&_buf[0]) call_impl_t<F>(f); } - void operator()() - { reinterpret_cast<call_impl *>(&_buf[0])->invoke(); } + int operator()() + { return reinterpret_cast<call_impl *>(&_buf[0])->invoke(); } private: // call_impl *_f; @@ -104,8 +104,8 @@ _tc( f ) { } - void operator ()() - { _tc(); } + int operator ()() + { return _tc(); } private: call _tc; @@ -117,7 +117,7 @@ } template <class TC> -inline test_case *make_test_case( void (TC::*f)(), TC& instance ) +inline test_case *make_test_case( int (TC::*f)(), TC& instance ) { return new test_case( method_invoker<TC>(instance, f) ); } @@ -138,7 +138,7 @@ typedef boost::property_map<graph_t,vertex_testcase_t>::type vertex_testcase_map_t; public: - typedef void (*func_type)(); + typedef int (*func_type)(); typedef vertex_t test_case_type; test_suite(); @@ -148,14 +148,17 @@ test_case_type add( func_type, test_case_type ); template <class TC> - test_case_type add( void (TC::*)(), TC& ); + test_case_type add( int (TC::*)(), TC& ); template <class TC> - test_case_type add( void (TC::*)(), TC&, test_case_type ); + test_case_type add( int (TC::*)(), TC&, test_case_type ); void girdle(); void girdle( test_case_type start ); + void run_test_case( vertex_t v ); + void check_test_case( vertex_t u, vertex_t v ); + enum { trace = 1 }; @@ -165,12 +168,23 @@ static void report( const char *, int, bool, const char * ); private: + enum { + fail = 1, + skip = 2 + }; + graph_t g; vertex_t root; vertex_color_map_t color; vertex_testcase_map_t testcase; - typedef std::map<vertex_t,detail::test_case *> test_case_map_type; + struct test_case_collect + { + detail::test_case *tc; + int state; + }; + + typedef std::map<vertex_t,test_case_collect> test_case_map_type; test_case_map_type _test; static int _flags; @@ -178,21 +192,23 @@ }; template <class TC> -test_suite::test_case_type test_suite::add( void (TC::*f)(), TC& instance ) +test_suite::test_case_type test_suite::add( int (TC::*f)(), TC& instance ) { vertex_t v = boost::add_vertex( boost::white_color, g); boost::add_edge( root, v, g ); - _test[v] = detail::make_test_case( f, instance ); + _test[v].tc = detail::make_test_case( f, instance ); + _test[v].state = 0; return v; } template <class TC> -test_suite::test_case_type test_suite::add( void (TC::*f)(), TC& instance, test_suite::test_case_type depends ) +test_suite::test_case_type test_suite::add( int (TC::*f)(), TC& instance, test_suite::test_case_type depends ) { vertex_t v = boost::add_vertex( boost::white_color, g); boost::add_edge( depends, v, g ); - _test[v] = detail::make_test_case( f, instance ); + _test[v].tc = detail::make_test_case( f, instance ); + _test[v].state = 0; return v; } @@ -202,7 +218,7 @@ } // namespace exam #ifdef FIT_EXAM -# define EXAM_CHECK(C) if ( !(C) ) { exam::test_suite::report( __FILE__, __LINE__, false, #C ); } else if ( exam::test_suite::is_trace() ) { exam::test_suite::report( __FILE__, __LINE__, true, #C ); } +# define EXAM_CHECK(C) if ( !(C) ) { exam::test_suite::report( __FILE__, __LINE__, false, #C ); return 1; } else if ( exam::test_suite::is_trace() ) { exam::test_suite::report( __FILE__, __LINE__, true, #C ); } # define EXAM_MESSAGE(M) #else # define EXAM_CHECK(C) Modified: trunk/complement/explore/app/exam/zero.cc =================================================================== --- trunk/complement/explore/app/exam/zero.cc 2007-07-10 17:12:18 UTC (rev 1601) +++ trunk/complement/explore/app/exam/zero.cc 2007-07-11 07:35:11 UTC (rev 1602) @@ -2,18 +2,22 @@ #include "suite.h" -void func() +int func() { EXAM_CHECK(false); + + return 0; } class test_x { public: - void f() + int f() { EXAM_CHECK(false); + + return 0; } }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2007-07-10 17:12:26
|
Revision: 1601 http://svn.sourceforge.net/complement/?rev=1601&view=rev Author: complement Date: 2007-07-10 10:12:18 -0700 (Tue, 10 Jul 2007) Log Message: ----------- function and class function work Modified Paths: -------------- trunk/complement/explore/app/exam/suite.cc trunk/complement/explore/app/exam/suite.h trunk/complement/explore/app/exam/zero.cc Modified: trunk/complement/explore/app/exam/suite.cc =================================================================== --- trunk/complement/explore/app/exam/suite.cc 2007-07-06 06:29:26 UTC (rev 1600) +++ trunk/complement/explore/app/exam/suite.cc 2007-07-10 17:12:18 UTC (rev 1601) @@ -1,9 +1,12 @@ -// -*- C++ -*- Time-stamp: <07/07/06 09:55:44 ptr> +// -*- C++ -*- Time-stamp: <07/07/08 23:39:10 ptr> #include "suite.h" #include <boost/graph/breadth_first_search.hpp> #include <stack> +#include <cstdio> +#include <iostream> + namespace exam { using namespace std; @@ -39,8 +42,15 @@ _test[root] = 0; } -void test_suite::girdle( int start ) +test_suite::~test_suite() { + for ( test_case_map_type::iterator i = _test.begin(); i != _test.end(); ++i ) { + delete i->second; + } +} + +void test_suite::girdle() +{ stack<vertex_t> buffer; list<vertex_t> v; breadth_first_visit( g, root, buffer, @@ -58,6 +68,26 @@ } } +void test_suite::girdle( test_suite::test_case_type start ) +{ + stack<vertex_t> buffer; + list<vertex_t> v; + breadth_first_visit( g, start, buffer, + make_bfs_visitor(record_vertexes(v,on_discover_vertex())), + color ); + + v.pop_front(); // remove root, it empty + + for ( list<vertex_t>::const_iterator i = v.begin(); i != v.end(); ++i ) { + try { + (*_test[*i])(); + } + catch ( ... ) { + } + } +} + + test_suite::test_case_type test_suite::add( test_suite::func_type f ) { vertex_t v = add_vertex( white_color, g); @@ -76,4 +106,38 @@ return v; } +int test_suite::flags() +{ + return _flags; +} + +bool test_suite::is_trace() +{ + return (_flags & trace) != 0; +} + +void _report0( const char *file, int line, bool cnd, const char *expr ) +{ + std::cerr << file << ":" << line << ": " << (cnd ? "pass" : "fail" ) << ": " << expr + << std::endl; +} + +void _report1( const char *file, int line, bool cnd, const char *expr ) +{ + printf( "%s:%d: %s: %s\n", file, line, (cnd ? "pass" : "fail"), expr ); +} + +void _report2( const char *file, int line, bool cnd, const char *expr ) +{ + fprintf( stderr, "%s:%d: %s: %s\n", file, line, (cnd ? "pass" : "fail"), expr ); +} + +int test_suite::_flags = 0; +void (*test_suite::_report)( const char *, int, bool, const char * ) = _report0; + +void test_suite::report( const char *file, int line, bool cnd, const char *expr ) +{ + (*test_suite::_report)( file, line, cnd, expr ); +} + } // namespace exam Modified: trunk/complement/explore/app/exam/suite.h =================================================================== --- trunk/complement/explore/app/exam/suite.h 2007-07-06 06:29:26 UTC (rev 1600) +++ trunk/complement/explore/app/exam/suite.h 2007-07-10 17:12:18 UTC (rev 1601) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <07/07/06 09:58:06 ptr> +// -*- C++ -*- Time-stamp: <07/07/08 23:40:05 ptr> #ifndef __suite_h #define __suite_h @@ -18,15 +18,6 @@ namespace detail { -/* -struct invoker -{ - template <typename F> - void invoke( F& f ) - { f(); } -}; -*/ - struct call_impl { virtual ~call_impl() @@ -44,28 +35,20 @@ { } virtual void invoke() - { /* invoker().invoke( _f ); */ _f(); } + { _f(); } private: F _f; }; -class call +class dummy { public: - call() + virtual void f() { } - - template <class F> - call( F f ) : - _f( new call_impl_t<F>(f) ) + private: + virtual ~dummy() { } - - void operator()() - { _f->invoke(); } - - private: - call_impl *_f; }; template <class TC> @@ -73,19 +56,47 @@ { public: typedef void (TC::*mf_type)(); - method_invoker( TC& instance, mf_type f ) : + + explicit method_invoker( TC& instance, mf_type f ) : _inst(instance), _func(f) { } + method_invoker( const method_invoker<TC>& m ) : + _inst( m._inst ), + _func( m._func ) + { } + void operator()() - { _inst.*_func(); } + { (_inst.*_func)(); } private: + method_invoker& operator =( const method_invoker<TC>& ) + { return *this; } + TC& _inst; mf_type _func; }; +class call +{ + public: + call() + { } + + template <class F> + call( F f ) + { new (&_buf[0]) call_impl_t<F>(f); } + + void operator()() + { reinterpret_cast<call_impl *>(&_buf[0])->invoke(); } + + private: + // call_impl *_f; + char _buf[((sizeof(call_impl_t<method_invoker<dummy> >)+64) / 64) << 6]; +}; + + class test_case { public: @@ -131,24 +142,73 @@ typedef vertex_t test_case_type; test_suite(); + ~test_suite(); test_case_type add( func_type ); test_case_type add( func_type, test_case_type ); - void girdle( int start ); + template <class TC> + test_case_type add( void (TC::*)(), TC& ); + template <class TC> + test_case_type add( void (TC::*)(), TC&, test_case_type ); + + void girdle(); + void girdle( test_case_type start ); + + enum { + trace = 1 + }; + + static int flags(); + static bool is_trace(); + static void report( const char *, int, bool, const char * ); + private: graph_t g; vertex_t root; vertex_color_map_t color; vertex_testcase_map_t testcase; - std::map<vertex_t,detail::test_case *> _test; + typedef std::map<vertex_t,detail::test_case *> test_case_map_type; + test_case_map_type _test; + + static int _flags; + static void (*_report)( const char *, int, bool, const char * ); }; +template <class TC> +test_suite::test_case_type test_suite::add( void (TC::*f)(), TC& instance ) +{ + vertex_t v = boost::add_vertex( boost::white_color, g); + boost::add_edge( root, v, g ); + _test[v] = detail::make_test_case( f, instance ); + + return v; +} + +template <class TC> +test_suite::test_case_type test_suite::add( void (TC::*f)(), TC& instance, test_suite::test_case_type depends ) +{ + vertex_t v = boost::add_vertex( boost::white_color, g); + boost::add_edge( depends, v, g ); + _test[v] = detail::make_test_case( f, instance ); + + return v; +} + typedef test_suite::test_case_type test_case_type; } // namespace exam +#ifdef FIT_EXAM +# define EXAM_CHECK(C) if ( !(C) ) { exam::test_suite::report( __FILE__, __LINE__, false, #C ); } else if ( exam::test_suite::is_trace() ) { exam::test_suite::report( __FILE__, __LINE__, true, #C ); } +# define EXAM_MESSAGE(M) +#else +# define EXAM_CHECK(C) +# define EXAM_MESSAGE(M) +#endif + + #endif // __suite_h Modified: trunk/complement/explore/app/exam/zero.cc =================================================================== --- trunk/complement/explore/app/exam/zero.cc 2007-07-06 06:29:26 UTC (rev 1600) +++ trunk/complement/explore/app/exam/zero.cc 2007-07-10 17:12:18 UTC (rev 1601) @@ -1,66 +1,31 @@ #define FIT_EXAM -#ifdef FIT_EXAM -# define EXAM_CHECK(C) if ( !(C) ) { exam::report( __FILE__, __LINE__, false, #C ); } else if ( exam::base::is_trace() ) { exam::report( __FILE__, __LINE__, true, #C ); } -# define EXAM_MESSAGE(M) -#else -# define EXAM_CHECK(C) -# define EXAM_MESSAGE(M) -#endif - - -#include <cstdio> -#include <iostream> - #include "suite.h" -namespace exam { +void func() +{ + EXAM_CHECK(false); +} -class base +class test_x { public: - enum { - trace = 1 - }; - - static int flags(); - static bool is_trace(); - private: - - static int _flags; + void f() + { + EXAM_CHECK(false); + } }; -void _report0( const char *file, int line, bool cnd, const char *expr ) -{ - std::cerr << file << ":" << line << ": " << (cnd ? "pass" : "fail" ) << " \"" << expr << "\"" - << std::endl; -} -void _report1( const char *file, int line, bool cnd, const char *expr ) -{ - printf( "%s:%d: %s \"%s\"\n", file, line, (cnd ? "pass" : "fail"), expr ); -} - -void _report2( const char *file, int line, bool cnd, const char *expr ) -{ - fprintf( stderr, "%s:%d: %s \"%s\"\n", file, line, (cnd ? "pass" : "fail"), expr ); -} - -void (*report)( const char *, int, bool, const char * ) = _report0; - -} // namespec exam - -void func() -{ - EXAM_CHECK(false); -} - int main( int argc, char **argv ) { exam::test_suite t; + test_x tx; + t.add( func ); + t.add( &test_x::f, tx ); t.girdle( 0 ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2007-07-06 06:29:30
|
Revision: 1600 http://svn.sourceforge.net/complement/?rev=1600&view=rev Author: complement Date: 2007-07-05 23:29:26 -0700 (Thu, 05 Jul 2007) Log Message: ----------- state zero Added Paths: ----------- trunk/complement/explore/app/exam/Makefile trunk/complement/explore/app/exam/Makefile.inc trunk/complement/explore/app/exam/suite.cc trunk/complement/explore/app/exam/suite.h trunk/complement/explore/app/exam/zero.cc Property Changed: ---------------- trunk/complement/explore/app/exam/ Property changes on: trunk/complement/explore/app/exam ___________________________________________________________________ Name: svn:ignore + obj Added: trunk/complement/explore/app/exam/Makefile =================================================================== --- trunk/complement/explore/app/exam/Makefile (rev 0) +++ trunk/complement/explore/app/exam/Makefile 2007-07-06 06:29:26 UTC (rev 1600) @@ -0,0 +1,10 @@ +# -*- Makefile -*- Time-stamp: <07/07/05 09:31:15 ptr> + +SRCROOT := ../.. + +include Makefile.inc +include ${SRCROOT}/Makefiles/gmake/top.mak + +INCLUDES += -I${BOOST_DIR} + +LDFLAGS += -Wl,-rpath=${STLPORT_LIB_DIR} Added: trunk/complement/explore/app/exam/Makefile.inc =================================================================== --- trunk/complement/explore/app/exam/Makefile.inc (rev 0) +++ trunk/complement/explore/app/exam/Makefile.inc 2007-07-06 06:29:26 UTC (rev 1600) @@ -0,0 +1,4 @@ +# -*- makefile -*- Time-stamp: <02/07/14 14:03:13 ptr> + +PRGNAME = zero +SRC_CC = zero.cc suite.cc Added: trunk/complement/explore/app/exam/suite.cc =================================================================== --- trunk/complement/explore/app/exam/suite.cc (rev 0) +++ trunk/complement/explore/app/exam/suite.cc 2007-07-06 06:29:26 UTC (rev 1600) @@ -0,0 +1,79 @@ +// -*- C++ -*- Time-stamp: <07/07/06 09:55:44 ptr> + +#include "suite.h" +#include <boost/graph/breadth_first_search.hpp> +#include <stack> + +namespace exam { + +using namespace std; +using namespace boost; + + +template <class VertexList, class Tag> +struct vertex_recorder : + public base_visitor<vertex_recorder<VertexList,Tag> > +{ + typedef Tag event_filter; + + vertex_recorder(VertexList& pa) : + m_vertex(pa) + { } + + template <class Vertex, class Graph> + void operator()(Vertex v, const Graph& g) + { m_vertex.push_back( v ); } + + VertexList& m_vertex; +}; + +template <class VertexList, class Tag> +vertex_recorder<VertexList, Tag> record_vertexes(VertexList& pa, Tag) +{ return vertex_recorder<VertexList, Tag>(pa); } + +test_suite::test_suite() : + root( add_vertex( white_color, g ) ) +{ + color = get( vertex_color, g ); + testcase = get( vertex_testcase, g ); + _test[root] = 0; +} + +void test_suite::girdle( int start ) +{ + stack<vertex_t> buffer; + list<vertex_t> v; + breadth_first_visit( g, root, buffer, + make_bfs_visitor(record_vertexes(v,on_discover_vertex())), + color ); + + v.pop_front(); // remove root, it empty + + for ( list<vertex_t>::const_iterator i = v.begin(); i != v.end(); ++i ) { + try { + (*_test[*i])(); + } + catch ( ... ) { + } + } +} + +test_suite::test_case_type test_suite::add( test_suite::func_type f ) +{ + vertex_t v = add_vertex( white_color, g); + add_edge( root, v, g ); + _test[v] = detail::make_test_case( detail::call( f ) ); + + return v; +} + +test_suite::test_case_type test_suite::add( test_suite::func_type f, test_suite::test_case_type depends ) +{ + vertex_t v = add_vertex( white_color, g); + add_edge( depends, v, g ); + _test[v] = detail::make_test_case( detail::call( f ) ); + + return v; +} + +} // namespace exam Added: trunk/complement/explore/app/exam/suite.h =================================================================== --- trunk/complement/explore/app/exam/suite.h (rev 0) +++ trunk/complement/explore/app/exam/suite.h 2007-07-06 06:29:26 UTC (rev 1600) @@ -0,0 +1,154 @@ +// -*- C++ -*- Time-stamp: <07/07/06 09:58:06 ptr> + +#ifndef __suite_h +#define __suite_h + +#include <iostream> +#include <sstream> +#include <map> +#include <boost/graph/adjacency_list.hpp> + +enum vertex_testcase_t { vertex_testcase }; + +namespace boost { + BOOST_INSTALL_PROPERTY( vertex, testcase ); +} // namespace boost + +namespace exam { + +namespace detail { + +/* +struct invoker +{ + template <typename F> + void invoke( F& f ) + { f(); } +}; +*/ + +struct call_impl +{ + virtual ~call_impl() + { } + virtual void invoke() = 0; +}; + +template <typename F> +class call_impl_t : + public call_impl +{ + public: + explicit call_impl_t( F f ) : + _f( f ) + { } + + virtual void invoke() + { /* invoker().invoke( _f ); */ _f(); } + + private: + F _f; +}; + +class call +{ + public: + call() + { } + + template <class F> + call( F f ) : + _f( new call_impl_t<F>(f) ) + { } + + void operator()() + { _f->invoke(); } + + private: + call_impl *_f; +}; + +template <class TC> +class method_invoker +{ + public: + typedef void (TC::*mf_type)(); + method_invoker( TC& instance, mf_type f ) : + _inst(instance), + _func(f) + { } + + void operator()() + { _inst.*_func(); } + + private: + TC& _inst; + mf_type _func; +}; + +class test_case +{ + public: + test_case( const call& f ) : + _tc( f ) + { } + + void operator ()() + { _tc(); } + + private: + call _tc; +}; + +inline test_case *make_test_case( const call& f ) +{ + return new test_case( f ); +} + +template <class TC> +inline test_case *make_test_case( void (TC::*f)(), TC& instance ) +{ + return new test_case( method_invoker<TC>(instance, f) ); +} + +} // namespace detail + +class test_suite +{ + private: + typedef boost::property<vertex_testcase_t,int> TestCaseProperty; + typedef boost::property<boost::vertex_color_t, boost::default_color_type, TestCaseProperty> VColorProperty; + + typedef boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, VColorProperty > graph_t; + typedef boost::graph_traits<graph_t>::vertex_iterator vertex_iterator_t; + + typedef boost::graph_traits<graph_t>::vertex_descriptor vertex_t; + typedef boost::property_map<graph_t,boost::vertex_color_t>::type vertex_color_map_t; + typedef boost::property_map<graph_t,vertex_testcase_t>::type vertex_testcase_map_t; + + public: + typedef void (*func_type)(); + typedef vertex_t test_case_type; + + test_suite(); + + test_case_type add( func_type ); + test_case_type add( func_type, test_case_type ); + + void girdle( int start ); + + private: + graph_t g; + vertex_t root; + vertex_color_map_t color; + vertex_testcase_map_t testcase; + + std::map<vertex_t,detail::test_case *> _test; +}; + +typedef test_suite::test_case_type test_case_type; + +} // namespace exam + +#endif // __suite_h + Added: trunk/complement/explore/app/exam/zero.cc =================================================================== --- trunk/complement/explore/app/exam/zero.cc (rev 0) +++ trunk/complement/explore/app/exam/zero.cc 2007-07-06 06:29:26 UTC (rev 1600) @@ -0,0 +1,69 @@ +#define FIT_EXAM + +#ifdef FIT_EXAM +# define EXAM_CHECK(C) if ( !(C) ) { exam::report( __FILE__, __LINE__, false, #C ); } else if ( exam::base::is_trace() ) { exam::report( __FILE__, __LINE__, true, #C ); } +# define EXAM_MESSAGE(M) +#else +# define EXAM_CHECK(C) +# define EXAM_MESSAGE(M) +#endif + + +#include <cstdio> +#include <iostream> + +#include "suite.h" + +namespace exam { + +class base +{ + public: + enum { + trace = 1 + }; + + static int flags(); + static bool is_trace(); + + private: + + static int _flags; +}; + +void _report0( const char *file, int line, bool cnd, const char *expr ) +{ + std::cerr << file << ":" << line << ": " << (cnd ? "pass" : "fail" ) << " \"" << expr << "\"" + << std::endl; +} + +void _report1( const char *file, int line, bool cnd, const char *expr ) +{ + printf( "%s:%d: %s \"%s\"\n", file, line, (cnd ? "pass" : "fail"), expr ); +} + +void _report2( const char *file, int line, bool cnd, const char *expr ) +{ + fprintf( stderr, "%s:%d: %s \"%s\"\n", file, line, (cnd ? "pass" : "fail"), expr ); +} + +void (*report)( const char *, int, bool, const char * ) = _report0; + +} // namespec exam + +void func() +{ + EXAM_CHECK(false); +} + +int main( int argc, char **argv ) +{ + exam::test_suite t; + + t.add( func ); + + t.girdle( 0 ); + + return 0; +} + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2007-07-04 10:47:47
|
Revision: 1599 http://svn.sourceforge.net/complement/?rev=1599&view=rev Author: complement Date: 2007-07-04 03:47:43 -0700 (Wed, 04 Jul 2007) Log Message: ----------- move Makefiles/top.mak to Makefiles/gmake/top.mak Modified Paths: -------------- trunk/complement/explore/Makefiles/ut/app-c/Makefile trunk/complement/explore/Makefiles/ut/app1/Makefile trunk/complement/explore/Makefiles/ut/app2/Makefile trunk/complement/explore/Makefiles/ut/app2-mult/Makefile trunk/complement/explore/Makefiles/ut/so1/Makefile trunk/complement/explore/app/utils/RTF/Makefile trunk/complement/explore/app/utils/edit/Makefile trunk/complement/explore/app/utils/time/Makefile trunk/complement/explore/inquiry/AuTTL/Makefile trunk/complement/explore/inquiry/AuTerm-order/Makefile trunk/complement/explore/inquiry/CU_mini/sample_test/Makefile trunk/complement/explore/inquiry/DB/SleepyCat/BDB-4.2/Makefile trunk/complement/explore/inquiry/STLport/address/Makefile trunk/complement/explore/inquiry/STLport/boost-sample/Makefile trunk/complement/explore/inquiry/STLport/gcc-mem-die/Makefile trunk/complement/explore/inquiry/STLport/locale_impl/Makefile trunk/complement/explore/inquiry/STLport/locale_leaks/Makefile trunk/complement/explore/inquiry/STLport/locale_money/Makefile trunk/complement/explore/inquiry/STLport/mem_destr/Makefile trunk/complement/explore/inquiry/STLport/mem_func/Makefile trunk/complement/explore/inquiry/STLport/mem_grow/Makefile trunk/complement/explore/inquiry/STLport/min/Makefile trunk/complement/explore/inquiry/STLport/multimap/Makefile trunk/complement/explore/inquiry/STLport/sort/Makefile trunk/complement/explore/inquiry/STLport/static/Makefile trunk/complement/explore/inquiry/STLport/str_leak/Makefile trunk/complement/explore/inquiry/STLport/string-reloc/Makefile trunk/complement/explore/inquiry/STLport/string-static-array/Makefile trunk/complement/explore/inquiry/STLport/tellg/Makefile trunk/complement/explore/inquiry/STLport/time/Makefile trunk/complement/explore/inquiry/STLport/tmp_iter/Makefile trunk/complement/explore/inquiry/STLport/transform/Makefile trunk/complement/explore/inquiry/StTerm-order/Makefile trunk/complement/explore/inquiry/VC/vtable-bug/Makefile trunk/complement/explore/inquiry/boost/filesystem/dirit/Makefile trunk/complement/explore/inquiry/boost/graph/path/Makefile trunk/complement/explore/inquiry/boost/graph/walk/Makefile trunk/complement/explore/inquiry/boost/program_options/Makefile trunk/complement/explore/inquiry/boost/regex/Makefile trunk/complement/explore/inquiry/boost/test/minimal/Makefile trunk/complement/explore/inquiry/boost/thread/Makefile trunk/complement/explore/inquiry/boost/tokenizer/Makefile trunk/complement/explore/inquiry/compile/vtable/Makefile trunk/complement/explore/inquiry/exception/Makefile trunk/complement/explore/inquiry/find/Makefile trunk/complement/explore/inquiry/getaddrinfo/Makefile trunk/complement/explore/inquiry/glibc_version/Makefile trunk/complement/explore/inquiry/ifc/Makefile trunk/complement/explore/inquiry/init_order/Makefile trunk/complement/explore/inquiry/makes/static-lib/Makefile trunk/complement/explore/inquiry/python/socket/srv/Makefile trunk/complement/explore/inquiry/resolv/resolver/Makefile trunk/complement/explore/inquiry/resolv/resolver/unit/Makefile trunk/complement/explore/inquiry/shades/PTHREADS/Makefile trunk/complement/explore/inquiry/shades/SMP/Makefile trunk/complement/explore/inquiry/shades/StEM2Perl/mp/Makefile trunk/complement/explore/inquiry/shades/StEM2Perl/stemdtch/Makefile trunk/complement/explore/inquiry/shades/StEM2Perl/stemecho/Makefile trunk/complement/explore/inquiry/shades/abort-core/Makefile trunk/complement/explore/inquiry/shades/dump_term/Makefile trunk/complement/explore/inquiry/shades/fcvt/Makefile trunk/complement/explore/inquiry/shades/file-lock/Makefile trunk/complement/explore/inquiry/shades/file-lock/islock/Makefile trunk/complement/explore/inquiry/shades/file-lock/libflck/Makefile trunk/complement/explore/inquiry/shades/file-lock/libflck/ut/Makefile trunk/complement/explore/inquiry/shades/float/Makefile trunk/complement/explore/inquiry/shades/juniper/Makefile trunk/complement/explore/inquiry/shades/ldpreload/Makefile trunk/complement/explore/inquiry/shades/maxthreads/Makefile trunk/complement/explore/inquiry/shades/mkstemp/Makefile trunk/complement/explore/inquiry/shades/msgq/Makefile trunk/complement/explore/inquiry/shades/net-interfaces/Makefile trunk/complement/explore/inquiry/shades/pthread-specific/Makefile trunk/complement/explore/inquiry/shades/pthread-spinlock/Makefile trunk/complement/explore/inquiry/shades/select-close/Makefile trunk/complement/explore/inquiry/shades/sign/Makefile trunk/complement/explore/inquiry/shades/unlink/Makefile trunk/complement/explore/inquiry/shades/virt_inh/Makefile trunk/complement/explore/inquiry/shades/xchg/Makefile trunk/complement/explore/inquiry/template_spec/Makefile trunk/complement/explore/inquiry/ttei/Makefile trunk/complement/explore/lib/DB/Makefile trunk/complement/explore/lib/DB/MySQL/Makefile trunk/complement/explore/lib/DB/PgSQL/Makefile trunk/complement/explore/lib/misc/Makefile trunk/complement/explore/lib/mt/Makefile trunk/complement/explore/lib/sockios/Makefile trunk/complement/explore/lib/stem/Makefile trunk/complement/explore/lib/stem/_EventHandler.cc trunk/complement/explore/perf/STL/lib/default/Makefile trunk/complement/explore/perf/STL/lib/malloc/Makefile trunk/complement/explore/perf/STL/lib/misc/default/Makefile trunk/complement/explore/perf/STL/lib/misc/libstdc++/Makefile trunk/complement/explore/perf/STL/lib/misc/malloc/Makefile trunk/complement/explore/perf/STL/lib/misc/newalloc/Makefile trunk/complement/explore/perf/STL/lib/newalloc/Makefile trunk/complement/explore/perf/STL/lib/noshortstr/Makefile trunk/complement/explore/perf/STL/lib/noshortstr-ma/Makefile trunk/complement/explore/perf/STL/lib/texpr/Makefile trunk/complement/explore/perf/STL/lib/texpr-ma/Makefile trunk/complement/explore/perf/STL/stream/fstream-format/STLport-default/Makefile trunk/complement/explore/perf/STL/stream/fstream-format/STLport-malloc/Makefile trunk/complement/explore/perf/STL/stream/fstream-format/libstdc++/Makefile trunk/complement/explore/perf/STL/stream/fstream-format/stdio/Makefile trunk/complement/explore/perf/STL/stream/fstream-raw/STLport-default/Makefile trunk/complement/explore/perf/STL/stream/fstream-raw/STLport-malloc/Makefile trunk/complement/explore/perf/STL/stream/fstream-raw/libstdc++/Makefile trunk/complement/explore/perf/STL/stream/fstream-raw/stdio/Makefile trunk/complement/explore/perf/STL/stream/fstream-raw/unistd/Makefile trunk/complement/explore/perf/STL/stream/sstream-raw/STLport-default/Makefile trunk/complement/explore/perf/STL/stream/sstream-raw/STLport-malloc/Makefile trunk/complement/explore/perf/STL/stream/sstream-raw/libstdc++/Makefile trunk/complement/explore/perf/STL/stream/sstream-raw/stdio/Makefile trunk/complement/explore/perf/STL/string/add/STLport-default/Makefile trunk/complement/explore/perf/STL/string/add/STLport-malloc/Makefile trunk/complement/explore/perf/STL/string/add/STLport-newalloc/Makefile trunk/complement/explore/perf/STL/string/add/libstd++/Makefile trunk/complement/explore/perf/STL/string/add-proxy/STLport-add-str-proxy/Makefile trunk/complement/explore/perf/STL/string/add-proxy/STLport-add-str-proxy-malloc/Makefile trunk/complement/explore/perf/STL/string/add-proxy/STLport-default/Makefile trunk/complement/explore/perf/STL/string/add-proxy/STLport-malloc/Makefile trunk/complement/explore/perf/STL/string/add-proxy/libstdc++/Makefile trunk/complement/explore/perf/STL/string/add-ropes/STLport-default/Makefile trunk/complement/explore/perf/STL/string/add-ropes/STLport-malloc/Makefile trunk/complement/explore/perf/STL/string/add-ropes/STLport-newalloc/Makefile trunk/complement/explore/perf/STL/string/find/STLport-default/Makefile trunk/complement/explore/perf/STL/string/find/STLport-malloc/Makefile trunk/complement/explore/perf/STL/string/find/STLport-newalloc/Makefile trunk/complement/explore/perf/STL/string/find/libstd++/Makefile trunk/complement/explore/perf/STL/string/find-ropes/STLport-default/Makefile trunk/complement/explore/perf/STL/string/find-ropes/STLport-malloc/Makefile trunk/complement/explore/perf/STL/string/find-ropes/STLport-newalloc/Makefile trunk/complement/explore/perf/STL/string/ops/STLport-default/Makefile trunk/complement/explore/perf/STL/string/ops/STLport-malloc/Makefile trunk/complement/explore/perf/STL/string/ops/STLport-newalloc/Makefile trunk/complement/explore/perf/STL/string/ops/libstd++/Makefile trunk/complement/explore/perf/STL/string/ops-ropes/STLport-default/Makefile trunk/complement/explore/perf/STL/string/ops-ropes/STLport-malloc/Makefile trunk/complement/explore/perf/STL/string/ops-ropes/STLport-newalloc/Makefile trunk/complement/explore/perf/STL/string/params/STLport-default/Makefile trunk/complement/explore/perf/STL/string/params/STLport-malloc/Makefile trunk/complement/explore/perf/STL/string/params/STLport-newalloc/Makefile trunk/complement/explore/perf/STL/string/params/libstd++/Makefile trunk/complement/explore/perf/STL/string/params-ref/STLport-default/Makefile trunk/complement/explore/perf/STL/string/params-ref/STLport-malloc/Makefile trunk/complement/explore/perf/STL/string/params-ref/STLport-newalloc/Makefile trunk/complement/explore/perf/STL/string/params-ref/libstd++/Makefile trunk/complement/explore/perf/STL/string/params-ref-ropes/STLport-default/Makefile trunk/complement/explore/perf/STL/string/params-ref-ropes/STLport-malloc/Makefile trunk/complement/explore/perf/STL/string/params-ref-ropes/STLport-newalloc/Makefile trunk/complement/explore/perf/STL/string/params-ropes/STLport-default/Makefile trunk/complement/explore/perf/STL/string/params-ropes/STLport-malloc/Makefile trunk/complement/explore/perf/STL/string/params-short/STLport-default/Makefile trunk/complement/explore/perf/STL/string/params-short/STLport-malloc/Makefile trunk/complement/explore/perf/STL/string/params-short/STLport-no-short-str/Makefile trunk/complement/explore/perf/STL/string/params-short/STLport-no-short-str-malloc/Makefile trunk/complement/explore/perf/STL/string/params-short/libstd++/Makefile trunk/complement/explore/perf/STL/string/ropes/STLport-default/Makefile trunk/complement/explore/perf/STL/string/ropes/STLport-malloc/Makefile trunk/complement/explore/perf/STL/string/ropes/STLport-newalloc/Makefile trunk/complement/explore/perf/STL/string/ropes/libstdc++/Makefile trunk/complement/explore/perf/STL/string-MT/add/STLport-default/Makefile trunk/complement/explore/perf/STL/string-MT/add/STLport-malloc/Makefile trunk/complement/explore/perf/STL/string-MT/add/libstd++/Makefile trunk/complement/explore/perf/STL/string-MT/add-proxy/STLport-add-str-proxy/Makefile trunk/complement/explore/perf/STL/string-MT/add-proxy/STLport-add-str-proxy-malloc/Makefile trunk/complement/explore/perf/STL/string-MT/add-proxy/STLport-default/Makefile trunk/complement/explore/perf/STL/string-MT/add-proxy/STLport-malloc/Makefile trunk/complement/explore/perf/STL/string-MT/add-proxy/libstdc++/Makefile trunk/complement/explore/perf/STL/string-MT/add-ropes/STLport-default/Makefile trunk/complement/explore/perf/STL/string-MT/add-ropes/STLport-malloc/Makefile trunk/complement/explore/perf/STL/string-MT/find/STLport-default/Makefile trunk/complement/explore/perf/STL/string-MT/find/STLport-malloc/Makefile trunk/complement/explore/perf/STL/string-MT/find/libstd++/Makefile trunk/complement/explore/perf/STL/string-MT/find-ropes/STLport-default/Makefile trunk/complement/explore/perf/STL/string-MT/find-ropes/STLport-malloc/Makefile trunk/complement/explore/perf/STL/string-MT/ops/STLport-default/Makefile trunk/complement/explore/perf/STL/string-MT/ops/STLport-malloc/Makefile trunk/complement/explore/perf/STL/string-MT/ops/libstd++/Makefile trunk/complement/explore/perf/STL/string-MT/ops-ropes/STLport-default/Makefile trunk/complement/explore/perf/STL/string-MT/ops-ropes/STLport-malloc/Makefile trunk/complement/explore/perf/STL/string-MT/params/STLport-default/Makefile trunk/complement/explore/perf/STL/string-MT/params/STLport-malloc/Makefile trunk/complement/explore/perf/STL/string-MT/params/libstd++/Makefile trunk/complement/explore/perf/STL/string-MT/params-ref/STLport-default/Makefile trunk/complement/explore/perf/STL/string-MT/params-ref/STLport-malloc/Makefile trunk/complement/explore/perf/STL/string-MT/params-ref/libstd++/Makefile trunk/complement/explore/perf/STL/string-MT/params-ref-ropes/STLport-default/Makefile trunk/complement/explore/perf/STL/string-MT/params-ref-ropes/STLport-malloc/Makefile trunk/complement/explore/perf/STL/string-MT/params-ropes/STLport-default/Makefile trunk/complement/explore/perf/STL/string-MT/params-ropes/STLport-malloc/Makefile trunk/complement/explore/perf/STL/string-MT/params-short/STLport-default/Makefile trunk/complement/explore/perf/STL/string-MT/params-short/STLport-malloc/Makefile trunk/complement/explore/perf/STL/string-MT/params-short/STLport-no-short-str/Makefile trunk/complement/explore/perf/STL/string-MT/params-short/STLport-no-short-str-malloc/Makefile trunk/complement/explore/perf/STL/string-MT/params-short/libstd++/Makefile trunk/complement/explore/perf/sockios/Client-03/Makefile trunk/complement/explore/perf/stem/rlimit/Makefile trunk/complement/explore/perf/stem/stemecho/Makefile trunk/complement/explore/perf/stem/stemload/Makefile trunk/complement/explore/test/libDB/MySQL/unit/Makefile trunk/complement/explore/test/libDB/PostgreSQL/unit/Makefile trunk/complement/explore/test/libmt/calendar_time/Makefile trunk/complement/explore/test/libmt/sem-dlopen/dl/Makefile trunk/complement/explore/test/libmt/sem-dlopen/main/Makefile trunk/complement/explore/test/libmt/sem_timedwait/Makefile trunk/complement/explore/test/libmt/unfinished/Makefile trunk/complement/explore/test/mt/Makefile trunk/complement/explore/test/sockios/Makefile trunk/complement/explore/test/stem/Makefile trunk/complement/explore/test/stem/dl/Makefile trunk/complement/explore/test/virtual_time/Makefile trunk/complement/explore/test/virtual_time/test/Makefile trunk/complement/extern/custom/boost/libs/date_time/Makefile trunk/complement/extern/custom/boost/libs/filesystem/Makefile trunk/complement/extern/custom/boost/libs/filesystem/test/Makefile trunk/complement/extern/custom/boost/libs/program_options/Makefile trunk/complement/extern/custom/boost/libs/program_options/test/Makefile trunk/complement/extern/custom/boost/libs/python/Makefile trunk/complement/extern/custom/boost/libs/regex/Makefile trunk/complement/extern/custom/boost/libs/regex/test/Makefile trunk/complement/extern/custom/boost/libs/serialization/Makefile trunk/complement/extern/custom/boost/libs/test/prg_exec_mon/Makefile trunk/complement/extern/custom/boost/libs/test/prg_exec_mon/test/Makefile trunk/complement/extern/custom/boost/libs/test/test_exec_mon/Makefile trunk/complement/extern/custom/boost/libs/test/test_exec_mon/test/Makefile trunk/complement/extern/custom/boost/libs/test/unit_test_framework/Makefile trunk/complement/extern/custom/boost/libs/test/unit_test_framework/test/Makefile trunk/complement/extern/custom/boost/libs/thread/Makefile Added Paths: ----------- trunk/complement/explore/Makefiles/gmake/top.mak Removed Paths: ------------- trunk/complement/explore/Makefiles/top.mak Copied: trunk/complement/explore/Makefiles/gmake/top.mak (from rev 1585, trunk/complement/explore/Makefiles/top.mak) =================================================================== --- trunk/complement/explore/Makefiles/gmake/top.mak (rev 0) +++ trunk/complement/explore/Makefiles/gmake/top.mak 2007-07-04 10:47:43 UTC (rev 1599) @@ -0,0 +1,117 @@ +# Time-stamp: <07/06/08 23:23:03 ptr> +# +# Copyright (c) 1997-1999, 2002, 2003, 2005-2007 +# Petr Ovtchenkov +# +# Portion Copyright (c) 1999-2001 +# Parallel Graphics Ltd. +# +# Licensed under the Academic Free License version 3.0 +# + +.SUFFIXES: +.SCCS_GET: +.RCS_GET: + +PHONY ?= + +RULESBASE ?= $(SRCROOT)/Makefiles + +# include file, generated by configure, if available +-include ${RULESBASE}/gmake/config.mak + +ifndef COMPILER_NAME +# gcc is default compiler, others specify explicitly; +COMPILER_NAME := gcc +endif + +ifndef ALL_TAGS + +ifndef _NO_SHARED_BUILD +ALL_TAGS := release-shared +else +ALL_TAGS := +endif + +ifdef _STATIC_BUILD +ALL_TAGS += release-static +endif + +ifndef _NO_DBG_BUILD +ifndef _NO_SHARED_BUILD +ALL_TAGS += dbg-shared +endif +ifdef _STATIC_BUILD +ALL_TAGS += dbg-static +endif +endif + +ifndef _NO_STLDBG_BUILD +ifndef WITHOUT_STLPORT +ifndef _NO_SHARED_BUILD +ALL_TAGS += stldbg-shared +endif +ifdef _STATIC_BUILD +ALL_TAGS += stldbg-static +endif +endif +endif + +endif + +all: $(OUTPUT_DIRS) $(ALL_TAGS) + +ifndef WITHOUT_STLPORT +all-static: release-static dbg-static stldbg-static +all-shared: release-shared dbg-shared stldbg-shared +else +all-static: release-static dbg-static +all-shared: release-shared dbg-shared +endif + +ifdef WITHOUT_STLPORT +NOT_USE_NOSTDLIB := 1 +endif + +ifndef OSNAME +# identify OS and build date +include ${RULESBASE}/gmake/sysid.mak +endif +# OS-specific definitions, like ln, install, etc. (guest host) +include ${RULESBASE}/gmake/$(BUILD_OSNAME)/sys.mak +# target OS-specific definitions, like ar, etc. +include ${RULESBASE}/gmake/$(OSNAME)/targetsys.mak +# compiler, compiler options +include ${RULESBASE}/gmake/$(COMPILER_NAME).mak +# rules to make dirs for targets +include ${RULESBASE}/gmake/targetdirs.mak +# Extern projects for everyday usage and settings for ones +include ${RULESBASE}/gmake/extern.mak + +# os-specific local rules (or other project-specific definitions) +-include specific.mak + +# derive common targets (*.o, *.d), +# build rules (including output catalogs) +include ${RULESBASE}/gmake/targets.mak +# dependency +include ${RULESBASE}/gmake/depend.mak + +# general clean +include ${RULESBASE}/gmake/clean.mak + +# if target is library, rules for library +ifdef LIBNAME +include ${RULESBASE}/gmake/lib/top.mak +endif + +# if target is program, rules for executable +ifdef PRGNAME +include ${RULESBASE}/gmake/app/top.mak +else +ifdef PRGNAMES +include ${RULESBASE}/gmake/app/top.mak +endif +endif + +.PHONY: $(PHONY) Deleted: trunk/complement/explore/Makefiles/top.mak =================================================================== --- trunk/complement/explore/Makefiles/top.mak 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/Makefiles/top.mak 2007-07-04 10:47:43 UTC (rev 1599) @@ -1,117 +0,0 @@ -# Time-stamp: <07/06/08 23:23:03 ptr> -# -# Copyright (c) 1997-1999, 2002, 2003, 2005, 2006 -# Petr Ovtchenkov -# -# Portion Copyright (c) 1999-2001 -# Parallel Graphics Ltd. -# -# Licensed under the Academic Free License version 3.0 -# - -.SUFFIXES: -.SCCS_GET: -.RCS_GET: - -PHONY ?= - -RULESBASE ?= $(SRCROOT)/Makefiles - -# include file, generated by configure, if available --include ${RULESBASE}/gmake/config.mak - -ifndef COMPILER_NAME -# gcc is default compiler, others specify explicitly; -COMPILER_NAME := gcc -endif - -ifndef ALL_TAGS - -ifndef _NO_SHARED_BUILD -ALL_TAGS := release-shared -else -ALL_TAGS := -endif - -ifdef _STATIC_BUILD -ALL_TAGS += release-static -endif - -ifndef _NO_DBG_BUILD -ifndef _NO_SHARED_BUILD -ALL_TAGS += dbg-shared -endif -ifdef _STATIC_BUILD -ALL_TAGS += dbg-static -endif -endif - -ifndef _NO_STLDBG_BUILD -ifndef WITHOUT_STLPORT -ifndef _NO_SHARED_BUILD -ALL_TAGS += stldbg-shared -endif -ifdef _STATIC_BUILD -ALL_TAGS += stldbg-static -endif -endif -endif - -endif - -all: $(OUTPUT_DIRS) $(ALL_TAGS) - -ifndef WITHOUT_STLPORT -all-static: release-static dbg-static stldbg-static -all-shared: release-shared dbg-shared stldbg-shared -else -all-static: release-static dbg-static -all-shared: release-shared dbg-shared -endif - -ifdef WITHOUT_STLPORT -NOT_USE_NOSTDLIB := 1 -endif - -ifndef OSNAME -# identify OS and build date -include ${RULESBASE}/gmake/sysid.mak -endif -# OS-specific definitions, like ln, install, etc. (guest host) -include ${RULESBASE}/gmake/$(BUILD_OSNAME)/sys.mak -# target OS-specific definitions, like ar, etc. -include ${RULESBASE}/gmake/$(OSNAME)/targetsys.mak -# compiler, compiler options -include ${RULESBASE}/gmake/$(COMPILER_NAME).mak -# rules to make dirs for targets -include ${RULESBASE}/gmake/targetdirs.mak -# Extern projects for everyday usage and settings for ones -include ${RULESBASE}/gmake/extern.mak - -# os-specific local rules (or other project-specific definitions) --include specific.mak - -# derive common targets (*.o, *.d), -# build rules (including output catalogs) -include ${RULESBASE}/gmake/targets.mak -# dependency -include ${RULESBASE}/gmake/depend.mak - -# general clean -include ${RULESBASE}/gmake/clean.mak - -# if target is library, rules for library -ifdef LIBNAME -include ${RULESBASE}/gmake/lib/top.mak -endif - -# if target is program, rules for executable -ifdef PRGNAME -include ${RULESBASE}/gmake/app/top.mak -else -ifdef PRGNAMES -include ${RULESBASE}/gmake/app/top.mak -endif -endif - -.PHONY: $(PHONY) Modified: trunk/complement/explore/Makefiles/ut/app-c/Makefile =================================================================== --- trunk/complement/explore/Makefiles/ut/app-c/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/Makefiles/ut/app-c/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -7,7 +7,7 @@ EXTRA_POST_STLDBG := checks-stldbg include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak ifndef WITHOUT_STLPORT LDFLAGS += -Wl,-rpath=${STLPORT_LIB_DIR} Modified: trunk/complement/explore/Makefiles/ut/app1/Makefile =================================================================== --- trunk/complement/explore/Makefiles/ut/app1/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/Makefiles/ut/app1/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -7,7 +7,7 @@ EXTRA_POST_STLDBG := checks-stldbg include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak ifndef WITHOUT_STLPORT LDFLAGS += -Wl,-rpath=${STLPORT_LIB_DIR} Modified: trunk/complement/explore/Makefiles/ut/app2/Makefile =================================================================== --- trunk/complement/explore/Makefiles/ut/app2/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/Makefiles/ut/app2/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -7,7 +7,7 @@ EXTRA_POST_STLDBG := checks-stldbg include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak ifndef WITHOUT_STLPORT LDFLAGS += -Wl,-rpath=${STLPORT_LIB_DIR} Modified: trunk/complement/explore/Makefiles/ut/app2-mult/Makefile =================================================================== --- trunk/complement/explore/Makefiles/ut/app2-mult/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/Makefiles/ut/app2-mult/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -7,7 +7,7 @@ # EXTRA_POST_STLDBG := check-stldbg-shared include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak ifndef WITHOUT_STLPORT LDFLAGS += -Wl,-rpath=${STLPORT_LIB_DIR} Modified: trunk/complement/explore/Makefiles/ut/so1/Makefile =================================================================== --- trunk/complement/explore/Makefiles/ut/so1/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/Makefiles/ut/so1/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -4,7 +4,7 @@ EXTRA_POST := checks include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak INCLUDES += -I./include Modified: trunk/complement/explore/app/utils/RTF/Makefile =================================================================== --- trunk/complement/explore/app/utils/RTF/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/app/utils/RTF/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -2,7 +2,7 @@ SRCROOT := ../../../ include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak LDLIBS += -lrt -lnsl -lfl Modified: trunk/complement/explore/app/utils/edit/Makefile =================================================================== --- trunk/complement/explore/app/utils/edit/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/app/utils/edit/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -5,7 +5,7 @@ COMPILER_NAME := gcc include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak INCLUDES += -I$(SRCROOT)/include -I$(STLPORT_INCLUDE_DIR) -I$(BOOST_INCLUDE_DIR) Modified: trunk/complement/explore/app/utils/time/Makefile =================================================================== --- trunk/complement/explore/app/utils/time/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/app/utils/time/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -4,7 +4,7 @@ COMPILER_NAME := gcc include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak INCLUDES += DEFS += Modified: trunk/complement/explore/inquiry/AuTTL/Makefile =================================================================== --- trunk/complement/explore/inquiry/AuTTL/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/AuTTL/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -4,7 +4,7 @@ COMPILER_NAME := gcc include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak #CXXFLAGS += -fuse-cxa-atexit # LDFLAGS += -Wl,-rpath=${STLPORT_LIB_DIR} Modified: trunk/complement/explore/inquiry/AuTerm-order/Makefile =================================================================== --- trunk/complement/explore/inquiry/AuTerm-order/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/AuTerm-order/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -4,7 +4,7 @@ COMPILER_NAME := gcc include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak #CXXFLAGS += -fuse-cxa-atexit # LDFLAGS += -Wl,-rpath=${STLPORT_LIB_DIR} Modified: trunk/complement/explore/inquiry/CU_mini/sample_test/Makefile =================================================================== --- trunk/complement/explore/inquiry/CU_mini/sample_test/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/CU_mini/sample_test/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -5,7 +5,7 @@ COMPILER_NAME := gcc include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak INCLUDES += -I../cppunit -I$(SRCROOT)/include -I$(STLPORT_INCLUDE_DIR) -I$(BOOST_INCLUDE_DIR) Modified: trunk/complement/explore/inquiry/DB/SleepyCat/BDB-4.2/Makefile =================================================================== --- trunk/complement/explore/inquiry/DB/SleepyCat/BDB-4.2/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/DB/SleepyCat/BDB-4.2/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -6,7 +6,7 @@ BDB_DIR := /opt/BDB-4.2 include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak INCLUDES += -I$(SRCROOT)/include -I$(STLPORT_INCLUDE_DIR) -I$(BOOST_INCLUDE_DIR) -I${BDB_DIR}/include Modified: trunk/complement/explore/inquiry/STLport/address/Makefile =================================================================== --- trunk/complement/explore/inquiry/STLport/address/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/STLport/address/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -4,7 +4,7 @@ COMPILER_NAME := gcc include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak LDFLAGS += -Wl,-rpath=$(STLPORT_LIB_DIR) Modified: trunk/complement/explore/inquiry/STLport/boost-sample/Makefile =================================================================== --- trunk/complement/explore/inquiry/STLport/boost-sample/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/STLport/boost-sample/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -4,7 +4,7 @@ COMPILER_NAME := gcc include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak INCLUDES += -I$(SRCROOT)/include -I$(BOOST_INCLUDE_DIR) Modified: trunk/complement/explore/inquiry/STLport/gcc-mem-die/Makefile =================================================================== --- trunk/complement/explore/inquiry/STLport/gcc-mem-die/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/STLport/gcc-mem-die/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -7,7 +7,7 @@ #STLPORT_DIR := /export/home/ptr/STLport.lab/cvs.stlport.com/STLport-R451_dev STLPORT_DIR := /export/home/ptr/STLport.lab/STLport include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak INCLUDES += -I$(SRCROOT)/include -I$(STLPORT_INCLUDE_DIR) Modified: trunk/complement/explore/inquiry/STLport/locale_impl/Makefile =================================================================== --- trunk/complement/explore/inquiry/STLport/locale_impl/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/STLport/locale_impl/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -6,7 +6,7 @@ STLPORT_DIR := /export/home/ptr/STLport.lab/cvs.stlport.com/STLport include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak DEFS += -D_STLP_LEAKS_PEDANTIC Modified: trunk/complement/explore/inquiry/STLport/locale_leaks/Makefile =================================================================== --- trunk/complement/explore/inquiry/STLport/locale_leaks/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/STLport/locale_leaks/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -7,7 +7,7 @@ #STLPORT_DIR := /export/home/ptr/STLport.lab/cvs.stlport.com/STLport-R451_dev STLPORT_DIR := /export/home/ptr/STLport.lab/STLport include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak INCLUDES += -I$(SRCROOT)/include -I$(STLPORT_INCLUDE_DIR) Modified: trunk/complement/explore/inquiry/STLport/locale_money/Makefile =================================================================== --- trunk/complement/explore/inquiry/STLport/locale_money/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/STLport/locale_money/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -7,7 +7,7 @@ #STLPORT_DIR := /export/home/ptr/STLport.lab/cvs.stlport.com/STLport include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak #DEFS += -D_STLP_LEAKS_PEDANTIC Modified: trunk/complement/explore/inquiry/STLport/mem_destr/Makefile =================================================================== --- trunk/complement/explore/inquiry/STLport/mem_destr/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/STLport/mem_destr/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -7,7 +7,7 @@ #STLPORT_DIR := /export/home/ptr/STLport.lab/cvs.stlport.com/STLport-R451_dev STLPORT_DIR := /export/home/ptr/STLport.lab/STLport include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak INCLUDES += -I$(SRCROOT)/include -I$(STLPORT_INCLUDE_DIR) Modified: trunk/complement/explore/inquiry/STLport/mem_func/Makefile =================================================================== --- trunk/complement/explore/inquiry/STLport/mem_func/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/STLport/mem_func/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -4,7 +4,7 @@ COMPILER_NAME := gcc include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak LDFLAGS += -Wl,-rpath=$(STLPORT_LIB_DIR) Modified: trunk/complement/explore/inquiry/STLport/mem_grow/Makefile =================================================================== --- trunk/complement/explore/inquiry/STLport/mem_grow/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/STLport/mem_grow/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -6,7 +6,7 @@ # STLPORT_DIR := /export/home/ptr/STLport.lab/STLport include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak INCLUDES += -I$(SRCROOT)/include Modified: trunk/complement/explore/inquiry/STLport/min/Makefile =================================================================== --- trunk/complement/explore/inquiry/STLport/min/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/STLport/min/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -5,5 +5,5 @@ COMPILER_NAME := gcc include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak Modified: trunk/complement/explore/inquiry/STLport/multimap/Makefile =================================================================== --- trunk/complement/explore/inquiry/STLport/multimap/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/STLport/multimap/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -5,7 +5,7 @@ STLPORT_DIR := /export/home/ptr/STLport.lab/STLport.5_0 include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak LDFLAGS += -Wl,-rpath=$(STLPORT_LIB_DIR) Modified: trunk/complement/explore/inquiry/STLport/sort/Makefile =================================================================== --- trunk/complement/explore/inquiry/STLport/sort/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/STLport/sort/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -7,7 +7,7 @@ #STLPORT_DIR := /export/home/ptr/STLport.lab/cvs.stlport.com/STLport-R451_dev STLPORT_DIR := /export/home/ptr/STLport.lab/STLport include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak INCLUDES += -I$(SRCROOT)/include -I$(STLPORT_INCLUDE_DIR) Modified: trunk/complement/explore/inquiry/STLport/static/Makefile =================================================================== --- trunk/complement/explore/inquiry/STLport/static/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/STLport/static/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -5,4 +5,4 @@ #STLPORT_DIR := /export/home/ptr/STLport.lab/STLport-Makefiles include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak Modified: trunk/complement/explore/inquiry/STLport/str_leak/Makefile =================================================================== --- trunk/complement/explore/inquiry/STLport/str_leak/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/STLport/str_leak/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -5,7 +5,7 @@ COMPILER_NAME := gcc include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak INCLUDES += -I$(SRCROOT)/include -I$(STLPORT_INCLUDE_DIR) Modified: trunk/complement/explore/inquiry/STLport/string-reloc/Makefile =================================================================== --- trunk/complement/explore/inquiry/STLport/string-reloc/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/STLport/string-reloc/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -7,7 +7,7 @@ #STLPORT_DIR := /export/home/ptr/STLport.lab/cvs.stlport.com/STLport-R451_dev STLPORT_DIR := /export/home/ptr/STLport.lab/STLport include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak INCLUDES += -I$(SRCROOT)/include -I$(STLPORT_INCLUDE_DIR) Modified: trunk/complement/explore/inquiry/STLport/string-static-array/Makefile =================================================================== --- trunk/complement/explore/inquiry/STLport/string-static-array/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/STLport/string-static-array/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -5,6 +5,6 @@ STLPORT_DIR := /export/home/ptr/STLport.lab/STLport.HEAD include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak LDFLAGS += -Wl,-rpath=$(STLPORT_LIB_DIR) Modified: trunk/complement/explore/inquiry/STLport/tellg/Makefile =================================================================== --- trunk/complement/explore/inquiry/STLport/tellg/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/STLport/tellg/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -7,7 +7,7 @@ #STLPORT_DIR := /export/home/ptr/STLport.lab/cvs.stlport.com/STLport-R451_dev STLPORT_DIR := /export/home/ptr/STLport.lab/STLport include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak INCLUDES += -I$(SRCROOT)/include -I$(STLPORT_INCLUDE_DIR) Modified: trunk/complement/explore/inquiry/STLport/time/Makefile =================================================================== --- trunk/complement/explore/inquiry/STLport/time/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/STLport/time/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -6,7 +6,7 @@ STLPORT_DIR := /export/home/ptr/STLport.lab/cvs.stlport.com/STLport include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak DEFS += -D_STLP_LEAKS_PEDANTIC Modified: trunk/complement/explore/inquiry/STLport/tmp_iter/Makefile =================================================================== --- trunk/complement/explore/inquiry/STLport/tmp_iter/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/STLport/tmp_iter/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -4,7 +4,7 @@ COMPILER_NAME := gcc include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak LDFLAGS += -Wl,-rpath=$(STLPORT_LIB_DIR) Modified: trunk/complement/explore/inquiry/STLport/transform/Makefile =================================================================== --- trunk/complement/explore/inquiry/STLport/transform/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/STLport/transform/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -7,7 +7,7 @@ #STLPORT_DIR := /export/home/ptr/STLport.lab/cvs.stlport.com/STLport-R451_dev STLPORT_DIR := /export/home/ptr/STLport.lab/STLport include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak INCLUDES += -I$(SRCROOT)/include -I$(STLPORT_INCLUDE_DIR) Modified: trunk/complement/explore/inquiry/StTerm-order/Makefile =================================================================== --- trunk/complement/explore/inquiry/StTerm-order/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/StTerm-order/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -6,7 +6,7 @@ STLPORT_DIR := /export/home/ptr/STLport.lab/cvs.stlport.com/STLport include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak #CXXFLAGS += -fuse-cxa-atexit LDFLAGS += -Wl,-rpath=${STLPORT_LIB_DIR} Modified: trunk/complement/explore/inquiry/VC/vtable-bug/Makefile =================================================================== --- trunk/complement/explore/inquiry/VC/vtable-bug/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/VC/vtable-bug/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -5,7 +5,7 @@ COMPILER_NAME := gcc include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak INCLUDES += -I$(SRCROOT)/include -I$(STLPORT_INCLUDE_DIR) Modified: trunk/complement/explore/inquiry/boost/filesystem/dirit/Makefile =================================================================== --- trunk/complement/explore/inquiry/boost/filesystem/dirit/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/boost/filesystem/dirit/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -5,7 +5,7 @@ COMPILER_NAME := gcc include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak INCLUDES += -I$(SRCROOT)/include -I$(STLPORT_INCLUDE_DIR) -I$(BOOST_INCLUDE_DIR) Modified: trunk/complement/explore/inquiry/boost/graph/path/Makefile =================================================================== --- trunk/complement/explore/inquiry/boost/graph/path/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/boost/graph/path/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -4,7 +4,7 @@ COMPILER_NAME := gcc include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak INCLUDES += -I$(SRCROOT)/include -I$(BOOST_INCLUDE_DIR) Modified: trunk/complement/explore/inquiry/boost/graph/walk/Makefile =================================================================== --- trunk/complement/explore/inquiry/boost/graph/walk/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/boost/graph/walk/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -4,7 +4,7 @@ COMPILER_NAME := gcc include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak INCLUDES += -I$(SRCROOT)/include -I$(BOOST_INCLUDE_DIR) Modified: trunk/complement/explore/inquiry/boost/program_options/Makefile =================================================================== --- trunk/complement/explore/inquiry/boost/program_options/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/boost/program_options/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -4,7 +4,7 @@ COMPILER_NAME := gcc include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak INCLUDES += -I$(SRCROOT)/include -I$(BOOST_INCLUDE_DIR) Modified: trunk/complement/explore/inquiry/boost/regex/Makefile =================================================================== --- trunk/complement/explore/inquiry/boost/regex/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/boost/regex/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -5,7 +5,7 @@ COMPILER_NAME := gcc include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak INCLUDES += -I$(SRCROOT)/include -I$(STLPORT_INCLUDE_DIR) -I$(BOOST_INCLUDE_DIR) Modified: trunk/complement/explore/inquiry/boost/test/minimal/Makefile =================================================================== --- trunk/complement/explore/inquiry/boost/test/minimal/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/boost/test/minimal/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -5,7 +5,7 @@ COMPILER_NAME := gcc include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak INCLUDES += -I$(SRCROOT)/include -I$(STLPORT_INCLUDE_DIR) -I$(BOOST_INCLUDE_DIR) Modified: trunk/complement/explore/inquiry/boost/thread/Makefile =================================================================== --- trunk/complement/explore/inquiry/boost/thread/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/boost/thread/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -5,7 +5,7 @@ COMPILER_NAME := gcc include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak INCLUDES += -I$(SRCROOT)/include -I$(STLPORT_INCLUDE_DIR) -I$(BOOST_INCLUDE_DIR) Modified: trunk/complement/explore/inquiry/boost/tokenizer/Makefile =================================================================== --- trunk/complement/explore/inquiry/boost/tokenizer/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/boost/tokenizer/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -5,7 +5,7 @@ COMPILER_NAME := gcc include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak INCLUDES += -I$(SRCROOT)/include -I$(STLPORT_INCLUDE_DIR) -I$(BOOST_INCLUDE_DIR) Modified: trunk/complement/explore/inquiry/compile/vtable/Makefile =================================================================== --- trunk/complement/explore/inquiry/compile/vtable/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/compile/vtable/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -7,5 +7,5 @@ ALL_TAGS := release-shared dbg-shared include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak Modified: trunk/complement/explore/inquiry/exception/Makefile =================================================================== --- trunk/complement/explore/inquiry/exception/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/exception/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -5,7 +5,7 @@ COMPILER_NAME := gcc include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak INCLUDES += -I$(STLPORT_INCLUDE_DIR) Modified: trunk/complement/explore/inquiry/find/Makefile =================================================================== --- trunk/complement/explore/inquiry/find/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/find/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -6,7 +6,7 @@ STLPORT_DIR := /export/home/ptr/STLport.lab/cvs.stlport.com/STLport include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak #CXXFLAGS += -fuse-cxa-atexit LDFLAGS += -Wl,-rpath=${STLPORT_LIB_DIR} Modified: trunk/complement/explore/inquiry/getaddrinfo/Makefile =================================================================== --- trunk/complement/explore/inquiry/getaddrinfo/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/getaddrinfo/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -4,7 +4,7 @@ COMPILER_NAME := gcc include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak INCLUDES += -I.. -I$(BOOST_INCLUDE_DIR) Modified: trunk/complement/explore/inquiry/glibc_version/Makefile =================================================================== --- trunk/complement/explore/inquiry/glibc_version/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/glibc_version/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -5,5 +5,5 @@ COMPILER_NAME := gcc include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak Modified: trunk/complement/explore/inquiry/ifc/Makefile =================================================================== --- trunk/complement/explore/inquiry/ifc/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/ifc/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -4,7 +4,7 @@ COMPILER_NAME := gcc include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak release-shared: LDSEARCH = -L${STLPORT_LIB_DIR} -L${CoMT_LIB_DIR} stldbg-shared: LDSEARCH = -L${STLPORT_LIB_DIR} -L${CoMT_LIB_DIR_STLDBG} Modified: trunk/complement/explore/inquiry/init_order/Makefile =================================================================== --- trunk/complement/explore/inquiry/init_order/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/init_order/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -5,5 +5,5 @@ COMPILER_NAME := gcc include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak Modified: trunk/complement/explore/inquiry/makes/static-lib/Makefile =================================================================== --- trunk/complement/explore/inquiry/makes/static-lib/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/makes/static-lib/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -4,7 +4,7 @@ COMPILER_NAME := gcc include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak PHONY += qq # $(foreach ${LIBNAMES}) Modified: trunk/complement/explore/inquiry/python/socket/srv/Makefile =================================================================== --- trunk/complement/explore/inquiry/python/socket/srv/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/python/socket/srv/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -5,7 +5,7 @@ COMPILER_NAME := gcc include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak INCLUDES += -I$(SRCROOT)/include -I$(STLPORT_INCLUDE_DIR) -I$(BOOST_INCLUDE_DIR) Modified: trunk/complement/explore/inquiry/resolv/resolver/Makefile =================================================================== --- trunk/complement/explore/inquiry/resolv/resolver/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/resolv/resolver/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -5,6 +5,6 @@ COMPILER_NAME := gcc include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak INCLUDES += -I.. -I$(BOOST_INCLUDE_DIR) Modified: trunk/complement/explore/inquiry/resolv/resolver/unit/Makefile =================================================================== --- trunk/complement/explore/inquiry/resolv/resolver/unit/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/resolv/resolver/unit/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -5,7 +5,7 @@ COMPILER_NAME := gcc include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak INCLUDES += -I../.. -I$(BOOST_INCLUDE_DIR) Modified: trunk/complement/explore/inquiry/shades/PTHREADS/Makefile =================================================================== --- trunk/complement/explore/inquiry/shades/PTHREADS/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/shades/PTHREADS/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -5,5 +5,5 @@ COMPILER_NAME := gcc include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak Modified: trunk/complement/explore/inquiry/shades/SMP/Makefile =================================================================== --- trunk/complement/explore/inquiry/shades/SMP/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/shades/SMP/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -5,7 +5,7 @@ COMPILER_NAME := gcc include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak INCLUDES += -I$(SRCROOT)/include -I$(STLPORT_INCLUDE_DIR) Modified: trunk/complement/explore/inquiry/shades/StEM2Perl/mp/Makefile =================================================================== --- trunk/complement/explore/inquiry/shades/StEM2Perl/mp/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/shades/StEM2Perl/mp/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -4,7 +4,7 @@ COMPILER_NAME := gcc include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak INCLUDES += -I$(SRCROOT)/include -I../stemperl Modified: trunk/complement/explore/inquiry/shades/StEM2Perl/stemdtch/Makefile =================================================================== --- trunk/complement/explore/inquiry/shades/StEM2Perl/stemdtch/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/shades/StEM2Perl/stemdtch/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -4,7 +4,7 @@ COMPILER_NAME := gcc include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak INCLUDES += -I${CoMT_INCLUDE_DIR} LDSEARCH += -L${CoMT_LIB_DIR} Modified: trunk/complement/explore/inquiry/shades/StEM2Perl/stemecho/Makefile =================================================================== --- trunk/complement/explore/inquiry/shades/StEM2Perl/stemecho/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/shades/StEM2Perl/stemecho/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -4,7 +4,7 @@ COMPILER_NAME := gcc include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak INCLUDES += -I${CoMT_INCLUDE_DIR} LDSEARCH += -L${CoMT_LIB_DIR} Modified: trunk/complement/explore/inquiry/shades/abort-core/Makefile =================================================================== --- trunk/complement/explore/inquiry/shades/abort-core/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/shades/abort-core/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -5,7 +5,7 @@ COMPILER_NAME := gcc include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak release-shared : LDFLAGS += -Wl,-rpath=${STLPORT_LIB_DIR} dbg-shared : LDFLAGS += -Wl,-rpath=${STLPORT_LIB_DIR} Modified: trunk/complement/explore/inquiry/shades/dump_term/Makefile =================================================================== --- trunk/complement/explore/inquiry/shades/dump_term/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/shades/dump_term/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -3,7 +3,7 @@ SRCROOT := ../../.. include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak INCLUDES += -I${CoMT_INCLUDE_DIR} Modified: trunk/complement/explore/inquiry/shades/fcvt/Makefile =================================================================== --- trunk/complement/explore/inquiry/shades/fcvt/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/shades/fcvt/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -4,7 +4,7 @@ COMPILER_NAME := gcc include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak #release-shared : LDFLAGS += -Wl,-rpath=${STLPORT_LIB_DIR} #dbg-shared : LDFLAGS += -Wl,-rpath=${STLPORT_LIB_DIR} Modified: trunk/complement/explore/inquiry/shades/file-lock/Makefile =================================================================== --- trunk/complement/explore/inquiry/shades/file-lock/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/shades/file-lock/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -5,7 +5,7 @@ COMPILER_NAME := gcc include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak INCLUDES += -I$(SRCROOT)/include -I$(STLPORT_INCLUDE_DIR) -I$(BOOST_INCLUDE_DIR) Modified: trunk/complement/explore/inquiry/shades/file-lock/islock/Makefile =================================================================== --- trunk/complement/explore/inquiry/shades/file-lock/islock/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/shades/file-lock/islock/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -5,7 +5,7 @@ COMPILER_NAME := gcc include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak INCLUDES += -I$(SRCROOT)/include -I$(STLPORT_INCLUDE_DIR) -I$(BOOST_INCLUDE_DIR) -I.. Modified: trunk/complement/explore/inquiry/shades/file-lock/libflck/Makefile =================================================================== --- trunk/complement/explore/inquiry/shades/file-lock/libflck/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/shades/file-lock/libflck/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -5,7 +5,7 @@ COMPILER_NAME := gcc include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak INCLUDES += -I$(STLPORT_INCLUDE_DIR) -I${BOOST_INCLUDE_DIR} Modified: trunk/complement/explore/inquiry/shades/file-lock/libflck/ut/Makefile =================================================================== --- trunk/complement/explore/inquiry/shades/file-lock/libflck/ut/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/shades/file-lock/libflck/ut/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -6,7 +6,7 @@ COMPILER_NAME := gcc include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak INCLUDES += -I$(SRCROOT)/include -I$(STLPORT_INCLUDE_DIR) -I$(BOOST_INCLUDE_DIR) Modified: trunk/complement/explore/inquiry/shades/float/Makefile =================================================================== --- trunk/complement/explore/inquiry/shades/float/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/shades/float/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -4,6 +4,6 @@ COMPILER_NAME := gcc include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak LDFLAGS += -Wl,--rpath=${STLPORT_LIB_DIR} Modified: trunk/complement/explore/inquiry/shades/juniper/Makefile =================================================================== --- trunk/complement/explore/inquiry/shades/juniper/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/shades/juniper/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -5,7 +5,7 @@ COMPILER_NAME := gcc include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak DEFS += -D_GNU_SOURCE Modified: trunk/complement/explore/inquiry/shades/ldpreload/Makefile =================================================================== --- trunk/complement/explore/inquiry/shades/ldpreload/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/shades/ldpreload/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -5,7 +5,7 @@ COMPILER_NAME := gcc include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak DEFS += -D_GNU_SOURCE Modified: trunk/complement/explore/inquiry/shades/maxthreads/Makefile =================================================================== --- trunk/complement/explore/inquiry/shades/maxthreads/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/shades/maxthreads/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -5,7 +5,7 @@ COMPILER_NAME := gcc include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak INCLUDES += -I$(SRCROOT)/include -I$(STLPORT_INCLUDE_DIR) -I$(BOOST_INCLUDE_DIR) Modified: trunk/complement/explore/inquiry/shades/mkstemp/Makefile =================================================================== --- trunk/complement/explore/inquiry/shades/mkstemp/Makefile 2007-07-04 10:40:41 UTC (rev 1598) +++ trunk/complement/explore/inquiry/shades/mkstemp/Makefile 2007-07-04 10:47:43 UTC (rev 1599) @@ -3,7 +3,7 @@ SRCROOT := ../../.. include Makefile.inc -include ${SRCROOT}/Makefiles/top.mak +include ${SRCROOT}/Makefiles/gmake/top.mak ifndef WITHOUT_STLPORT LDFLAGS += -Wl,-rpath=${STLPORT_LIB_DIR} Modified: trunk/complement/explore/inquiry/shades/msgq/Makefile ===========================================================... [truncated message content] |
From: <com...@us...> - 2007-07-04 10:40:55
|
Revision: 1598 http://svn.sourceforge.net/complement/?rev=1598&view=rev Author: complement Date: 2007-07-04 03:40:41 -0700 (Wed, 04 Jul 2007) Log Message: ----------- development Modified Paths: -------------- trunk/complement/explore/test/virtual_time/vtime.cc trunk/complement/explore/test/virtual_time/vtime.h Modified: trunk/complement/explore/test/virtual_time/vtime.cc =================================================================== --- trunk/complement/explore/test/virtual_time/vtime.cc 2007-07-03 09:56:08 UTC (rev 1597) +++ trunk/complement/explore/test/virtual_time/vtime.cc 2007-07-04 10:40:41 UTC (rev 1598) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <07/05/24 10:24:22 ptr> +// -*- C++ -*- Time-stamp: <07/06/27 01:04:38 ptr> #include "vtime.h" @@ -105,6 +105,8 @@ void VTmess::pack( std::ostream& s ) const { + __pack( s, code ); + __pack( s, src ); gvt.pack( s ); __pack( s, grp ); __pack( s, mess ); @@ -112,6 +114,8 @@ void VTmess::net_pack( std::ostream& s ) const { + __net_pack( s, code ); + __net_pack( s, src ); gvt.net_pack( s ); __net_pack( s, grp ); __net_pack( s, mess ); @@ -119,6 +123,8 @@ void VTmess::unpack( std::istream& s ) { + __unpack( s, code ); + __unpack( s, src ); gvt.unpack( s ); __unpack( s, grp ); __unpack( s, mess ); @@ -126,6 +132,8 @@ void VTmess::net_unpack( std::istream& s ) { + __net_unpack( s, code ); + __net_unpack( s, src ); gvt.net_unpack( s ); __net_unpack( s, grp ); __net_unpack( s, mess ); @@ -277,6 +285,159 @@ return *this; } +bool vtime_obj_rec::deliver( const VTmess& m ) +{ + // cout << self_id() << " " << ev.value().mess << endl; + + // cout << ev.value().gvt.gvt << endl; + + if ( order_correct( m ) ) { + cout << "Order correct" << endl; + lvt[m.src] += m.gvt.gvt; + lvt[m.src][m.grp][m.src] = vt.gvt[m.grp][m.src] + 1; + vt.gvt[m.grp] = vt::max( vt.gvt[m.grp], lvt[m.src][m.grp] ); + cout << vt.gvt << endl; + return true; + } + + cout << "Order not correct" << endl; + return false; +} + +bool vtime_obj_rec::order_correct( const VTmess& m ) +{ + gvtime gvt( m.gvt ); + + if ( vt.gvt[m.grp][m.src] + 1 != gvt[m.grp][m.src] ) { + cerr << "1" << endl; + cerr << vt.gvt[m.grp][m.src] << "\n" + << gvt[m.grp][m.src] + << endl; + return false; + } + + vtime xvt = lvt[m.src][m.grp] + gvt[m.grp]; + xvt[m.src] = 0; + + if ( !(xvt <= vt[m.grp]) ) { + cerr << "2" << endl; + cerr << xvt << "\n\n" + << vt[m.grp] << endl; + return false; + } + + for ( groups_container_type::const_iterator l = groups.begin(); l != groups.end(); ++l ) { + if ( *l != m.grp ) { + xvt = lvt[m.src][*l] + gvt[*l]; + if ( !(xvt <= vt[*l]) ) { + cerr << "3" << endl; + cerr << "group " << *l << xvt << "\n\n" + << vt[*l] << endl; + return false; + } + } + } + + return true; +} + +void VTDispatcher::VTDispatch( const VTmess& m ) +{ + gid_map_type::const_iterator g = grmap.find( m.grp ); + if ( g != grmap.end() ) { + for ( std::list<oid_type>::const_iterator o = g->second.begin(); o != g->second.end(); ++o ) { + vt_map_type::iterator i = vtmap.find( *o ); + if ( i != vtmap.end() ) { + if ( i->second.deliver( m ) ) { + stem::Event ev( m.code ); + ev.dest(i->first); + ev.value() = m.mess; + Send( ev ); + } + } + } + } +} + +DEFINE_RESPONSE_TABLE( VTDispatcher ) + EV_T_( ST_NULL, MESS, VTDispatch, VTmess ) +END_RESPONSE_TABLE + +char *Init_buf[128]; +VTDispatch *VTHandler::_vtdsp = 0; +static int *_rcount = 0; + +void VTHandler::Init::__at_fork_prepare() +{ +} + +void VTHandler::Init::__at_fork_child() +{ + if ( *_rcount != 0 ) { + VTHandler::_vtdsp->~VTDispatch(); + VTHandler::_vtdsp = new( VTHandler::_vtdsp ) VTDispatcher(); + } +} + +void VTHandler::Init::__at_fork_parent() +{ +} + +void VTHandler::Init::_guard( int direction ) +{ + static xmt::MutexRS _init_lock; + static int _count = 0; + + if ( direction ) { + if ( _count++ == 0 ) { +#ifdef _PTHREADS + _rcount = &_count; + pthread_atfork( __at_fork_prepare, __at_fork_parent, __at_fork_child ); +#endif + VTHandler::_vtdsp = new VTDispatcher(); + } + } else { + --_count; + if ( _count == 0 ) { + delete VTHandler::_vtdsp; + VTHandler::_vtdsp = 0; + } + } +} + +VTHandler::Init::Init() +{ _guard( 1 ); } + +VTHandler::Init::~Init() +{ _guard( 0 ); } + +void VTHandler::VTSend( const stem::Event& ev ) +{ +} + +VTHandler::VTHandler() : + EventHandler() +{ + new( Init_buf ) Init(); +} + +VTHandler::VTHandler( const char *info ) : + EventHandler( info ) +{ + new( Init_buf ) Init(); +} + +VTHandler::VTHandler( stem::addr_type id, const char *info ) : + EventHandler( id, info ) +{ + new( Init_buf ) Init(); +} + +VTHandler::~VTHandler() +{ + ((Init *)Init_buf)->~Init(); +} + void Proc::mess( const stem::Event_base<VTmess>& ev ) { cout << self_id() << " " << ev.value().mess << endl; Modified: trunk/complement/explore/test/virtual_time/vtime.h =================================================================== --- trunk/complement/explore/test/virtual_time/vtime.h 2007-07-03 09:56:08 UTC (rev 1597) +++ trunk/complement/explore/test/virtual_time/vtime.h 2007-07-04 10:40:41 UTC (rev 1598) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <07/05/18 00:26:00 ptr> +// -*- C++ -*- Time-stamp: <07/06/27 00:59:45 ptr> #ifndef __vtime_h #define __vtime_h @@ -129,19 +129,108 @@ void unpack( std::istream& s ); void net_unpack( std::istream& s ); - VTmess() - { } - VTmess( const VTmess& _gvt ) : - gvt( _gvt.gvt ), - mess( _gvt.mess ) - { } + VTmess() + { } + VTmess( const VTmess& _gvt ) : + gvt( _gvt.gvt ), + mess( _gvt.mess ) + { } - gvtime gvt; - group_type grp; - std::string mess; + stem::code_type code; + oid_type src; + gvtime gvt; + group_type grp; + std::string mess; }; +class vtime_obj_rec +{ + public: + typedef std::list<group_type> groups_container_type; + typedef std::hash_map<oid_type, gvtime_type> delta_vtime_type; + + void add_group( group_type g ) + { groups.push_back( g ); } + + void add_group_member( group_type g, oid_type p ) + { vt[g][p]; } + + bool deliver( const VTmess& ev ); + + stem::addr_type addr; // stem address of object + delta_vtime_type lvt; // last seen VT of neighbours + gvtime vt; // VT of object + groups_container_type groups; // member of groups + // delay pool should be here + + private: + bool order_correct( const VTmess& ); +}; + +class VTDispatcher : + public stem::EventHandler +{ + public: + VTDispatcher() + { } + + VTDispatcher( stem::addr_type id ) : + stem::EventHandler( id ) + { } + + void VTDispatch( const VTmess& ); + + void VTSend( const Event& e ); + + private: + typedef std::hash_map<oid_type, vtime_obj_rec> vt_map_type; + typedef std::hash_map<group_type, std::list<oid_type> > gid_map_type; + // oid_type map_gid( group_type ); + // gid_type -> (oid_type, oid_type, ...) + + // in our case we can use gid = hi bits | oid + + vt_map_type vtmap; + gid_map_type grmap; + + DECLARE_RESPONSE_TABLE( VTDispatcher, stem::EventHandler ); +}; + +class VTHandler : + public stem::EventHandler +{ + public: + class Init + { + public: + Init(); + ~Init(); + private: + static void _guard( int ); + static void __at_fork_prepare(); + static void __at_fork_child(); + static void __at_fork_parent(); + }; + + public: + VTHandler(); + explicit VTHandler( const char *info ); + explicit VTHandler( stem::addr_type id, const char *info = 0 ); + virtual ~VTHandler(); + + void VTSend( const Event& e ); + + template <class D> + void VTSend( const stem::Event_base<D>& e ) + { VTHandler::VTSend( stem::Event_convert<D>()( e ) ); } + + + private: + static class VTDispatcher *_vtdsp; +}; + + class Proc : public stem::EventHandler { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2007-07-03 09:56:15
|
Revision: 1597 http://svn.sourceforge.net/complement/?rev=1597&view=rev Author: complement Date: 2007-07-03 02:56:08 -0700 (Tue, 03 Jul 2007) Log Message: ----------- add Exam use cases Modified Paths: -------------- trunk/WWW/explore/Complement/ContentTech.shtml trunk/WWW/explore/Complement/SVN.shtml trunk/WWW/explore/Complement/Technical.shtml Added Paths: ----------- trunk/WWW/explore/Complement/ExamUseCaseSpec.pdf Modified: trunk/WWW/explore/Complement/ContentTech.shtml =================================================================== --- trunk/WWW/explore/Complement/ContentTech.shtml 2007-07-03 09:52:12 UTC (rev 1596) +++ trunk/WWW/explore/Complement/ContentTech.shtml 2007-07-03 09:56:08 UTC (rev 1597) @@ -4,6 +4,7 @@ <a href="MakeStart.shtml">Make system</a><br> <a href="Boiler1.shtml">EDA sample: design and coding bioler system</a><br> <a href="compare.pdf">Comparison of STL Implementations (PDF)</a><br> +<a href="ExamUseCaseSpec.pdf">``Exam'' requirements: use cases</a><br> <br> <a href="http://sourceforge.net"><img src="http://sourceforge.net/sflogo.php?group_id=63160&type=2" width="125" height="37" border="0" alt="SourceForge.net Logo"></a><br> </div> Added: trunk/WWW/explore/Complement/ExamUseCaseSpec.pdf =================================================================== --- trunk/WWW/explore/Complement/ExamUseCaseSpec.pdf (rev 0) +++ trunk/WWW/explore/Complement/ExamUseCaseSpec.pdf 2007-07-03 09:56:08 UTC (rev 1597) @@ -0,0 +1,2733 @@ +%PDF-1.4 +%\xD0\xD4\xC5\xD8 +5 0 obj +<< /S /GoTo /D (section.1) >> +endobj +8 0 obj +(\376\377\000U\000n\000i\000t\000\040\000T\000e\000s\000t\000\040\000F\000r\000a\000m\000e\000w\000o\000r\000k) +endobj +9 0 obj +<< /S /GoTo /D (subsection.1.1) >> +endobj +12 0 obj +(\376\377\000B\000r\000i\000e\000f\000\040\000D\000e\000s\000c\000r\000i\000p\000t\000i\000o\000n) +endobj +13 0 obj +<< /S /GoTo /D (section.2) >> +endobj +16 0 obj +(\376\377\000F\000l\000o\000w\000\040\000o\000f\000\040\000E\000v\000e\000n\000t\000s) +endobj +17 0 obj +<< /S /GoTo /D (subsection.2.1) >> +endobj +20 0 obj +(\376\377\000B\000a\000s\000i\000c\000\040\000F\000l\000o\000w) +endobj +21 0 obj +<< /S /GoTo /D (subsection.2.2) >> +endobj +24 0 obj +(\376\377\000A\000l\000t\000e\000r\000n\000a\000t\000i\000v\000e\000\040\000F\000l\000o\000w\000s) +endobj +25 0 obj +<< /S /GoTo /D (subsubsection.2.2.1) >> +endobj +28 0 obj +(\376\377\000T\000e\000s\000t\000\040\000s\000u\000i\000t\000e\000\040\000f\000o\000r\000\040\000i\000n\000t\000e\000r\000a\000c\000t\000i\000v\000e\000\040\000p\000r\000o\000g\000r\000a\000m) +endobj +29 0 obj +<< /S /GoTo /D (subsubsection.2.2.2) >> +endobj +32 0 obj +(\376\377\000M\000u\000l\000t\000i\000-\000t\000h\000r\000e\000a\000d\000e\000d\000\040\000t\000e\000s\000t\000\040\000s\000u\000i\000t\000e) +endobj +33 0 obj +<< /S /GoTo /D (subsubsection.2.2.3) >> +endobj +36 0 obj +(\376\377\000T\000e\000s\000t\000\040\000s\000u\000i\000t\000e\000\040\000w\000i\000t\000h\000\040\000f\000o\000r\000k) +endobj +37 0 obj +<< /S /GoTo /D (subsubsection.2.2.4) >> +endobj +40 0 obj +(\376\377\000T\000e\000s\000t\000\040\000s\000u\000i\000t\000e\000\040\000w\000i\000t\000h\000\040\000p\000r\000o\000c\000e\000s\000s\000\040\000i\000n\000t\000e\000r\000c\000o\000m\000m\000u\000n\000i\000c\000a\000t\000i\000o\000n) +endobj +41 0 obj +<< /S /GoTo /D (section.3) >> +endobj +44 0 obj +(\376\377\000S\000p\000e\000c\000i\000a\000l\000\040\000R\000e\000q\000u\000i\000r\000e\000m\000e\000n\000t\000s) +endobj +45 0 obj +<< /S /GoTo /D (subsection.3.1) >> +endobj +48 0 obj +(\376\377\000S\000u\000i\000t\000a\000b\000l\000e\000\040\000f\000o\000r\000\040\000d\000e\000b\000u\000g\000g\000i\000n\000g) +endobj +49 0 obj +<< /S /GoTo /D (subsection.3.2) >> +endobj +52 0 obj +(\376\377\000O\000u\000t\000p\000u\000t\000\040\000f\000r\000o\000m\000\040\000f\000e\000w\000\040\000c\000o\000n\000t\000r\000o\000l\000\040\000f\000l\000o\000w\000s) +endobj +53 0 obj +<< /S /GoTo /D (subsection.3.3) >> +endobj +56 0 obj +(\376\377\000I\000n\000t\000e\000g\000r\000a\000b\000l\000e) +endobj +57 0 obj +<< /S /GoTo /D (subsection.3.4) >> +endobj +60 0 obj +(\376\377\000T\000e\000s\000t\000s\000\040\000d\000e\000p\000e\000n\000d\000e\000n\000c\000y) +endobj +61 0 obj +<< /S /GoTo /D (subsection.3.5) >> +endobj +64 0 obj +(\376\377\000T\000e\000s\000t\000s\000\040\000g\000r\000o\000u\000p\000i\000n\000g) +endobj +65 0 obj +<< /S /GoTo /D (subsection.3.6) >> +endobj +68 0 obj +(\376\377\000R\000e\000p\000o\000r\000t\000\040\000f\000o\000r\000m\000a\000t) +endobj +69 0 obj +<< /S /GoTo /D (subsection.3.7) >> +endobj +72 0 obj +(\376\377\000T\000e\000s\000t\000\040\000t\000i\000m\000e\000o\000u\000t) +endobj +73 0 obj +<< /S /GoTo /D (section.4) >> +endobj +76 0 obj +(\376\377\000E\000x\000t\000e\000n\000s\000i\000o\000n\000\040\000P\000o\000i\000n\000t\000s) +endobj +77 0 obj +<< /S /GoTo /D (subsection.4.1) >> +endobj +80 0 obj +(\376\377\000R\000e\000m\000o\000t\000e\000\040\000t\000e\000s\000t\000i\000n\000g) +endobj +81 0 obj +<< /S /GoTo /D (subsection.4.2) >> +endobj +84 0 obj +(\376\377\000P\000e\000r\000f\000o\000r\000m\000a\000n\000c\000e\000\040\000M\000e\000s\000u\000r\000e) +endobj +85 0 obj +<< /S /GoTo /D [86 0 R /Fit ] >> +endobj +88 0 obj << +/Length 2079 +/Filter /FlateDecode +>> +stream +x\xDA\xED[Isܶ\xBEϯ\xE0\x91<\xC1J |
From: <com...@us...> - 2007-07-03 09:52:21
|
Revision: 1596 http://svn.sourceforge.net/complement/?rev=1596&view=rev Author: complement Date: 2007-07-03 02:52:12 -0700 (Tue, 03 Jul 2007) Log Message: ----------- rename main file Modified Paths: -------------- trunk/complement/explore/app/exam/doc/requirements/Makefile Added Paths: ----------- trunk/complement/explore/app/exam/doc/requirements/ExamUseCaseSpec.tex Removed Paths: ------------- trunk/complement/explore/app/exam/doc/requirements/UseCaseSpec.tex Copied: trunk/complement/explore/app/exam/doc/requirements/ExamUseCaseSpec.tex (from rev 1593, trunk/complement/explore/app/exam/doc/requirements/UseCaseSpec.tex) =================================================================== --- trunk/complement/explore/app/exam/doc/requirements/ExamUseCaseSpec.tex (rev 0) +++ trunk/complement/explore/app/exam/doc/requirements/ExamUseCaseSpec.tex 2007-07-03 09:52:12 UTC (rev 1596) @@ -0,0 +1,318 @@ +% -*- LaTeX -*- + +\documentclass[a4paper,twoside]{article} + +% \usepackage[koi8-r]{inputenc} +\usepackage[T1]{fontenc} +\usepackage[american]{babel} +\usepackage[colorlinks,urlcolor=blue,unicode=true]{hyperref} +\usepackage{url} + +\usepackage[pdftex]{graphics} +%\usepackage{pslatex} +% \usepackage[dvips,final]{epsfig} +% \usepackage{cm-super} +%\usepackage[colorlinks,urlcolor=blue]{hyperref} +%\usepackage{url} + +\usepackage{rup} +%% Define a new 'leo' style for the package that will use a smaller font. +\makeatletter +\def\url@leostyle{% + \@ifundefined{selectfont}{\def\UrlFont{\sf}}{\def\UrlFont{\small\ttfamily}}} +\makeatother +%% Now actually use the newly defined style. +\urlstyle{leo} + + +\version{0.1} +\title{Use Case Specification: ``Unit Test Framework''} + +\project{Exam} + +\RevHistory{2007--03--08 & 1.0 & Initial document & Petr Ovtchenkov \cr \hline} + +\begin{document} + +\maketitle +% toc +\tableofcontents + +\section{Unit Test Framework} + +% [The following template is provided for a Use-Case +% Specification, which contains the textual properties of the use case. +% This document is used with a requirements management tool, such as Rational +% RequisitePro, for specifying and marking the requirements within the use case +% properties] + +% [The diagrams of the use case can be developed in a visual +% modeling tool, such as Rational Rose. A use-case report (with all +% properties) may be generated with Rational SoDA. For more information, see the tool mentors in the Rational +% Unified Process.] + +\subsection{Brief Description} + +% [The description should briefly convey the role and purpose +% of the use case. A single paragraph +% should suffice for this description.] + +Unit test framework should provide a matched set of components for writing +test programs, grouping tests into test cases and test suites, +monitoring and controlling their runtime execution. Unit test framework +should be convenient for testing programs and set of programs that implement +services and client--server technologies (the set of intercommunicating programs, many +control flows). + +\section{Flow of Events} + +\subsection{Basic Flow} + +% [This use case starts when the actor does something. An actor always initiates use Cases. The use case should describe what the actor +% does and what the system does in response. +% It should be phrased in the form of a dialog between the actor and the +% system. +% +% The use case should describe what happens inside the system, +% but not how or why. If information is +% exchanged, be specific about what is passed back and forth. For example, it is not very illuminating to +% say that the Actor enters customer information. It is better to say the Actor +% enters the customer's name and address. +% A Glossary of Terms is often useful to keep the complexity of the use +% case manageable---you +% may want to define things like customer information there to keep the use case +% from drowning in details. +% +% Simple alternatives may be presented within the text of the +% use case. If it only takes a few +% sentences to describe what happens when there is an alternative, do it directly +% within the \textbf{Flow of Events} section. +% If the alternative flows are more complex, use a separate section to +% describe it. For example, an \textbf{Alternative Flow} +% subsection explains how to describe more complex alternatives. +% +% A picture is sometimes worth a thousand words, though there +% is no substitute for clean, clear prose. +% If it improves clarity, feel free to paste graphical depictions of user +% interfaces, process flows or other figures into the use case. If a flow chart is useful to present a +% complex decision process, by all means use it! +% Similarly for state-dependent behavior, a state-transition diagram often +% clarifies the behavior of a system better than pages upon pages of text. Use the right presentation medium for your +% problem, but be wary of using terminology, notations or figures that your +% audience may not understand. Remember +% that your purpose is to clarify, not obscure.] + +The test suite with single control flow. It notify about start of test suite, +run tests within this test suite (in the order following from tests dependency +graph), report about checks of conditions (verbosity depends upon log level), and print the resulting summary of the test suite (see fig.\ref{SingleFlow}). + +\begin{figure} + \begin{center} +% \input intercessor-time.pstex_t +% \input p1.pdf_t +% \scalebox{0.8}{\includegraphics{p1.pdf}} + \includegraphics{p1.mps} + \end{center} + \caption{The test case with single control flow.\label{SingleFlow}} +\end{figure} + + +\subsection{Alternative Flows} + +\subsubsection{Test suite for interactive program} + +% [More complex alternatives should be described in a separate +% section, which is referred to in the \textbf{Basic Flow} subsection +% of \textbf{Flow of Events} section. Think of the +% \textbf{Alternative Flow}> subsections like alternative behavior---each +% alternative flow +% represents alternative behavior, many times because of exceptions that occur in +% the main flow. They may be as long as +% necessary to describe the events associated with the alternative behavior. When an alternative flow ends, the events of +% the main flow of events are resumed unless otherwise stated.] + +The test suite with single control flow. It notify about start of test suite, +run tests within this test suite (in the order, described by tests dependency +graph), print conditions report (verbosity depends upon log level), and print the resulting summary of the test suite (see fig.\ref{InteractiveSingleFlow}). +During execution of the test suite, it require interaction with: it print +messages onto terminal and expect input from terminal. + +\begin{figure} + \begin{center} + \includegraphics{p5.mps} + \end{center} + \caption{The test case with single control flow; test suite is + interactive, it print some message to terminal and expect input + from terminal.\label{InteractiveSingleFlow}} +\end{figure} + +This use-case reflect test suite for interactive part of program. + +\subsubsection{Multi-threaded test suite} + +% [There may be, and most likely will be, a number of +% alternative flows in a use case. Keep +% each alternative separate to improve clarity. +% Using alternative flows improves the readability of the use case, as +% well as preventing use cases from being decomposed into hierarchies of use +% cases. Keep in mind that use cases are +% just textual descriptions, and their main purpose is to document the behavior +% of a system in a clear, concise, and understandable way.] + +The test suite with more then one control flow. It register start of test suite, +run tests within this test suite (in the order, described by tests dependency +graph), print conditions report (verbosity depends upon log level), and print the resulting summary of the test suite (see fig.\ref{ThreadedFlow}). +Test control flow is splitted into few threads. + +\begin{figure} + \begin{center} + \includegraphics{p2.mps} + \end{center} + \caption{The test case with few control flows, single process.\label{ThreadedFlow}} +\end{figure} + +This use-case reflect test suite for multi-threaded program, such as server, +that provide some kind of service. + +\subsubsection{Test suite with fork} + +The test suite with more then one control flow. It register start of test suite, +run tests within this test suite (in the order, described by tests dependency +graph), print conditions report (verbosity depends upon log level), and print the resulting summary of the test suite (see fig.\ref{ForkedFlow}). +Some tests of the test suite forked into several processes. + +\begin{figure} + \begin{center} + \includegraphics{p4.mps} + \end{center} + \caption{The test case with few control flows, process forked.\label{ForkedFlow}} +\end{figure} + +This use-case reflect test suite for daemons and client-server interaction. + +\subsubsection{Test suite with process intercommunication} + +The test suite with more then one control flow. It register start of test suite, +run tests within this test suite (in the order, described by tests dependency +graph), print conditions report (verbosity depends upon log level), and print the resulting summary of the test suite (see fig.\ref{IntercomProcesses}). +Some tests of the test suite forked into several processes. + +\begin{figure} + \begin{center} + \includegraphics{p3.mps} + \end{center} + \caption{The test case with few control flows, intercommunicated processes.\label{IntercomProcesses}} +\end{figure} + +This use-case reflect test suite for daemons and client-server interaction. + +\section{Special Requirements} + +% [A special requirement is typically a non-functional +% requirement that is specific to a use case, but is not easily or naturally +% specified in the text of the use case's event flow. Examples of special +% requirements include legal and regulatory requirements, application standards, +% and quality attributes of the system to be built including usability, +% reliability, performance or supportability requirements. Additionally, other +% requirements---such +% as operating systems and environments, compatibility requirements, and design +% constraints---should be captured in this section.] + +\subsection{Suitable for debugging} + +\begin{figure} + \begin{center} + \includegraphics{debug-focus.mps} + \end{center} + \caption{Development application: functionality implementation cycle.\label{DevCycle}} +\end{figure} + +Unit tests not only instrument of QA (see fig.~\ref{DevCycle}). +Unit tests written +in parallel with functionality implementation,\footnote{as assume XP technique} +provide a good practice ground +for debugging. Implementation of special test cases for debugging +after detection problem in unit test isn't a good idea by financial (time and other resources) reasons. +Even more: in non-trivial cases not evident, what was wrong: +either incorrect functionality imlementation, or test, or even +specification. Developer should has a chance to debug program +keeping in mind as main functionality, as unit test logic. + +Due to this unit test framework intended for testing services, and services +often has own logic of signal processing, the unit test framework +should not (at least by default) intervenes into signal catching. +This also concern fatal errors with dumping core: dumping core ``as is'' +is more preferable way (useful for post-mortal debugging) then nice report +``you test died'' with unuseful stack. + +\subsection{Output from few control flows} + +Unit test suite should provide reasonable output as for tests +with single control flow, as for multi-threaded and multi-process tests. + +Unit test suite should provide reasonable output for test +with console output and input, i.e. split prints from interaction with user +from prints about failed conditions. + +\subsection{Integrable} + +To be light-weight, easy integrable into other tools and scripts. + +\subsection{Tests dependency\label{TestDependency}} + +Tests run order should be determined from tests dependency graph. + +\subsection{Tests grouping} + +The ability of grouping tests is desirable: +\begin{itemize} + \item single function tests + \item class (group of tests) with initialization and finalization. +\end{itemize} + +\subsection{Report format} + +Unit test framework should provide few levels of output verbosity, and +few formats of reports (plain text, xml/html). + +\subsection{Test timeout} + +Due to deadlock (or other conditions, leads to stalled test) may occur, +it would be nice if monitoring program abort such test after specified timeout, +and continue other tests (taken into account tests dependencies, section~\ref{TestDependency}). + +% \section{Pre-Conditions} + +% [A pre-condition of a use case is the state of the system +% that must be present prior to a use case being performed.] + +% \subsection{Pre-condition One} + +% \section{Post-Conditions} + +% [A post-condition of a use case is a list of possible states +% the system can be in immediately after a use case has finished.] + +% \subsection{Post-condition One} + +\section{Extension Points} + +% [Extension points of the use case.] + +\subsection{Remote testing} + +% [Definition of the location of the extension point in the +% flow of events.] + +Test suite monitoring may be performed from remote host. This also useful +if test suite allow monitoring a few (intercommunicating) processes, that +run on different hosts. + +\subsection{Performance Mesure} + +Unit tests may be used for performance measure of key technology solutions. + +%\bibliographystyle{plain} +%\bibliography{db-res} + +\end{document} Modified: trunk/complement/explore/app/exam/doc/requirements/Makefile =================================================================== --- trunk/complement/explore/app/exam/doc/requirements/Makefile 2007-07-02 11:54:13 UTC (rev 1595) +++ trunk/complement/explore/app/exam/doc/requirements/Makefile 2007-07-03 09:52:12 UTC (rev 1596) @@ -1,9 +1,9 @@ -PDFNAMES = UseCaseSpec +PDFNAMES = ExamUseCaseSpec -UseCaseSpec_SRC_TEX = UseCaseSpec.tex -UseCaseSpec_SRC_FIG = p1.fig p2.fig p3.fig p4.fig p5.fig debug-focus.fig +ExamUseCaseSpec_SRC_TEX = ExamUseCaseSpec.tex +ExamUseCaseSpec_SRC_FIG = p1.fig p2.fig p3.fig p4.fig p5.fig debug-focus.fig -all: UseCaseSpec.pdf +all: $(addsuffix .pdf,$(PDFNAMES)) OUTDIR = .out @@ -60,5 +60,3 @@ fi endef -.PHONY: dirs - Deleted: trunk/complement/explore/app/exam/doc/requirements/UseCaseSpec.tex =================================================================== --- trunk/complement/explore/app/exam/doc/requirements/UseCaseSpec.tex 2007-07-02 11:54:13 UTC (rev 1595) +++ trunk/complement/explore/app/exam/doc/requirements/UseCaseSpec.tex 2007-07-03 09:52:12 UTC (rev 1596) @@ -1,318 +0,0 @@ -% -*- LaTeX -*- - -\documentclass[a4paper,twoside]{article} - -% \usepackage[koi8-r]{inputenc} -\usepackage[T1]{fontenc} -\usepackage[american]{babel} -\usepackage[colorlinks,urlcolor=blue,unicode=true]{hyperref} -\usepackage{url} - -\usepackage[pdftex]{graphics} -%\usepackage{pslatex} -% \usepackage[dvips,final]{epsfig} -% \usepackage{cm-super} -%\usepackage[colorlinks,urlcolor=blue]{hyperref} -%\usepackage{url} - -\usepackage{rup} -%% Define a new 'leo' style for the package that will use a smaller font. -\makeatletter -\def\url@leostyle{% - \@ifundefined{selectfont}{\def\UrlFont{\sf}}{\def\UrlFont{\small\ttfamily}}} -\makeatother -%% Now actually use the newly defined style. -\urlstyle{leo} - - -\version{0.1} -\title{Use Case Specification: ``Unit Test Framework''} - -\project{Exam} - -\RevHistory{2007--03--08 & 1.0 & Initial document & Petr Ovtchenkov \cr \hline} - -\begin{document} - -\maketitle -% toc -\tableofcontents - -\section{Unit Test Framework} - -% [The following template is provided for a Use-Case -% Specification, which contains the textual properties of the use case. -% This document is used with a requirements management tool, such as Rational -% RequisitePro, for specifying and marking the requirements within the use case -% properties] - -% [The diagrams of the use case can be developed in a visual -% modeling tool, such as Rational Rose. A use-case report (with all -% properties) may be generated with Rational SoDA. For more information, see the tool mentors in the Rational -% Unified Process.] - -\subsection{Brief Description} - -% [The description should briefly convey the role and purpose -% of the use case. A single paragraph -% should suffice for this description.] - -Unit test framework should provide a matched set of components for writing -test programs, grouping tests into test cases and test suites, -monitoring and controlling their runtime execution. Unit test framework -should be convenient for testing programs and set of programs that implement -services and client--server technologies (the set of intercommunicating programs, many -control flows). - -\section{Flow of Events} - -\subsection{Basic Flow} - -% [This use case starts when the actor does something. An actor always initiates use Cases. The use case should describe what the actor -% does and what the system does in response. -% It should be phrased in the form of a dialog between the actor and the -% system. -% -% The use case should describe what happens inside the system, -% but not how or why. If information is -% exchanged, be specific about what is passed back and forth. For example, it is not very illuminating to -% say that the Actor enters customer information. It is better to say the Actor -% enters the customer's name and address. -% A Glossary of Terms is often useful to keep the complexity of the use -% case manageable---you -% may want to define things like customer information there to keep the use case -% from drowning in details. -% -% Simple alternatives may be presented within the text of the -% use case. If it only takes a few -% sentences to describe what happens when there is an alternative, do it directly -% within the \textbf{Flow of Events} section. -% If the alternative flows are more complex, use a separate section to -% describe it. For example, an \textbf{Alternative Flow} -% subsection explains how to describe more complex alternatives. -% -% A picture is sometimes worth a thousand words, though there -% is no substitute for clean, clear prose. -% If it improves clarity, feel free to paste graphical depictions of user -% interfaces, process flows or other figures into the use case. If a flow chart is useful to present a -% complex decision process, by all means use it! -% Similarly for state-dependent behavior, a state-transition diagram often -% clarifies the behavior of a system better than pages upon pages of text. Use the right presentation medium for your -% problem, but be wary of using terminology, notations or figures that your -% audience may not understand. Remember -% that your purpose is to clarify, not obscure.] - -The test suite with single control flow. It notify about start of test suite, -run tests within this test suite (in the order following from tests dependency -graph), report about checks of conditions (verbosity depends upon log level), and print the resulting summary of the test suite (see fig.\ref{SingleFlow}). - -\begin{figure} - \begin{center} -% \input intercessor-time.pstex_t -% \input p1.pdf_t -% \scalebox{0.8}{\includegraphics{p1.pdf}} - \includegraphics{p1.mps} - \end{center} - \caption{The test case with single control flow.\label{SingleFlow}} -\end{figure} - - -\subsection{Alternative Flows} - -\subsubsection{Test suite for interactive program} - -% [More complex alternatives should be described in a separate -% section, which is referred to in the \textbf{Basic Flow} subsection -% of \textbf{Flow of Events} section. Think of the -% \textbf{Alternative Flow}> subsections like alternative behavior---each -% alternative flow -% represents alternative behavior, many times because of exceptions that occur in -% the main flow. They may be as long as -% necessary to describe the events associated with the alternative behavior. When an alternative flow ends, the events of -% the main flow of events are resumed unless otherwise stated.] - -The test suite with single control flow. It notify about start of test suite, -run tests within this test suite (in the order, described by tests dependency -graph), print conditions report (verbosity depends upon log level), and print the resulting summary of the test suite (see fig.\ref{InteractiveSingleFlow}). -During execution of the test suite, it require interaction with: it print -messages onto terminal and expect input from terminal. - -\begin{figure} - \begin{center} - \includegraphics{p5.mps} - \end{center} - \caption{The test case with single control flow; test suite is - interactive, it print some message to terminal and expect input - from terminal.\label{InteractiveSingleFlow}} -\end{figure} - -This use-case reflect test suite for interactive part of program. - -\subsubsection{Multi-threaded test suite} - -% [There may be, and most likely will be, a number of -% alternative flows in a use case. Keep -% each alternative separate to improve clarity. -% Using alternative flows improves the readability of the use case, as -% well as preventing use cases from being decomposed into hierarchies of use -% cases. Keep in mind that use cases are -% just textual descriptions, and their main purpose is to document the behavior -% of a system in a clear, concise, and understandable way.] - -The test suite with more then one control flow. It register start of test suite, -run tests within this test suite (in the order, described by tests dependency -graph), print conditions report (verbosity depends upon log level), and print the resulting summary of the test suite (see fig.\ref{ThreadedFlow}). -Test control flow is splitted into few threads. - -\begin{figure} - \begin{center} - \includegraphics{p2.mps} - \end{center} - \caption{The test case with few control flows, single process.\label{ThreadedFlow}} -\end{figure} - -This use-case reflect test suite for multi-threaded program, such as server, -that provide some kind of service. - -\subsubsection{Test suite with fork} - -The test suite with more then one control flow. It register start of test suite, -run tests within this test suite (in the order, described by tests dependency -graph), print conditions report (verbosity depends upon log level), and print the resulting summary of the test suite (see fig.\ref{ForkedFlow}). -Some tests of the test suite forked into several processes. - -\begin{figure} - \begin{center} - \includegraphics{p4.mps} - \end{center} - \caption{The test case with few control flows, process forked.\label{ForkedFlow}} -\end{figure} - -This use-case reflect test suite for daemons and client-server interaction. - -\subsubsection{Test suite with process intercommunication} - -The test suite with more then one control flow. It register start of test suite, -run tests within this test suite (in the order, described by tests dependency -graph), print conditions report (verbosity depends upon log level), and print the resulting summary of the test suite (see fig.\ref{IntercomProcesses}). -Some tests of the test suite forked into several processes. - -\begin{figure} - \begin{center} - \includegraphics{p3.mps} - \end{center} - \caption{The test case with few control flows, intercommunicated processes.\label{IntercomProcesses}} -\end{figure} - -This use-case reflect test suite for daemons and client-server interaction. - -\section{Special Requirements} - -% [A special requirement is typically a non-functional -% requirement that is specific to a use case, but is not easily or naturally -% specified in the text of the use case's event flow. Examples of special -% requirements include legal and regulatory requirements, application standards, -% and quality attributes of the system to be built including usability, -% reliability, performance or supportability requirements. Additionally, other -% requirements---such -% as operating systems and environments, compatibility requirements, and design -% constraints---should be captured in this section.] - -\subsection{Suitable for debugging} - -\begin{figure} - \begin{center} - \includegraphics{debug-focus.mps} - \end{center} - \caption{Development application: functionality implementation cycle.\label{DevCycle}} -\end{figure} - -Unit tests not only instrument of QA (see fig.~\ref{DevCycle}). -Unit tests written -in parallel with functionality implementation,\footnote{as assume XP technique} -provide a good practice ground -for debugging. Implementation of special test cases for debugging -after detection problem in unit test isn't a good idea by financial (time and other resources) reasons. -Even more: in non-trivial cases not evident, what was wrong: -either incorrect functionality imlementation, or test, or even -specification. Developer should has a chance to debug program -keeping in mind as main functionality, as unit test logic. - -Due to this unit test framework intended for testing services, and services -often has own logic of signal processing, the unit test framework -should not (at least by default) intervenes into signal catching. -This also concern fatal errors with dumping core: dumping core ``as is'' -is more preferable way (useful for post-mortal debugging) then nice report -``you test died'' with unuseful stack. - -\subsection{Output from few control flows} - -Unit test suite should provide reasonable output as for tests -with single control flow, as for multi-threaded and multi-process tests. - -Unit test suite should provide reasonable output for test -with console output and input, i.e. split prints from interaction with user -from prints about failed conditions. - -\subsection{Integrable} - -To be light-weight, easy integrable into other tools and scripts. - -\subsection{Tests dependency\label{TestDependency}} - -Tests run order should be determined from tests dependency graph. - -\subsection{Tests grouping} - -The ability of grouping tests is desirable: -\begin{itemize} - \item single function tests - \item class (group of tests) with initialization and finalization. -\end{itemize} - -\subsection{Report format} - -Unit test framework should provide few levels of output verbosity, and -few formats of reports (plain text, xml/html). - -\subsection{Test timeout} - -Due to deadlock (or other conditions, leads to stalled test) may occur, -it would be nice if monitoring program abort such test after specified timeout, -and continue other tests (taken into account tests dependencies, section~\ref{TestDependency}). - -% \section{Pre-Conditions} - -% [A pre-condition of a use case is the state of the system -% that must be present prior to a use case being performed.] - -% \subsection{Pre-condition One} - -% \section{Post-Conditions} - -% [A post-condition of a use case is a list of possible states -% the system can be in immediately after a use case has finished.] - -% \subsection{Post-condition One} - -\section{Extension Points} - -% [Extension points of the use case.] - -\subsection{Remote testing} - -% [Definition of the location of the extension point in the -% flow of events.] - -Test suite monitoring may be performed from remote host. This also useful -if test suite allow monitoring a few (intercommunicating) processes, that -run on different hosts. - -\subsection{Performance Mesure} - -Unit tests may be used for performance measure of key technology solutions. - -%\bibliographystyle{plain} -%\bibliography{db-res} - -\end{document} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2007-07-02 11:54:14
|
Revision: 1595 http://svn.sourceforge.net/complement/?rev=1595&view=rev Author: complement Date: 2007-07-02 04:54:13 -0700 (Mon, 02 Jul 2007) Log Message: ----------- prototype for automation Added Paths: ----------- trunk/complement/explore/app/exam/doc/requirements/Makefile Added: trunk/complement/explore/app/exam/doc/requirements/Makefile =================================================================== --- trunk/complement/explore/app/exam/doc/requirements/Makefile (rev 0) +++ trunk/complement/explore/app/exam/doc/requirements/Makefile 2007-07-02 11:54:13 UTC (rev 1595) @@ -0,0 +1,64 @@ +PDFNAMES = UseCaseSpec + +UseCaseSpec_SRC_TEX = UseCaseSpec.tex +UseCaseSpec_SRC_FIG = p1.fig p2.fig p3.fig p4.fig p5.fig debug-focus.fig + +all: UseCaseSpec.pdf + +OUTDIR = .out + +PDF_DIR_SRC = +FIG_BASE = +define pdf_ +PDF_DIR_SRC += $$(dir $${$(1)_SRC_TEX} $${$(1)_SRC_FIG} ) +FIG_BASE += $$(basename $${$(1)_SRC_FIG}) +$(1)_ALLMP := $$(addsuffix .mp,$$(basename $${$(1)_SRC_FIG} ) ) +$(1)_ALLMPS := $$(addsuffix .mps,$$(basename $${$(1)_SRC_FIG} ) ) +$(1)_ALL0 := $$(addsuffix .0,$$(basename $${$(1)_SRC_FIG} ) ) + +$(1)_MP := $$(addprefix $$(OUTDIR)/,$${$(1)_ALLMP}) +$(1)_MPS := $$($(1)_ALLMPS) +$(1)_0 := $$(addprefix $$(OUTDIR)/,$${$(1)_ALL0}) + +$(1).pdf: $$($(1)_SRC_TEX) $$($(1)_MPS) + pdflatex $$< +endef + +$(foreach pdf,$(PDFNAMES),$(eval $(call pdf_,$(pdf)))) + +# if sources disposed in several dirs, calculate appropriate rules + +DIRS_UNIQUE_SRC := $(dir $(SRC_FIG) $(SRC_TEX) ) +DIRS_UNIQUE_SRC := $(sort $(DIRS_UNIQUE_SRC) $(PDF_DIR_SRC)) + + +define rule_mp +$$(OUTDIR$(1))/%.mp: $(2)%.fig + $$(chdirs) + fig2dev -L mp $$< $$@ +endef + +define rule_mps +$(1).mps: $$(OUTDIR)/$(1).0 + ln -sf $$< $$@ + +$$(OUTDIR)/$(1).0: $$(OUTDIR)/$(1).mp + (cd ${OUTDIR}; mpost `basename $$<`) +endef + +define rules_m_ +$(call rule_mp,,$(1)) +endef + +$(foreach mps,${FIG_BASE},$(eval $(call rule_mps,$$(notdir $(mps))))) + +$(foreach dir,$(DIRS_UNIQUE_SRC),$(eval $(call rules_m_,$(dir)))) + +define chdirs +if [ ! -d ${OUTDIR} ]; then \ + mkdir -p ${OUTDIR}; \ +fi +endef + +.PHONY: dirs + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2007-07-02 11:53:41
|
Revision: 1594 http://svn.sourceforge.net/complement/?rev=1594&view=rev Author: complement Date: 2007-07-02 04:53:38 -0700 (Mon, 02 Jul 2007) Log Message: ----------- useful bibliography Added Paths: ----------- trunk/complement/explore/app/exam/doc/requirements/db-res.bib Added: trunk/complement/explore/app/exam/doc/requirements/db-res.bib =================================================================== --- trunk/complement/explore/app/exam/doc/requirements/db-res.bib (rev 0) +++ trunk/complement/explore/app/exam/doc/requirements/db-res.bib 2007-07-02 11:53:38 UTC (rev 1594) @@ -0,0 +1,186 @@ +@misc { + RFC2616, + author = "R. Fielding and J. Gettys and J. Mogul and H. Frystyk and L. Masinter and P. Leach and T. Berners-Lee", + title = "{RFC} 2616. {H}ypertext {T}ransfer {P}rotocol --- {HTTP}/1.1", + howpublished = "Website", + year = {1999}, + note = "\url{http://www.w3.org/Protocols/rfc2616/rfc2616.html}" +} + +@misc { + RFC2821, + author = "J. Klensin (editor)", + title = "{RFC} 2821. {S}imple {M}ail {T}ransfer {P}rotocol", + howpublished = "Website", + year = {2001}, + note = "\url{http://www.ietf.org/rfc/rfc2821.txt}" +} + +@misc { + RFC1939, + author = "J. Myers and M. Rose", + title = "{RFC} 1939. {P}ost {O}ffice {P}rotocol --- {V}ersion 3", + howpublished = "Website", + year = {1996}, + note = "\url{http://www.ietf.org/rfc/rfc1939.txt}" +} + +@misc { + ActiveDiscPaxos, + author = "Gregory Chockler and Dahlia Malkhi", + title = "{A}ctive {D}isk {P}axos with infinitly many processes", + howpublished = "{PODC} 2002, {J}uly 21-24, 2002, {M}onterey, {C}alifornia, {USA}", + year = {2002}, + note = "\url{http://delivery.acm.org/10.1145/580000/571837/p78-chockler.pdf?key1=571837&key2=2214575711&coll=&dl=acm&CFID=15151515&CFTOKEN=6184618}" +} + +@misc { + DataCentric, + author = "Gregory Chockler and Dahlia Malkhi and Danny Dolev", + title = "{A} {D}ata-{C}entric {A}pproach for {S}calable {S}tate {M}achine {R}eplication", + howpublished = "Website", + year = {2002}, + note = "\url{http://www.cs.huji.ac.il/~dolev/pubs/fudico02.ps}" +} + +@misc { + AquariusDataCentric, + author = "Gregory Chockler and Dahlia Malkhi and Barak Merimovich and David Rabinowitz", + title = "{A}quarius: {A} {D}ata-{C}entric approach to {CORBA} {F}ault-{T}olerance", + howpublished = "Website", + year = {2003}, + note = "\url{http://www.cs.huji.ac.il/labs/danss/aquarius/DOA03.pdf}" +} + +@misc { + MarketFailure, + author = "Ken Birman and Coimbatore Chandersekaran and Danny Dolev and Robbert van Renesse", + title = "{H}ow the {H}idden {H}and {S}hapes the {M}arket for {S}oftware {R}eiliability", + howpublished = "{S}ubmision to: 1st {W}orkshop on {A}pplied {S}oftware {R}eliablity", + year = {2006}, + month = {June}, + note = "\url{http://www.cs.huji.ac.il/~dolev/pubs/MarketFailure.pdf}" +} + +@misc { + PaxosMadePractical, + author = "David Mazi{\'e}res", + title = "{P}axos {M}ade {P}ractical", + howpublished = "Websie", + year = {2007}, + note = "\url{http://www.news.cs.nyu.edu/~jinyang/sp07/papers/paxos.pdf}" +} + +@misc { + GFS, + author = "Sanjay Ghemawat and Howard Gobioff and Shun-Tak Leung", + title = "{T}he {G}oogle {F}ile {S}ystem", + howpublished = "{SOSP'03}, {O}ctober 19-22, 2003, {B}olton {L}anding, {N}ew {Y}ork, {USA}", + year = {2003}, + note = "\url{http://labs.google.com/papers/gfs-sosp2003.pdf}" +} + +@misc { + MapReduce, + author = "Jeffrey Dean and Sanjay Ghemawat", + title = "{M}ap{R}educe: {S}implified {D}ata {P}rocessing on {L}arge {C}lasters", + howpublished = "To appear in {OSDI} 2004", + year = {2004}, + note = "\url{http://labs.google.com/papers/mapreduce-osdi04.pdf}" +} + +@misc { + GeneralizedConsensus, + author = "Leslie Lamport", + title = "{G}eneralized {C}onsesnsus and {P}axos", + howpublished = "Website", + year = {2005}, + note = "\url{ftp://ftp.research.microsoft.com/pub/tr/TR-2005-33.pdf}" +} + +@misc { + SprintPrimaryBackup, + author = "L{\'a}saro Camargos and Fernando Pedone and Rodrigo Schmidt", + title = "{A} {P}rimary-{B}ackup {P}rotocol for {I}n-{M}emory {D}atabase {R}eplication", + howpublished = "5th {IEEE} {I}nternational {S}ymposium on {N}etwork {C}omputing and {A}pplications ({NCA'2006})", + year = {2006}, + note = "\url{http://www.inf.unisi.ch/faculty/pedone/Paper/2006/2006NCA.pdf}" +} + +@misc { + SprintConsensus, + author = "L{\'a}saro Camargos and Edmundo R. M. Madeira1 and Fernando Pedone", + title = "{O}ptimal and {P}ractical {WAB}-{B}ased {C}onsensus {A}lgorithms", + howpublished = "12th {E}uropean {C}onference on {P}arallel {C}omputing ({EuroPar'2006})", + year = {2006}, + note = "\url{http://www.inf.unisi.ch/faculty/pedone/Paper/2006/2006EUROPAR.pdf}" +} + +@misc { + EightFallacies, + author = "Peter Deutsch and James Gosling", + title = "{P}eter {D}eutsch's {E}ight {F}allacies of {D}istributed {C}omputing", + howpublished = "Web", + year = {2001}, + note = "\url{http://www.decillion.us/dmax/Fallacies.html}" +} + +@book { + NDCFF, + title = "{N}etwork {D}istributed {C}omputing: {F}itscapes and {F}allacies", + author = "Max K. Goff", + publisher = "Prentice Hall", + year = {2004}, + month = {April}, + isbn-10 = "0-13-100152-3", + isbn-13 = "978-0-13-100152-7" +} + +@article { + BimodalMulticast, + author = "Kenneth P. Birman and Mark Hayden and Oznur Ozkasap and Zhen Xiao and Mihai Budiu and Yaron Minsky", + title = "{B}imodal {M}ulticast", + journal = "{ACM} {T}ransactions on {C}omputer {S}ystems", + year = {1999}, + volume = {17}, + number = {2}, + pages = {41--88}, + month = "May", + note = "\url{http://www.cs.cornell.edu/ken/bimodal.pdf}" +} + +@article { + Paxos, + author = "Leslie Lamport", + title = "{T}he {P}art-{T}ime {P}arliament", + journal = "{ACM} {T}ransactions on {C}omputer {S}ystems", + year = {1998}, + volume = {16}, + number = {2}, + pages = {133--169}, + month = "May", + note = "\url{http://research.microsoft.com/users/lamport/pubs/lamport-paxos.pdf}" +} + +@article { + LamportClocks, + author = "Leslie Lamport", + title = "{T}ime, {C}locks, and the {O}rdering of {E}vents in a {D}istributed {S}ystem", + journal = "{C}ommunications of the {ACM}", + year = {1978}, + volume = {21}, + number = {7}, + pages = {558--565}, + month = "July", + note = "\url{http://research.microsoft.com/users/lamport/pubs/time-clocks.pdf}" +} + +@misc { + MSPaxos, + author = "Vilmos Bilicki and J{\'o}zsef D{\'a}niel Dombi", + title = "{B}uilding a framework for the consistency management of distributed applications", + howpublished = ".NET Technologies 2006", + year = {2006}, + note = "\url{http://www.inf.u-szeged.hu/~bilickiv/research/consistence/dombi-bilickiv-2006.pdf}" +} + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2007-07-02 11:53:01
|
Revision: 1593 http://svn.sourceforge.net/complement/?rev=1593&view=rev Author: complement Date: 2007-07-02 04:52:59 -0700 (Mon, 02 Jul 2007) Log Message: ----------- prepare for pdflatex and URLs Modified Paths: -------------- trunk/complement/explore/app/exam/doc/requirements/UseCaseSpec.tex Modified: trunk/complement/explore/app/exam/doc/requirements/UseCaseSpec.tex =================================================================== --- trunk/complement/explore/app/exam/doc/requirements/UseCaseSpec.tex 2007-06-29 13:05:13 UTC (rev 1592) +++ trunk/complement/explore/app/exam/doc/requirements/UseCaseSpec.tex 2007-07-02 11:52:59 UTC (rev 1593) @@ -4,12 +4,16 @@ % \usepackage[koi8-r]{inputenc} \usepackage[T1]{fontenc} +\usepackage[american]{babel} +\usepackage[colorlinks,urlcolor=blue,unicode=true]{hyperref} +\usepackage{url} + \usepackage[pdftex]{graphics} -\usepackage{pslatex} +%\usepackage{pslatex} % \usepackage[dvips,final]{epsfig} % \usepackage{cm-super} -\usepackage[colorlinks,urlcolor=blue]{hyperref} -\usepackage{url} +%\usepackage[colorlinks,urlcolor=blue]{hyperref} +%\usepackage{url} \usepackage{rup} %% Define a new 'leo' style for the package that will use a smaller font. @@ -308,4 +312,7 @@ Unit tests may be used for performance measure of key technology solutions. +%\bibliographystyle{plain} +%\bibliography{db-res} + \end{document} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2007-06-29 13:05:15
|
Revision: 1592 http://svn.sourceforge.net/complement/?rev=1592&view=rev Author: complement Date: 2007-06-29 06:05:13 -0700 (Fri, 29 Jun 2007) Log Message: ----------- call destructor, don't free memory here; acquire lock (missed lock) Modified Paths: -------------- trunk/complement/explore/lib/stem/ChangeLog trunk/complement/explore/lib/stem/_EventHandler.cc Modified: trunk/complement/explore/lib/stem/ChangeLog =================================================================== --- trunk/complement/explore/lib/stem/ChangeLog 2007-06-29 12:40:12 UTC (rev 1591) +++ trunk/complement/explore/lib/stem/ChangeLog 2007-06-29 13:05:13 UTC (rev 1592) @@ -1,3 +1,8 @@ +2007-06-29 Petr Ovtchenkov <pt...@is...> + + * _EventHandler.cc: call destructor, don't free memory here; + acquire lock (missed lock). + 2007-03-12 Petr Ovtchenkov <pt...@is...> * EvManager.h, EvManager.cc: trace-related locks, flags and Modified: trunk/complement/explore/lib/stem/_EventHandler.cc =================================================================== --- trunk/complement/explore/lib/stem/_EventHandler.cc 2007-06-29 12:40:12 UTC (rev 1591) +++ trunk/complement/explore/lib/stem/_EventHandler.cc 2007-06-29 13:05:13 UTC (rev 1592) @@ -38,7 +38,7 @@ void EventHandler::Init::__at_fork_child() { if ( *_rcount != 0 ) { - delete EventHandler::_mgr; + EventHandler::_mgr->~EventHandler(); EventHandler::_mgr = new( EventHandler::_mgr ) EvManager(); } } @@ -51,6 +51,8 @@ void EventHandler::Init::_guard( int direction ) { static xmt::MutexRS _init_lock; + + LockerRS lk(_init_lock); static int _count = 0; if ( direction ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2007-06-29 12:40:15
|
Revision: 1591 http://svn.sourceforge.net/complement/?rev=1591&view=rev Author: complement Date: 2007-06-29 05:40:12 -0700 (Fri, 29 Jun 2007) Log Message: ----------- Spinlock was renamed to spinlock, LockerExt to native_scoped_lock Modified Paths: -------------- branches/complement-xmt/explore/include/mt/xmt.h branches/complement-xmt/explore/include/stem/EvManager.h branches/complement-xmt/explore/lib/mt/ChangeLog branches/complement-xmt/explore/lib/stem/EvManager.cc branches/complement-xmt/explore/test/mt/mt_test.cc Modified: branches/complement-xmt/explore/include/mt/xmt.h =================================================================== --- branches/complement-xmt/explore/include/mt/xmt.h 2007-06-29 12:03:13 UTC (rev 1590) +++ branches/complement-xmt/explore/include/mt/xmt.h 2007-06-29 12:40:12 UTC (rev 1591) @@ -372,17 +372,17 @@ #ifdef __FIT_PTHREAD_SPINLOCK // Spinlock-based locks (IEEE Std. 1003.1j-2000) -template <bool RS, bool SCOPE> class __Spinlock; +template <bool RS, bool SCOPE> class __spinlock; template <bool SCOPE> -class __Spinlock<false,SCOPE> : +class __spinlock<false,SCOPE> : public __spinlock_base<SCOPE> { public: - __Spinlock() + __spinlock() { } - ~__Spinlock() + ~__spinlock() { } void lock() @@ -408,17 +408,22 @@ pthread_spin_unlock( &this->_M_lock ); # endif } + + private: + __spinlock( const __spinlock& ) + { } + }; template <bool SCOPE> -class __Spinlock<true,SCOPE> : // Recursive safe +class __spinlock<true,SCOPE> : // Recursive safe public __spinlock_base<SCOPE> { public: - __Spinlock() + __spinlock() { } - ~__Spinlock() + ~__spinlock() { } void lock() @@ -493,6 +498,10 @@ # ifdef __FIT_UITHREADS thread_t _id; # endif + + private: + __spinlock( const __spinlock& ) + { } }; #endif // __FIT_PTHREAD_SPINLOCK @@ -890,8 +899,8 @@ typedef __rw_mutex<false> rw_mutex; #endif // __FIT_RWLOCK #ifdef __FIT_PTHREAD_SPINLOCK -typedef __Spinlock<false,false> Spinlock; -typedef __Spinlock<true,false> SpinlockRS; +typedef __spinlock<false,false> spinlock; +typedef __spinlock<true,false> recursive_spinlock; #endif // __FIT_RWLOCK typedef basic_lock<mutex> scoped_lock; @@ -901,21 +910,21 @@ typedef basic_lock<__rw_mutex<false> > wr_scoped_lock; #endif // __FIT_RWLOCK #ifdef __FIT_PTHREAD_SPINLOCK -typedef basic_lock<Spinlock> LockerSpin; -typedef basic_lock<SpinlockRS> LockerSpinRS; +typedef basic_lock<spinlock> spin_scoped_lock; +typedef basic_lock<recursive_spinlock> recursive_spin_scoped_lock; #endif // __FIT_RWLOCK -class LockerExt +class native_scoped_lock { public: #ifdef _PTHREADS - explicit LockerExt( const pthread_mutex_t& m ) : + explicit native_scoped_lock( const pthread_mutex_t& m ) : #endif #ifdef __FIT_UITHREADS - explicit LockerExt( const mutex_t& m ) : + explicit native_scoped_lock( const mutex_t& m ) : #endif #ifdef __FIT_WIN32THREADS - explicit LockerExt( const CRITICAL_SECTION& m ) : + explicit native_scoped_lock( const CRITICAL_SECTION& m ) : #endif _M_lock( m ) { @@ -930,7 +939,7 @@ #endif } - ~LockerExt() + ~native_scoped_lock() { #ifdef _PTHREADS pthread_mutex_unlock( const_cast<pthread_mutex_t *>(&_M_lock) ); @@ -944,7 +953,7 @@ } private: - LockerExt( const LockerExt& m ) : + native_scoped_lock( const native_scoped_lock& m ) : _M_lock( m._M_lock ) { } #ifdef _PTHREADS Modified: branches/complement-xmt/explore/include/stem/EvManager.h =================================================================== --- branches/complement-xmt/explore/include/stem/EvManager.h 2007-06-29 12:03:13 UTC (rev 1590) +++ branches/complement-xmt/explore/include/stem/EvManager.h 2007-06-29 12:40:12 UTC (rev 1591) @@ -246,7 +246,7 @@ bool _dispatch_stop; xmt::Thread _ev_queue_thr; - xmt::Spinlock _ev_queue_dispatch_guard; + xmt::spinlock _ev_queue_dispatch_guard; xmt::mutex _lock_heap; xmt::mutex _lock_iheap; Modified: branches/complement-xmt/explore/lib/mt/ChangeLog =================================================================== --- branches/complement-xmt/explore/lib/mt/ChangeLog 2007-06-29 12:03:13 UTC (rev 1590) +++ branches/complement-xmt/explore/lib/mt/ChangeLog 2007-06-29 12:40:12 UTC (rev 1591) @@ -8,8 +8,10 @@ recursive_scoped_lock; obsolete LockerSDS removed; * xmt.h: LockerRd renamed to rd_scoped_lock, LockerWr to wr_scoped_lock, - __mutex_rw_base to __rw_mutex_base, mutexRW to rw_mutex. + __mutex_rw_base to __rw_mutex_base, mutexRW to rw_mutex; + * xmt.h: Spinlock was renamed to spinlock, LockerExt to native_scoped_lock. + 2007-06-14 Petr Ovtchenkov <pt...@is...> * xmt.h, xmt.cc, shm.h: step to interface like boost or Modified: branches/complement-xmt/explore/lib/stem/EvManager.cc =================================================================== --- branches/complement-xmt/explore/lib/stem/EvManager.cc 2007-06-29 12:03:13 UTC (rev 1590) +++ branches/complement-xmt/explore/lib/stem/EvManager.cc 2007-06-29 12:40:12 UTC (rev 1591) @@ -72,7 +72,7 @@ bool EvManager::not_finished() { - xmt::LockerSpin _lk( _ev_queue_dispatch_guard ); + xmt::spin_scoped_lock _lk( _ev_queue_dispatch_guard ); return !_dispatch_stop; } Modified: branches/complement-xmt/explore/test/mt/mt_test.cc =================================================================== --- branches/complement-xmt/explore/test/mt/mt_test.cc 2007-06-29 12:03:13 UTC (rev 1590) +++ branches/complement-xmt/explore/test/mt/mt_test.cc 2007-06-29 12:40:12 UTC (rev 1591) @@ -198,7 +198,7 @@ */ #ifdef __FIT_PTHREAD_SPINLOCK -static xmt::Spinlock sl1; +static xmt::spinlock sl1; xmt::Thread::ret_code thr1s( void *p ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2007-06-29 12:03:14
|
Revision: 1590 http://svn.sourceforge.net/complement/?rev=1590&view=rev Author: complement Date: 2007-06-29 05:03:13 -0700 (Fri, 29 Jun 2007) Log Message: ----------- LockerRd renamed to rd_scoped_lock, LockerWr to wr_scoped_lock, __mutex_rw_base to __rw_mutex_base, mutexRW to rw_mutex. Modified Paths: -------------- branches/complement-xmt/explore/include/mt/xmt.h branches/complement-xmt/explore/lib/mt/ChangeLog Modified: branches/complement-xmt/explore/include/mt/xmt.h =================================================================== --- branches/complement-xmt/explore/include/mt/xmt.h 2007-06-29 11:25:32 UTC (rev 1589) +++ branches/complement-xmt/explore/include/mt/xmt.h 2007-06-29 12:03:13 UTC (rev 1590) @@ -57,20 +57,8 @@ #ifdef _REENTRANT # define MT_REENTRANT(point,nm) xmt::scoped_lock nm(point) -# define MT_REENTRANT_RS(point,nm) xmt::LockerRS nm(point) # define MT_LOCK(point) point.lock() # define MT_UNLOCK(point) point.unlock() -# ifdef __FIT_RWLOCK -# define MT_REENTRANT_RD(point,nm) xmt::LockerRd nm(point) -# define MT_REENTRANT_WR(point,nm) xmt::LockerWr nm(point) -# define MT_LOCK_RD(point) point.rdlock() -# define MT_LOCK_WR(point) point.wrlock() -# else // !__FIT_RWLOCK -# define MT_REENTRANT_RD(point,nm) ((void)0) -# define MT_REENTRANT_WR(point,nm) ((void)0) -# define MT_LOCK_RD(point) ((void)0) -# define MT_LOCK_WR(point) ((void)0) -# endif // __FIT_RWLOCK #else // !_REENTRANT @@ -78,10 +66,6 @@ # define MT_REENTRANT_RS(point,nm) ((void)0) # define MT_LOCK(point) ((void)0) # define MT_UNLOCK(point) ((void)0) -# define MT_REENTRANT_RD(point,nm) ((void)0) -# define MT_REENTRANT_WR(point,nm) ((void)0) -# define MT_LOCK_RD(point) ((void)0) -# define MT_LOCK_WR(point) ((void)0) #endif // _REENTRANT @@ -647,10 +631,10 @@ // Read-write mutex: IEEE Std 1003.1, 2001, 2004 Editions template <bool SCOPE> -class __mutex_rw_base +class __rw_mutex_base { public: - __mutex_rw_base() + __rw_mutex_base() { #ifdef _PTHREADS if ( SCOPE ) { @@ -683,7 +667,7 @@ #endif } - ~__mutex_rw_base() + ~__rw_mutex_base() { #ifdef _PTHREADS pthread_rwlock_destroy( &_M_lock ); @@ -699,7 +683,7 @@ } private: - __mutex_rw_base( const __mutex_rw_base& ) + __rw_mutex_base( const __rw_mutex_base& ) { } protected: @@ -717,14 +701,14 @@ }; template <bool SCOPE> -class __mutexRW : - public __mutex_rw_base<SCOPE> +class __rw_mutex : + public __rw_mutex_base<SCOPE> { public: - __mutexRW() + __rw_mutex() { } - ~__mutexRW() + ~__rw_mutex() { } void rdlock() @@ -814,7 +798,7 @@ } private: - __mutexRW( const __mutexRW& ) + __rw_mutex( const __rw_mutex& ) { } }; @@ -903,7 +887,7 @@ typedef __mutex<false,false> mutex; typedef __mutex<true,false> recursive_mutex; #ifdef __FIT_RWLOCK -typedef __mutexRW<false> mutexRW; +typedef __rw_mutex<false> rw_mutex; #endif // __FIT_RWLOCK #ifdef __FIT_PTHREAD_SPINLOCK typedef __Spinlock<false,false> Spinlock; @@ -913,8 +897,8 @@ typedef basic_lock<mutex> scoped_lock; typedef basic_lock<recursive_mutex> recursive_scoped_lock; #ifdef __FIT_RWLOCK -typedef basic_read_lock<__mutexRW<false> > LockerRd; -typedef basic_lock<__mutexRW<false> > LockerWr; +typedef basic_read_lock<__rw_mutex<false> > rd_scoped_lock; +typedef basic_lock<__rw_mutex<false> > wr_scoped_lock; #endif // __FIT_RWLOCK #ifdef __FIT_PTHREAD_SPINLOCK typedef basic_lock<Spinlock> LockerSpin; Modified: branches/complement-xmt/explore/lib/mt/ChangeLog =================================================================== --- branches/complement-xmt/explore/lib/mt/ChangeLog 2007-06-29 11:25:32 UTC (rev 1589) +++ branches/complement-xmt/explore/lib/mt/ChangeLog 2007-06-29 12:03:13 UTC (rev 1590) @@ -7,6 +7,9 @@ * xmt.h: mutexRS renamed to recursive_mutex; LockerRS renamed to recursive_scoped_lock; obsolete LockerSDS removed; + * xmt.h: LockerRd renamed to rd_scoped_lock, LockerWr to wr_scoped_lock, + __mutex_rw_base to __rw_mutex_base, mutexRW to rw_mutex. + 2007-06-14 Petr Ovtchenkov <pt...@is...> * xmt.h, xmt.cc, shm.h: step to interface like boost or This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2007-06-29 11:25:34
|
Revision: 1589 http://svn.sourceforge.net/complement/?rev=1589&view=rev Author: complement Date: 2007-06-29 04:25:32 -0700 (Fri, 29 Jun 2007) Log Message: ----------- mutexRS renamed to recursive_mutex; LockerRS renamed to recursive_scoped_lock; LockerSDS to recursive_scoped_lock Modified Paths: -------------- branches/complement-xmt/explore/include/mt/xmt.h branches/complement-xmt/explore/include/stem/EventHandler.h branches/complement-xmt/explore/lib/mt/ChangeLog branches/complement-xmt/explore/lib/stem/ChangeLog branches/complement-xmt/explore/lib/stem/_EventHandler.cc Modified: branches/complement-xmt/explore/include/mt/xmt.h =================================================================== --- branches/complement-xmt/explore/include/mt/xmt.h 2007-06-29 10:44:29 UTC (rev 1588) +++ branches/complement-xmt/explore/include/mt/xmt.h 2007-06-29 11:25:32 UTC (rev 1589) @@ -58,7 +58,6 @@ # define MT_REENTRANT(point,nm) xmt::scoped_lock nm(point) # define MT_REENTRANT_RS(point,nm) xmt::LockerRS nm(point) -# define MT_REENTRANT_SDS(point,nm) xmt::LockerSDS nm(point) // obsolete, use MT_REENTRANT_RS # define MT_LOCK(point) point.lock() # define MT_UNLOCK(point) point.unlock() # ifdef __FIT_RWLOCK @@ -77,7 +76,6 @@ # define MT_REENTRANT(point,nm) ((void)0) # define MT_REENTRANT_RS(point,nm) ((void)0) -# define MT_REENTRANT_SDS(point,nm) ((void)0) // obsolete, use MT_REENTRANT_RS # define MT_LOCK(point) ((void)0) # define MT_UNLOCK(point) ((void)0) # define MT_REENTRANT_RD(point,nm) ((void)0) @@ -903,8 +901,7 @@ #endif // __FIT_RWLOCK typedef __mutex<false,false> mutex; -typedef __mutex<true,false> mutexRS; -typedef __mutex<true,false> mutexSDS; // obsolete, use instead mutexRS +typedef __mutex<true,false> recursive_mutex; #ifdef __FIT_RWLOCK typedef __mutexRW<false> mutexRW; #endif // __FIT_RWLOCK @@ -913,9 +910,8 @@ typedef __Spinlock<true,false> SpinlockRS; #endif // __FIT_RWLOCK -typedef basic_lock<mutex> scoped_lock; -typedef basic_lock<mutexRS> LockerRS; -typedef basic_lock<mutexRS> LockerSDS; // obsolete, use instead LockerRS +typedef basic_lock<mutex> scoped_lock; +typedef basic_lock<recursive_mutex> recursive_scoped_lock; #ifdef __FIT_RWLOCK typedef basic_read_lock<__mutexRW<false> > LockerRd; typedef basic_lock<__mutexRW<false> > LockerWr; Modified: branches/complement-xmt/explore/include/stem/EventHandler.h =================================================================== --- branches/complement-xmt/explore/include/stem/EventHandler.h 2007-06-29 10:44:29 UTC (rev 1588) +++ branches/complement-xmt/explore/include/stem/EventHandler.h 2007-06-29 11:25:32 UTC (rev 1589) @@ -542,7 +542,7 @@ // See comment near EventHandler::EventHandler() implementation // HistoryContainer& theHistory; HistoryContainer theHistory; - xmt::mutexRS _theHistory_lock; + xmt::recursive_mutex _theHistory_lock; public: @@ -705,7 +705,7 @@ { theEventsTable.Out( out ); } \ virtual bool DispatchTrace( const stem::Event& __e, std::ostream& __s )\ { \ - MT_REENTRANT_SDS( this->_theHistory_lock, _x1 ); \ + xmt::recursive_scoped_lock lk( this->_theHistory_lock ); \ return theEventsTable.DispatchTrace( theHistory.begin(), \ theHistory.end(), __e, __s ); } \ virtual const std::type_info& classtype() const \ @@ -718,12 +718,12 @@ protected: \ virtual bool Dispatch( const stem::Event& __e ) \ { \ - MT_REENTRANT_SDS( this->_theHistory_lock, _x1 ); \ + xmt::recursive_scoped_lock lk( this->_theHistory_lock ); \ return theEventsTable.Dispatch( this, theHistory.begin(), \ theHistory.end(), __e ); } \ virtual bool DispatchStub( const stem::Event& __e ) \ { \ - MT_REENTRANT_SDS( this->_theHistory_lock, _x1 ); \ + xmt::recursive_scoped_lock lk( this->_theHistory_lock ); \ return theEventsTable.DispatchStub( this, theHistory.begin(), \ theHistory.end(), __e ); } \ static __FIT_DECLSPEC evtable_type theEventsTable; \ Modified: branches/complement-xmt/explore/lib/mt/ChangeLog =================================================================== --- branches/complement-xmt/explore/lib/mt/ChangeLog 2007-06-29 10:44:29 UTC (rev 1588) +++ branches/complement-xmt/explore/lib/mt/ChangeLog 2007-06-29 11:25:32 UTC (rev 1589) @@ -2,8 +2,11 @@ * xmt.h, xmt.cc, uid.cc, thr_mgr.cc: replace Locker by scoped_lock. - * shm.h, xmt.h, xmt.cc, thr_mgr.h, uid.cc, time.cc: all Mutex replaced by mutex + * shm.h, xmt.h, xmt.cc, thr_mgr.h, uid.cc, time.cc: all Mutex replaced by mutex; + * xmt.h: mutexRS renamed to recursive_mutex; LockerRS renamed to + recursive_scoped_lock; obsolete LockerSDS removed; + 2007-06-14 Petr Ovtchenkov <pt...@is...> * xmt.h, xmt.cc, shm.h: step to interface like boost or Modified: branches/complement-xmt/explore/lib/stem/ChangeLog =================================================================== --- branches/complement-xmt/explore/lib/stem/ChangeLog 2007-06-29 10:44:29 UTC (rev 1588) +++ branches/complement-xmt/explore/lib/stem/ChangeLog 2007-06-29 11:25:32 UTC (rev 1589) @@ -5,6 +5,10 @@ * EvManager.cc, _EventHandler.cc, EventHandler.h, EvManager.h, Cron.h: all Mutex replaced by mutex + * EventHandler.h, _EventHandler.cc: mutexRS renamed to recursive_mutex; + LockerRS renamed to recursive_scoped_lock; obsolete LockerSDS + replaced by recursive_scoped_lock; + 2007-03-12 Petr Ovtchenkov <pt...@is...> * EvManager.h, EvManager.cc: trace-related locks, flags and Modified: branches/complement-xmt/explore/lib/stem/_EventHandler.cc =================================================================== --- branches/complement-xmt/explore/lib/stem/_EventHandler.cc 2007-06-29 10:44:29 UTC (rev 1588) +++ branches/complement-xmt/explore/lib/stem/_EventHandler.cc 2007-06-29 11:25:32 UTC (rev 1589) @@ -50,7 +50,7 @@ void EventHandler::Init::_guard( int direction ) { - static xmt::mutexRS _init_lock; + static xmt::recursive_mutex _init_lock; static int _count = 0; if ( direction ) { @@ -122,21 +122,21 @@ void EventHandler::PushState( state_type state ) { RemoveState( state ); - MT_REENTRANT_SDS( _theHistory_lock, _x1 ); + xmt::recursive_scoped_lock lk( _theHistory_lock ); theHistory.push_front( state ); } __FIT_DECLSPEC state_type EventHandler::State() const { - MT_REENTRANT_SDS( _theHistory_lock, _x1 ); + xmt::recursive_scoped_lock lk( _theHistory_lock ); return theHistory.front(); } __FIT_DECLSPEC void EventHandler::PushTState( state_type state ) { - MT_REENTRANT_SDS( _theHistory_lock, _x1 ); + xmt::recursive_scoped_lock lk( _theHistory_lock ); theHistory.push_front( ST_TERMINAL ); theHistory.push_front( state ); } @@ -144,7 +144,7 @@ __FIT_DECLSPEC void EventHandler::PopState() { - MT_REENTRANT_SDS( _theHistory_lock, _x1 ); + xmt::recursive_scoped_lock lk( _theHistory_lock ); theHistory.pop_front(); while ( theHistory.front() == ST_TERMINAL ) { theHistory.pop_front(); @@ -154,7 +154,7 @@ __FIT_DECLSPEC void EventHandler::PopState( state_type state ) { - MT_REENTRANT_SDS( _theHistory_lock, _x1 ); + xmt::recursive_scoped_lock lk( _theHistory_lock ); h_iterator hst_i = __find( state ); if ( hst_i != theHistory.end() && *hst_i != ST_TERMINAL ) { theHistory.erase( theHistory.begin(), ++hst_i ); @@ -164,7 +164,7 @@ __FIT_DECLSPEC void EventHandler::RemoveState( state_type state ) { - MT_REENTRANT_SDS( _theHistory_lock, _x1 ); + xmt::recursive_scoped_lock lk( _theHistory_lock ); h_iterator hst_i = __find( state ); if ( hst_i != theHistory.end() && *hst_i != ST_TERMINAL ) { theHistory.erase( hst_i ); @@ -174,7 +174,7 @@ __FIT_DECLSPEC bool EventHandler::isState( state_type state ) const { - MT_REENTRANT_SDS( _theHistory_lock, _x1 ); + xmt::recursive_scoped_lock lk( _theHistory_lock ); const HistoryContainer& hst = theHistory; const_h_iterator hst_i = __find( state ); if ( hst_i != hst.end() && *hst_i != ST_TERMINAL ) { @@ -249,7 +249,7 @@ __FIT_DECLSPEC void EventHandler::TraceStack( ostream& out ) const { - MT_REENTRANT_RS( _theHistory_lock, _x1 ); + xmt::recursive_scoped_lock lk( _theHistory_lock ); const HistoryContainer& hst = theHistory; HistoryContainer::const_iterator hst_i = hst.begin(); while ( hst_i != hst.end() ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2007-06-29 10:44:47
|
Revision: 1588 http://svn.sourceforge.net/complement/?rev=1588&view=rev Author: complement Date: 2007-06-29 03:44:29 -0700 (Fri, 29 Jun 2007) Log Message: ----------- Mutex was replaced by mutex Modified Paths: -------------- branches/complement-xmt/explore/include/mt/shm.h branches/complement-xmt/explore/include/mt/thr_mgr.h branches/complement-xmt/explore/include/mt/xmt.h branches/complement-xmt/explore/include/sockios/sockmgr.h branches/complement-xmt/explore/include/sockios/sockstream branches/complement-xmt/explore/include/stem/Cron.h branches/complement-xmt/explore/include/stem/EvManager.h branches/complement-xmt/explore/include/stem/EventHandler.h branches/complement-xmt/explore/lib/mt/ChangeLog branches/complement-xmt/explore/lib/mt/time.cc branches/complement-xmt/explore/lib/mt/uid.cc branches/complement-xmt/explore/lib/mt/xmt.cc branches/complement-xmt/explore/lib/sockios/ChangeLog branches/complement-xmt/explore/lib/sockios/_sockmgr.cc branches/complement-xmt/explore/lib/sockios/_sockstream.cc branches/complement-xmt/explore/lib/stem/ChangeLog branches/complement-xmt/explore/lib/stem/EvManager.cc branches/complement-xmt/explore/lib/stem/_EventHandler.cc branches/complement-xmt/explore/test/mt/flck.cc branches/complement-xmt/explore/test/mt/lfs.cc branches/complement-xmt/explore/test/mt/mt_test.cc branches/complement-xmt/explore/test/sockios/bytes_in_socket.cc branches/complement-xmt/explore/test/sockios/bytes_in_socket2.cc branches/complement-xmt/explore/test/sockios/close_socket.cc branches/complement-xmt/explore/test/sockios/message.cc branches/complement-xmt/explore/test/sockios/message.h branches/complement-xmt/explore/test/sockios/sockios_test.cc Modified: branches/complement-xmt/explore/include/mt/shm.h =================================================================== --- branches/complement-xmt/explore/include/mt/shm.h 2007-06-29 09:52:17 UTC (rev 1587) +++ branches/complement-xmt/explore/include/mt/shm.h 2007-06-29 10:44:29 UTC (rev 1588) @@ -88,13 +88,13 @@ }; template <> -struct ipc_sharable<xmt::__Mutex<false,true> > +struct ipc_sharable<xmt::__mutex<false,true> > { typedef std::__true_type is_ipc_sharable; }; template <> -struct ipc_sharable<xmt::__Mutex<true,true> > +struct ipc_sharable<xmt::__mutex<true,true> > { typedef std::__true_type is_ipc_sharable; }; @@ -303,7 +303,7 @@ template <class T> void named( const T& obj, int name ) { - xmt::basic_lock<__Mutex<false,true> > lk( _lock ); + xmt::basic_lock<__mutex<false,true> > lk( _lock ); if ( _last == 255 ) { throw std::range_error( "too many named objects" ); } @@ -328,7 +328,7 @@ template <class T> T& named( int name ) { - xmt::basic_lock<__Mutex<false,true> > lk( _lock ); + xmt::basic_lock<__mutex<false,true> > lk( _lock ); for ( int i = 0; _nm_table[i].name != -1; ++i ) { if ( _nm_table[i].name == name ) { ++_nm_table[i].count; @@ -341,7 +341,7 @@ template <class T> const T& named( int name ) const { - xmt::basic_lock<__Mutex<false,true> > lk( _lock ); + xmt::basic_lock<__mutex<false,true> > lk( _lock ); for ( int i = 0; _nm_table[i].name != -1; ++i ) { if ( _nm_table[i].name == name ) { ++_nm_table[i].count; @@ -354,7 +354,7 @@ template <class T> void release( int name ) { - xmt::basic_lock<__Mutex<false,true> > lk( _lock ); + xmt::basic_lock<__mutex<false,true> > lk( _lock ); for ( int i = 0; _nm_table[i].name != -1; ++i ) { if ( _nm_table[i].name == name ) { if ( --_nm_table[i].count == 0 ) { @@ -371,7 +371,7 @@ int count( int name ) const throw() { - xmt::basic_lock<__Mutex<false,true> > lk( _lock ); + xmt::basic_lock<__mutex<false,true> > lk( _lock ); for ( int i = 0; _nm_table[i].name != -1; ++i ) { if ( _nm_table[i].name == name ) { return _nm_table[i].count; @@ -391,7 +391,7 @@ shm_name_mgr& operator =( const shm_name_mgr& ) { return *this; } - xmt::__Mutex<false,true> _lock; + xmt::__mutex<false,true> _lock; struct _name_rec { int name; @@ -420,7 +420,7 @@ { uint64_t _magic; size_type _first; - xmt::__Mutex<false,true> _lock; + xmt::__mutex<false,true> _lock; size_type _nm; }; @@ -463,7 +463,7 @@ if ( p != reinterpret_cast<pointer>(-1) && (force || _seg.count() <= 1) ) { _master *m = reinterpret_cast<_master *>( _seg.address() ); - (&m->_lock)->~__Mutex<false,true>(); + (&m->_lock)->~__mutex<false,true>(); if ( m->_nm != 0 ) { reinterpret_cast<shm_name_mgr<_Inst> *>(reinterpret_cast<char *>(p) + m->_nm)->~shm_name_mgr<_Inst>(); } @@ -480,7 +480,7 @@ if ( p != reinterpret_cast<pointer>(-1) ) { _master *m = reinterpret_cast<_master *>( p ); if ( m->_nm == 0 ) { - xmt::basic_lock<xmt::__Mutex<false,true> > lk( m->_lock ); + xmt::basic_lock<xmt::__mutex<false,true> > lk( m->_lock ); void *nm = _traverse( &m->_first, sizeof(shm_name_mgr<_Inst>) ); m->_nm = reinterpret_cast<char *>(nm) - reinterpret_cast<char *>(p); return *new ( nm ) shm_name_mgr<_Inst>(); @@ -496,7 +496,7 @@ { _master *m = reinterpret_cast<_master *>( _seg.address() ); if ( m != reinterpret_cast<_master *>(-1) ) { - xmt::basic_lock<xmt::__Mutex<false,true> > lk( m->_lock ); + xmt::basic_lock<xmt::__mutex<false,true> > lk( m->_lock ); return _traverse( &m->_first, n ); } @@ -512,8 +512,8 @@ static void init( _master& m ) { m._magic = MAGIC; - new ( &m._lock ) xmt::__Mutex<false,true>(); - xmt::basic_lock<xmt::__Mutex<false,true> > lk( m._lock ); + new ( &m._lock ) xmt::__mutex<false,true>(); + xmt::basic_lock<xmt::__mutex<false,true> > lk( m._lock ); m._first = sizeof( _master ); m._nm = 0; _fheader& h = *new ( reinterpret_cast<char *>(&m) + sizeof(_master) ) _fheader(); @@ -535,7 +535,7 @@ n = max( n + (__align - n % __align) % __align, sizeof(_fheader) ); _master *m = reinterpret_cast<_master *>( _seg.address() ); if ( m != reinterpret_cast<_master *>(-1) && (reinterpret_cast<char *>(p) - reinterpret_cast<char *>(_seg.address())) < (_seg.max_size() + sizeof(_master) + sizeof(_aheader) ) ) { - xmt::basic_lock<xmt::__Mutex<false,true> > lk( m->_lock ); + xmt::basic_lock<xmt::__mutex<false,true> > lk( m->_lock ); _aheader *a = reinterpret_cast<_aheader *>( reinterpret_cast<char *>(p) - sizeof(_aheader) ); size_type off = reinterpret_cast<char *>(p) - reinterpret_cast<char *>(_seg.address()); if ( m->_first == 0 ) { Modified: branches/complement-xmt/explore/include/mt/thr_mgr.h =================================================================== --- branches/complement-xmt/explore/include/mt/thr_mgr.h 2007-06-29 09:52:17 UTC (rev 1587) +++ branches/complement-xmt/explore/include/mt/thr_mgr.h 2007-06-29 10:44:29 UTC (rev 1588) @@ -46,7 +46,7 @@ protected: _Sequence _M_c; - Mutex _lock; + mutex _lock; }; } // namespace xmt Modified: branches/complement-xmt/explore/include/mt/xmt.h =================================================================== --- branches/complement-xmt/explore/include/mt/xmt.h 2007-06-29 09:52:17 UTC (rev 1587) +++ branches/complement-xmt/explore/include/mt/xmt.h 2007-06-29 10:44:29 UTC (rev 1588) @@ -314,23 +314,23 @@ #endif // __FIT_PTHREAD_SPINLOCK -// Portable Mutex implementation. If the parameter RECURSIVE_SAFE -// is true, Mutex will be recursive safe (detect deadlock). +// Portable mutex implementation. If the parameter RECURSIVE_SAFE +// is true, mutex will be recursive safe (detect deadlock). // If RECURSIVE_SAFE is false, implementation may not to be // recursive-safe. -// The SCOPE parameter designate Mutex scope---shared between +// The SCOPE parameter designate mutex scope---shared between // processes (true), or only inside threads of one process (false). // Note, that not all OS support interprocess mutex scope // (for example, Windows and Linux). template <bool RECURSIVE_SAFE, bool SCOPE> -class __Mutex : +class __mutex : public __mutex_base<RECURSIVE_SAFE,SCOPE> { public: - __Mutex() + __mutex() { } - ~__Mutex() + ~__mutex() { } void lock() @@ -378,7 +378,7 @@ } private: - __Mutex( const __Mutex& ) + __mutex( const __mutex& ) { } #ifndef __FIT_WIN32THREADS @@ -531,11 +531,11 @@ // __mutex_base above). template <bool SCOPE> -class __Mutex<true,SCOPE> : // Recursive Safe +class __mutex<true,SCOPE> : // Recursive Safe public __mutex_base<true,SCOPE> { public: - __Mutex() : + __mutex() : _count( 0 ), # ifdef __FIT_UITHREADS _id( __STATIC_CAST(thread_t,-1) ) @@ -545,7 +545,7 @@ # endif { } - ~__Mutex() + ~__mutex() { } void lock() @@ -628,7 +628,7 @@ } private: - __Mutex( const __Mutex& ) + __mutex( const __mutex& ) { } protected: @@ -719,14 +719,14 @@ }; template <bool SCOPE> -class __MutexRW : +class __mutexRW : public __mutex_rw_base<SCOPE> { public: - __MutexRW() + __mutexRW() { } - ~__MutexRW() + ~__mutexRW() { } void rdlock() @@ -816,7 +816,7 @@ } private: - __MutexRW( const __MutexRW& ) + __mutexRW( const __mutexRW& ) { } }; @@ -902,23 +902,23 @@ }; #endif // __FIT_RWLOCK -typedef __Mutex<false,false> Mutex; -typedef __Mutex<true,false> MutexRS; -typedef __Mutex<true,false> MutexSDS; // obsolete, use instead MutexRS +typedef __mutex<false,false> mutex; +typedef __mutex<true,false> mutexRS; +typedef __mutex<true,false> mutexSDS; // obsolete, use instead mutexRS #ifdef __FIT_RWLOCK -typedef __MutexRW<false> MutexRW; +typedef __mutexRW<false> mutexRW; #endif // __FIT_RWLOCK #ifdef __FIT_PTHREAD_SPINLOCK typedef __Spinlock<false,false> Spinlock; typedef __Spinlock<true,false> SpinlockRS; #endif // __FIT_RWLOCK -typedef basic_lock<Mutex> scoped_lock; -typedef basic_lock<MutexRS> LockerRS; -typedef basic_lock<MutexRS> LockerSDS; // obsolete, use instead LockerRS +typedef basic_lock<mutex> scoped_lock; +typedef basic_lock<mutexRS> LockerRS; +typedef basic_lock<mutexRS> LockerSDS; // obsolete, use instead LockerRS #ifdef __FIT_RWLOCK -typedef basic_read_lock<__MutexRW<false> > LockerRd; -typedef basic_lock<__MutexRW<false> > LockerWr; +typedef basic_read_lock<__mutexRW<false> > LockerRd; +typedef basic_lock<__mutexRW<false> > LockerWr; #endif // __FIT_RWLOCK #ifdef __FIT_PTHREAD_SPINLOCK typedef basic_lock<Spinlock> LockerSpin; @@ -1019,7 +1019,7 @@ bool set( bool __v, bool _broadcast = false ) { - basic_lock<__Mutex<false,SCOPE> > _x1( _lock ); + basic_lock<__mutex<false,SCOPE> > _x1( _lock ); bool tmp = _val; _val = __v; @@ -1060,7 +1060,7 @@ _lock.lock(); #endif #if defined(__FIT_UITHREADS) || defined(_PTHREADS) - basic_lock<__Mutex<false,SCOPE> > _x1( _lock ); + basic_lock<__mutex<false,SCOPE> > _x1( _lock ); #endif if ( _val == false ) { #ifdef __FIT_WIN32THREADS @@ -1103,7 +1103,7 @@ return 0; #endif #if defined(_PTHREADS) || defined(__FIT_UITHREADS) - basic_lock<__Mutex<false,SCOPE> > lk( _lock ); + basic_lock<__mutex<false,SCOPE> > lk( _lock ); _val = false; int ret; while ( !_val ) { @@ -1141,7 +1141,7 @@ int signal( bool _broadcast = false ) { - basic_lock<__Mutex<false,SCOPE> > _x1( _lock ); + basic_lock<__mutex<false,SCOPE> > _x1( _lock ); _val = true; #ifdef __FIT_WIN32THREADS @@ -1168,7 +1168,7 @@ #ifdef __FIT_UITHREADS cond_t _cond; #endif - __Mutex<false,SCOPE> _lock; + __mutex<false,SCOPE> _lock; bool _val; private: @@ -1527,7 +1527,7 @@ static alloc_type alloc; static int _idx; // user words index static int _self_idx; // user words index, that word point to self - static Mutex _idx_lock; + static mutex _idx_lock; static thread_key_type& _mt_key; size_t uw_alloc_size; @@ -1548,7 +1548,7 @@ size_t _param_sz; unsigned _flags; size_t _stack_sz; // stack size, if not 0 - // Mutex _llock; + // mutex _llock; friend class Init; // extern "C", wrap for thread_create #ifdef __unix Modified: branches/complement-xmt/explore/include/sockios/sockmgr.h =================================================================== --- branches/complement-xmt/explore/include/sockios/sockmgr.h 2007-06-29 09:52:17 UTC (rev 1587) +++ branches/complement-xmt/explore/include/sockios/sockmgr.h 2007-06-29 10:44:29 UTC (rev 1588) @@ -113,7 +113,7 @@ friend class Init; protected: - xmt::Mutex _fd_lck; + xmt::mutex _fd_lck; xmt::Condition _loop_cnd; }; @@ -288,16 +288,16 @@ _Sequence _M_c; _Compare _M_comp; pfd_equal _pfdcomp; - xmt::Mutex _c_lock; + xmt::mutex _c_lock; _fd_sequence _pfd; int _cfd; // sock_base::socket_type _connect_pool_sequence _conn_pool; xmt::Condition _pool_cnd; - xmt::Mutex _dlock; + xmt::mutex _dlock; timespec _tpop; - xmt::Mutex _flock; + xmt::mutex _flock; bool _follow; xmt::Condition _observer_cnd; @@ -419,7 +419,7 @@ _Sequence _M_c; _Compare _M_comp; in_buf_avail _M_av; - xmt::Mutex _c_lock; + xmt::mutex _c_lock; fd_set _pfdr; fd_set _pfde; Modified: branches/complement-xmt/explore/include/sockios/sockstream =================================================================== --- branches/complement-xmt/explore/include/sockios/sockstream 2007-06-29 09:52:17 UTC (rev 1587) +++ branches/complement-xmt/explore/include/sockios/sockstream 2007-06-29 10:44:29 UTC (rev 1588) @@ -546,8 +546,8 @@ virtual streamsize xsputn(const char_type *s, streamsize n); public: - xmt::Mutex _M_lock_w; // lock for writing - // _STL_mutex_base _M_lock; used for read lock + xmt::mutex _M_lock_w; // lock for writing + private: // Helper functions charT* _bbuf; charT* _ebuf; Modified: branches/complement-xmt/explore/include/stem/Cron.h =================================================================== --- branches/complement-xmt/explore/include/stem/Cron.h 2007-06-29 09:52:17 UTC (rev 1587) +++ branches/complement-xmt/explore/include/stem/Cron.h 2007-06-29 10:44:29 UTC (rev 1588) @@ -165,7 +165,7 @@ std::greater<value_type> > container_type; container_type _M_c; - xmt::Mutex _M_l; + xmt::mutex _M_l; private: DECLARE_RESPONSE_TABLE( Cron, EventHandler ); Modified: branches/complement-xmt/explore/include/stem/EvManager.h =================================================================== --- branches/complement-xmt/explore/include/stem/EvManager.h 2007-06-29 09:52:17 UTC (rev 1587) +++ branches/complement-xmt/explore/include/stem/EvManager.h 2007-06-29 10:44:29 UTC (rev 1588) @@ -248,15 +248,15 @@ xmt::Thread _ev_queue_thr; xmt::Spinlock _ev_queue_dispatch_guard; - xmt::Mutex _lock_heap; - xmt::Mutex _lock_iheap; - xmt::Mutex _lock_xheap; + xmt::mutex _lock_heap; + xmt::mutex _lock_iheap; + xmt::mutex _lock_xheap; - xmt::Mutex _lock_queue; + xmt::mutex _lock_queue; xmt::Condition _cnd_queue; static std::string inv_key_str; - xmt::Mutex _lock_tr; + xmt::mutex _lock_tr; unsigned _trflags; std::ostream *_trs; Modified: branches/complement-xmt/explore/include/stem/EventHandler.h =================================================================== --- branches/complement-xmt/explore/include/stem/EventHandler.h 2007-06-29 09:52:17 UTC (rev 1587) +++ branches/complement-xmt/explore/include/stem/EventHandler.h 2007-06-29 10:44:29 UTC (rev 1588) @@ -542,7 +542,7 @@ // See comment near EventHandler::EventHandler() implementation // HistoryContainer& theHistory; HistoryContainer theHistory; - xmt::MutexRS _theHistory_lock; + xmt::mutexRS _theHistory_lock; public: Modified: branches/complement-xmt/explore/lib/mt/ChangeLog =================================================================== --- branches/complement-xmt/explore/lib/mt/ChangeLog 2007-06-29 09:52:17 UTC (rev 1587) +++ branches/complement-xmt/explore/lib/mt/ChangeLog 2007-06-29 10:44:29 UTC (rev 1588) @@ -2,6 +2,8 @@ * xmt.h, xmt.cc, uid.cc, thr_mgr.cc: replace Locker by scoped_lock. + * shm.h, xmt.h, xmt.cc, thr_mgr.h, uid.cc, time.cc: all Mutex replaced by mutex + 2007-06-14 Petr Ovtchenkov <pt...@is...> * xmt.h, xmt.cc, shm.h: step to interface like boost or Modified: branches/complement-xmt/explore/lib/mt/time.cc =================================================================== --- branches/complement-xmt/explore/lib/mt/time.cc 2007-06-29 09:52:17 UTC (rev 1587) +++ branches/complement-xmt/explore/lib/mt/time.cc 2007-06-29 10:44:29 UTC (rev 1588) @@ -14,7 +14,7 @@ #include <sys/time.h> #ifdef _WIN32 -xmt::Mutex _l; +xmt::mutex _l; #endif std::string calendar_time( time_t t ) Modified: branches/complement-xmt/explore/lib/mt/uid.cc =================================================================== --- branches/complement-xmt/explore/lib/mt/uid.cc 2007-06-29 09:52:17 UTC (rev 1587) +++ branches/complement-xmt/explore/lib/mt/uid.cc 2007-06-29 10:44:29 UTC (rev 1588) @@ -36,7 +36,7 @@ __uid_init::__uid_init() { - static Mutex _lk; + static mutex _lk; scoped_lock lock( _lk ); ifstream f( "/proc/sys/kernel/random/boot_id" ); Modified: branches/complement-xmt/explore/lib/mt/xmt.cc =================================================================== --- branches/complement-xmt/explore/lib/mt/xmt.cc 2007-06-29 09:52:17 UTC (rev 1587) +++ branches/complement-xmt/explore/lib/mt/xmt.cc 2007-06-29 10:44:29 UTC (rev 1588) @@ -88,7 +88,7 @@ # endif #ifdef _PTHREADS -xmt::Mutex _F_lock; +xmt::mutex _F_lock; # define _F_locklock xmt::detail::_F_lock.lock(); # define _F_lockunlock xmt::detail::_F_lock.unlock(); #endif @@ -220,7 +220,7 @@ Thread::alloc_type Thread::alloc; int Thread::_idx = 0; int Thread::_self_idx = 0; -Mutex Thread::_idx_lock; +mutex Thread::_idx_lock; #ifdef __FIT_WIN32THREADS const Thread::thread_id_type Thread::bad_thread_id = INVALID_HANDLE_VALUE; Modified: branches/complement-xmt/explore/lib/sockios/ChangeLog =================================================================== --- branches/complement-xmt/explore/lib/sockios/ChangeLog 2007-06-29 09:52:17 UTC (rev 1587) +++ branches/complement-xmt/explore/lib/sockios/ChangeLog 2007-06-29 10:44:29 UTC (rev 1588) @@ -2,6 +2,9 @@ * sockmgr.cc, sockios_test.cc: replace Locker by scoped_lock. + * sockmgr.h, sockstream, _sockmgr.cc, _sockstream.cc: all + Mutex replaced by mutex + 2007-02-12 Petr Ovtchenkov <pt...@is...> * sockmgr.h, _sockmgr.cc: use Init technique to initialize Modified: branches/complement-xmt/explore/lib/sockios/_sockmgr.cc =================================================================== --- branches/complement-xmt/explore/lib/sockios/_sockmgr.cc 2007-06-29 09:52:17 UTC (rev 1587) +++ branches/complement-xmt/explore/lib/sockios/_sockmgr.cc 2007-06-29 10:44:29 UTC (rev 1588) @@ -51,7 +51,7 @@ void basic_sockmgr::Init::_guard( int direction ) { - static xmt::Mutex _init_lock; + static xmt::mutex _init_lock; static int _count = 0; if ( direction ) { Modified: branches/complement-xmt/explore/lib/sockios/_sockstream.cc =================================================================== --- branches/complement-xmt/explore/lib/sockios/_sockstream.cc 2007-06-29 09:52:17 UTC (rev 1587) +++ branches/complement-xmt/explore/lib/sockios/_sockstream.cc 2007-06-29 10:44:29 UTC (rev 1588) @@ -66,7 +66,7 @@ static int __glob_init_cnt = 0; static int __glob_init_wsock2 = 0; -static xmt::Mutex _SI_lock; +static xmt::mutex _SI_lock; enum { WINDOWS_NT_4, Modified: branches/complement-xmt/explore/lib/stem/ChangeLog =================================================================== --- branches/complement-xmt/explore/lib/stem/ChangeLog 2007-06-29 09:52:17 UTC (rev 1587) +++ branches/complement-xmt/explore/lib/stem/ChangeLog 2007-06-29 10:44:29 UTC (rev 1588) @@ -2,6 +2,9 @@ * NetTransport.cc, EvManager.cc: replace Locker by scoped_lock. + * EvManager.cc, _EventHandler.cc, EventHandler.h, EvManager.h, Cron.h: + all Mutex replaced by mutex + 2007-03-12 Petr Ovtchenkov <pt...@is...> * EvManager.h, EvManager.cc: trace-related locks, flags and Modified: branches/complement-xmt/explore/lib/stem/EvManager.cc =================================================================== --- branches/complement-xmt/explore/lib/stem/EvManager.cc 2007-06-29 09:52:17 UTC (rev 1587) +++ branches/complement-xmt/explore/lib/stem/EvManager.cc 2007-06-29 10:44:29 UTC (rev 1588) @@ -81,7 +81,7 @@ EvManager& me = *reinterpret_cast<EvManager *>(p); xmt::Thread::ret_code rt; rt.iword = 0; - xmt::Mutex& lq = me._lock_queue; + xmt::mutex& lq = me._lock_queue; queue_type& in_ev_queue = me.in_ev_queue; queue_type& out_ev_queue = me.out_ev_queue; Modified: branches/complement-xmt/explore/lib/stem/_EventHandler.cc =================================================================== --- branches/complement-xmt/explore/lib/stem/_EventHandler.cc 2007-06-29 09:52:17 UTC (rev 1587) +++ branches/complement-xmt/explore/lib/stem/_EventHandler.cc 2007-06-29 10:44:29 UTC (rev 1588) @@ -50,7 +50,7 @@ void EventHandler::Init::_guard( int direction ) { - static xmt::MutexRS _init_lock; + static xmt::mutexRS _init_lock; static int _count = 0; if ( direction ) { Modified: branches/complement-xmt/explore/test/mt/flck.cc =================================================================== --- branches/complement-xmt/explore/test/mt/flck.cc 2007-06-29 09:52:17 UTC (rev 1587) +++ branches/complement-xmt/explore/test/mt/flck.cc 2007-06-29 10:44:29 UTC (rev 1588) @@ -27,8 +27,8 @@ using namespace std; static const char *fname = "myfile"; -static Mutex m; -static Mutex b; +static mutex m; +static mutex b; static int cnt = 0; static Thread::ret_code thread_func( void * ) Modified: branches/complement-xmt/explore/test/mt/lfs.cc =================================================================== --- branches/complement-xmt/explore/test/mt/lfs.cc 2007-06-29 09:52:17 UTC (rev 1587) +++ branches/complement-xmt/explore/test/mt/lfs.cc 2007-06-29 10:44:29 UTC (rev 1588) @@ -27,8 +27,8 @@ using namespace std; static const char *fname = "myfile"; -static Mutex m; -static Mutex b; +static mutex m; +static mutex b; static int cnt = 0; static Condition cnd; Modified: branches/complement-xmt/explore/test/mt/mt_test.cc =================================================================== --- branches/complement-xmt/explore/test/mt/mt_test.cc 2007-06-29 09:52:17 UTC (rev 1587) +++ branches/complement-xmt/explore/test/mt/mt_test.cc 2007-06-29 10:44:29 UTC (rev 1588) @@ -131,7 +131,7 @@ * Correct order checked by values of x. */ -static xmt::Mutex m1; +static xmt::mutex m1; xmt::Thread::ret_code thr1( void *p ) { @@ -287,7 +287,7 @@ * */ -xmt::__Mutex<true,false> m2; +xmt::__mutex<true,false> m2; void recursive() { @@ -895,7 +895,7 @@ static int my_thr_cnt = 0; static int my_thr_scnt = 0; -static xmt::Mutex lock; +static xmt::mutex lock; xmt::Thread::ret_code thread_mgr_entry_call( void * ) { Modified: branches/complement-xmt/explore/test/sockios/bytes_in_socket.cc =================================================================== --- branches/complement-xmt/explore/test/sockios/bytes_in_socket.cc 2007-06-29 09:52:17 UTC (rev 1587) +++ branches/complement-xmt/explore/test/sockios/bytes_in_socket.cc 2007-06-29 10:44:29 UTC (rev 1588) @@ -41,7 +41,7 @@ */ extern int port; -extern xmt::Mutex pr_lock; +extern xmt::mutex pr_lock; static Condition cnd; Modified: branches/complement-xmt/explore/test/sockios/bytes_in_socket2.cc =================================================================== --- branches/complement-xmt/explore/test/sockios/bytes_in_socket2.cc 2007-06-29 09:52:17 UTC (rev 1587) +++ branches/complement-xmt/explore/test/sockios/bytes_in_socket2.cc 2007-06-29 10:44:29 UTC (rev 1588) @@ -32,7 +32,7 @@ */ extern int port; -extern xmt::Mutex pr_lock; +extern xmt::mutex pr_lock; static Condition cnd; Modified: branches/complement-xmt/explore/test/sockios/close_socket.cc =================================================================== --- branches/complement-xmt/explore/test/sockios/close_socket.cc 2007-06-29 09:52:17 UTC (rev 1587) +++ branches/complement-xmt/explore/test/sockios/close_socket.cc 2007-06-29 10:44:29 UTC (rev 1588) @@ -41,7 +41,7 @@ */ extern int port; -extern xmt::Mutex pr_lock; +extern xmt::mutex pr_lock; class ConnectionProcessor3 // dummy variant { Modified: branches/complement-xmt/explore/test/sockios/message.cc =================================================================== --- branches/complement-xmt/explore/test/sockios/message.cc 2007-06-29 09:52:17 UTC (rev 1587) +++ branches/complement-xmt/explore/test/sockios/message.cc 2007-06-29 10:44:29 UTC (rev 1588) @@ -33,7 +33,7 @@ int port = 2048; -xmt::Mutex pr_lock; +xmt::mutex pr_lock; namespace test_area { Modified: branches/complement-xmt/explore/test/sockios/message.h =================================================================== --- branches/complement-xmt/explore/test/sockios/message.h 2007-06-29 09:52:17 UTC (rev 1587) +++ branches/complement-xmt/explore/test/sockios/message.h 2007-06-29 10:44:29 UTC (rev 1588) @@ -37,7 +37,7 @@ extern int port; -extern xmt::Mutex pr_lock; +extern xmt::mutex pr_lock; #define OUT_MSG(msg) pr_lock.lock(); cerr << msg << endl; pr_lock.unlock() Modified: branches/complement-xmt/explore/test/sockios/sockios_test.cc =================================================================== --- branches/complement-xmt/explore/test/sockios/sockios_test.cc 2007-06-29 09:52:17 UTC (rev 1587) +++ branches/complement-xmt/explore/test/sockios/sockios_test.cc 2007-06-29 10:44:29 UTC (rev 1588) @@ -73,12 +73,12 @@ static int get_visits() { xmt::scoped_lock lk(lock); return visits; } - static xmt::Mutex lock; + static xmt::mutex lock; static int cnt; static int visits; }; -xmt::Mutex Cnt::lock; +xmt::mutex Cnt::lock; int Cnt::cnt = 0; int Cnt::visits = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2007-06-29 09:52:20
|
Revision: 1587 http://svn.sourceforge.net/complement/?rev=1587&view=rev Author: complement Date: 2007-06-29 02:52:17 -0700 (Fri, 29 Jun 2007) Log Message: ----------- replace Locker by scoped_lock Modified Paths: -------------- branches/complement-xmt/explore/include/mt/xmt.h branches/complement-xmt/explore/include/sockios/sockmgr.cc branches/complement-xmt/explore/lib/mt/ChangeLog branches/complement-xmt/explore/lib/mt/thr_mgr.cc branches/complement-xmt/explore/lib/mt/uid.cc branches/complement-xmt/explore/lib/sockios/ChangeLog branches/complement-xmt/explore/lib/stem/ChangeLog branches/complement-xmt/explore/lib/stem/EvManager.cc branches/complement-xmt/explore/lib/stem/NetTransport.cc branches/complement-xmt/explore/test/sockios/sockios_test.cc Modified: branches/complement-xmt/explore/include/mt/xmt.h =================================================================== --- branches/complement-xmt/explore/include/mt/xmt.h 2007-06-14 06:47:19 UTC (rev 1586) +++ branches/complement-xmt/explore/include/mt/xmt.h 2007-06-29 09:52:17 UTC (rev 1587) @@ -56,7 +56,7 @@ #ifdef _REENTRANT -# define MT_REENTRANT(point,nm) xmt::Locker nm(point) +# define MT_REENTRANT(point,nm) xmt::scoped_lock nm(point) # define MT_REENTRANT_RS(point,nm) xmt::LockerRS nm(point) # define MT_REENTRANT_SDS(point,nm) xmt::LockerSDS nm(point) // obsolete, use MT_REENTRANT_RS # define MT_LOCK(point) point.lock() @@ -913,7 +913,6 @@ typedef __Spinlock<true,false> SpinlockRS; #endif // __FIT_RWLOCK -typedef basic_lock<Mutex> Locker; typedef basic_lock<Mutex> scoped_lock; typedef basic_lock<MutexRS> LockerRS; typedef basic_lock<MutexRS> LockerSDS; // obsolete, use instead LockerRS @@ -1567,7 +1566,7 @@ MT_LOCK( _lock ); #endif #if defined(__FIT_UITHREADS) || defined(_PTHREADS) - MT_REENTRANT( _lock, _x1 ); + scoped_lock _x1( _lock ); #endif if ( _val == false ) { #ifdef __FIT_WIN32THREADS @@ -1623,7 +1622,7 @@ MT_LOCK( _lock ); #endif #if defined(__FIT_UITHREADS) || defined(_PTHREADS) - MT_REENTRANT( _lock, _x1 ); + scoped_lock _x1( _lock ); #endif if ( _val == false ) { #ifdef WIN32 @@ -1699,7 +1698,7 @@ return 0; #endif #ifdef _PTHREADS - MT_REENTRANT( _lock, _x1 ); // ?? + scoped_lock _x1( _lock ); // ?? _val = false; int ret = pthread_cond_timedwait( &_cond, &_lock._M_lock, abstime ); if ( ret == ETIMEDOUT ) { @@ -1708,7 +1707,7 @@ return ret; #endif // _PTHREADS #ifdef __FIT_UITHREADS - MT_REENTRANT( _lock, _x1 ); + scoped_lock _x1( _lock ); _val = false; int ret; while ( !_val ) { Modified: branches/complement-xmt/explore/include/sockios/sockmgr.cc =================================================================== --- branches/complement-xmt/explore/include/sockios/sockmgr.cc 2007-06-14 06:47:19 UTC (rev 1586) +++ branches/complement-xmt/explore/include/sockios/sockmgr.cc 2007-06-29 09:52:17 UTC (rev 1587) @@ -100,7 +100,7 @@ // cerr << __FILE__ << ":" << __LINE__ << endl; // } if ( j->revents != 0 ) { - xmt::Locker _l( _c_lock ); + xmt::scoped_lock _l( _c_lock ); // We should distinguish closed socket from income message typename container_type::iterator i = find_if( _M_c.begin(), _M_c.end(), bind2nd( _M_comp, j->fd ) ); @@ -217,7 +217,7 @@ } try { - xmt::Locker _l( _c_lock ); + xmt::scoped_lock _l( _c_lock ); _M_c.push_back( _Connect() ); _M_c.back().open( _sd, addr.any ); _Connect *cl_new = &_M_c.back(); @@ -418,7 +418,7 @@ me->_conn_pool.erase( std::remove( me->_conn_pool.begin(), me->_conn_pool.end(), c ), me->_conn_pool.end() ); me->_dlock.unlock(); - xmt::Locker _l( me->_c_lock ); + xmt::scoped_lock _l( me->_c_lock ); me->_M_c.erase( c ); } } Modified: branches/complement-xmt/explore/lib/mt/ChangeLog =================================================================== --- branches/complement-xmt/explore/lib/mt/ChangeLog 2007-06-14 06:47:19 UTC (rev 1586) +++ branches/complement-xmt/explore/lib/mt/ChangeLog 2007-06-29 09:52:17 UTC (rev 1587) @@ -1,3 +1,7 @@ +2007-06-29 Petr Ovtchenkov <pt...@is...> + + * xmt.h, xmt.cc, uid.cc, thr_mgr.cc: replace Locker by scoped_lock. + 2007-06-14 Petr Ovtchenkov <pt...@is...> * xmt.h, xmt.cc, shm.h: step to interface like boost or Modified: branches/complement-xmt/explore/lib/mt/thr_mgr.cc =================================================================== --- branches/complement-xmt/explore/lib/mt/thr_mgr.cc 2007-06-14 06:47:19 UTC (rev 1586) +++ branches/complement-xmt/explore/lib/mt/thr_mgr.cc 2007-06-29 09:52:17 UTC (rev 1587) @@ -121,7 +121,7 @@ __FIT_DECLSPEC void ThreadMgr::launch( Thread::entrance_type entrance, const void *p, size_t psz, unsigned flags, size_t stack_sz ) { - Locker lk( _lock ); + scoped_lock lk( _lock ); _M_c.erase( remove_if( _M_c.begin(), _M_c.end(), rm_if_bad_thread() ), _M_c.end() ); // Thread *t = new Thread( entrance, p, psz, flags, stack_sz ); // cerr << (void *)t << " created\n"; @@ -132,13 +132,13 @@ __FIT_DECLSPEC void ThreadMgr::garbage_collector() { - Locker lk( _lock ); + scoped_lock lk( _lock ); _M_c.erase( remove_if( _M_c.begin(), _M_c.end(), rm_if_bad_thread() ), _M_c.end() ); } ThreadMgr::container_type::size_type ThreadMgr::size() const { - Locker lk( _lock ); + scoped_lock lk( _lock ); // ThreadMgr::container_type::size_type sz = count_if( _M_c.begin(), _M_c.end(), good_thread() ); // cerr << "Sz: " << sz << endl; @@ -148,7 +148,7 @@ __FIT_DECLSPEC void ThreadMgr::signal( int sig ) { // cerr << "Signal!" << endl; - Locker lk( _lock ); + scoped_lock lk( _lock ); for_each( _M_c.begin(), _M_c.end(), bind2nd( thread_signal(), sig ) ); } Modified: branches/complement-xmt/explore/lib/mt/uid.cc =================================================================== --- branches/complement-xmt/explore/lib/mt/uid.cc 2007-06-14 06:47:19 UTC (rev 1586) +++ branches/complement-xmt/explore/lib/mt/uid.cc 2007-06-29 09:52:17 UTC (rev 1587) @@ -38,7 +38,7 @@ { static Mutex _lk; - Locker lock( _lk ); + scoped_lock lock( _lk ); ifstream f( "/proc/sys/kernel/random/boot_id" ); string tmp; Modified: branches/complement-xmt/explore/lib/sockios/ChangeLog =================================================================== --- branches/complement-xmt/explore/lib/sockios/ChangeLog 2007-06-14 06:47:19 UTC (rev 1586) +++ branches/complement-xmt/explore/lib/sockios/ChangeLog 2007-06-29 09:52:17 UTC (rev 1587) @@ -1,3 +1,7 @@ +2007-06-29 Petr Ovtchenkov <pt...@is...> + + * sockmgr.cc, sockios_test.cc: replace Locker by scoped_lock. + 2007-02-12 Petr Ovtchenkov <pt...@is...> * sockmgr.h, _sockmgr.cc: use Init technique to initialize Modified: branches/complement-xmt/explore/lib/stem/ChangeLog =================================================================== --- branches/complement-xmt/explore/lib/stem/ChangeLog 2007-06-14 06:47:19 UTC (rev 1586) +++ branches/complement-xmt/explore/lib/stem/ChangeLog 2007-06-29 09:52:17 UTC (rev 1587) @@ -1,3 +1,7 @@ +2007-06-29 Petr Ovtchenkov <pt...@is...> + + * NetTransport.cc, EvManager.cc: replace Locker by scoped_lock. + 2007-03-12 Petr Ovtchenkov <pt...@is...> * EvManager.h, EvManager.cc: trace-related locks, flags and Modified: branches/complement-xmt/explore/lib/stem/EvManager.cc =================================================================== --- branches/complement-xmt/explore/lib/stem/EvManager.cc 2007-06-14 06:47:19 UTC (rev 1586) +++ branches/complement-xmt/explore/lib/stem/EvManager.cc 2007-06-29 09:52:17 UTC (rev 1587) @@ -111,19 +111,19 @@ { addr_type id; { - Locker lk( _lock_heap ); + scoped_lock lk( _lock_heap ); id = create_unique(); heap[id] = object; } { - Locker lk( _lock_xheap ); + scoped_lock lk( _lock_xheap ); gaddr_type& gaddr = _ex_heap[id]; gaddr.hid = xmt::hostid(); gaddr.pid = xmt::getpid(); gaddr.addr = id; } - Locker lk( _lock_iheap ); + scoped_lock lk( _lock_iheap ); iheap[id] = info; return id; @@ -142,21 +142,21 @@ if ( (id & extbit) ) { return badaddr; } else { - Locker _x1( _lock_heap ); + scoped_lock _x1( _lock_heap ); if ( unsafe_is_avail( id ) ) { return badaddr; } heap[id] = object; } { - Locker lk( _lock_xheap ); + scoped_lock lk( _lock_xheap ); gaddr_type& gaddr = _ex_heap[id]; gaddr.hid = xmt::hostid(); gaddr.pid = xmt::getpid(); gaddr.addr = id; } - Locker _x1( _lock_iheap ); + scoped_lock _x1( _lock_iheap ); iheap[id] = info; return id; @@ -176,14 +176,14 @@ { addr_type id; { - Locker _x1( _lock_xheap ); + scoped_lock _x1( _lock_xheap ); id = create_unique_x(); _ex_heap[id] = addr; _tr_heap.insert( make_pair( addr, make_pair( id, tr ) ) ); _ch_heap.insert( make_pair( tr.link, addr ) ); } { - Locker _x1( _lock_iheap ); + scoped_lock _x1( _lock_iheap ); iheap[id] = info; } @@ -205,13 +205,13 @@ addr_type id; if ( addr.hid == xmt::hostid() && addr.pid == xmt::getpid() ) { // local if ( addr.addr & extbit ) { // may be transit object - Locker lk( _lock_xheap ); + scoped_lock lk( _lock_xheap ); pair<uuid_tr_heap_type::const_iterator,uuid_tr_heap_type::const_iterator> range = _tr_heap.equal_range( addr ); if ( range.first != range.second ) { // transport present return min_element( range.first, range.second, tr_compare )->second.first; } } else { // may be local object - Locker lk( _lock_heap ); + scoped_lock lk( _lock_heap ); local_heap_type::const_iterator i = heap.find( addr.addr ); if ( i != heap.end() ) { return i->first; @@ -219,7 +219,7 @@ } return badaddr; // don't know what I can made } else { // foreign object - Locker lk( _lock_xheap ); + scoped_lock lk( _lock_xheap ); pair<uuid_tr_heap_type::const_iterator,uuid_tr_heap_type::const_iterator> tr_range = _tr_heap.equal_range( addr ); if ( tr_range.first != tr_range.second ) { // transport present return min_element( tr_range.first, tr_range.second, tr_compare )->second.first; @@ -239,7 +239,7 @@ _ex_heap[id] = addr; } { - Locker lk( _lock_iheap ); + scoped_lock lk( _lock_iheap ); iheap[id] = info; } return id; @@ -256,7 +256,7 @@ bool EvManager::Unsubscribe( addr_type id ) { if ( (id & extbit) ) { - Locker _x1( _lock_xheap ); + scoped_lock _x1( _lock_xheap ); gaddr_type& addr = _ex_heap[id]; pair<uuid_tr_heap_type::iterator,uuid_tr_heap_type::iterator> range = _tr_heap.equal_range( addr ); @@ -277,12 +277,12 @@ } _ex_heap.erase( id ); } else { - Locker _x1( _lock_heap ); + scoped_lock _x1( _lock_heap ); heap.erase( id ); // Notify remotes? } - Locker _x1( _lock_iheap ); + scoped_lock _x1( _lock_iheap ); iheap.erase( id ); return true; @@ -294,7 +294,7 @@ if ( addr.hid == xmt::hostid() && addr.pid == xmt::getpid() ) { // this host, this process if ( (addr.addr & extbit) == 0 ) { // looks like local object - Locker _x1( _lock_heap ); + scoped_lock _x1( _lock_heap ); local_heap_type::const_iterator l = heap.find( addr.addr ); if ( l != heap.end() ) { return addr.addr; // l->first @@ -307,7 +307,7 @@ // peer don't know host ids, used as access to 'standard' services and initial // communication if ( (addr.addr & extbit) == 0 && addr.addr <= _low ) { - Locker _x1( _lock_heap ); + scoped_lock _x1( _lock_heap ); local_heap_type::const_iterator l = heap.find( addr.addr ); if ( l != heap.end() ) { return addr.addr; // l->first @@ -318,7 +318,7 @@ } #endif - Locker _x1( _lock_xheap ); + scoped_lock _x1( _lock_xheap ); pair<uuid_tr_heap_type::const_iterator,uuid_tr_heap_type::const_iterator> range = _tr_heap.equal_range( addr ); if ( range.first != range.second ) { // transport present return min_element( range.first, range.second, tr_compare )->second.first; @@ -329,7 +329,7 @@ __FIT_DECLSPEC gaddr_type EvManager::reflect( addr_type addr ) const { - Locker lk( _lock_xheap ); + scoped_lock lk( _lock_xheap ); ext_uuid_heap_type::const_iterator i = _ex_heap.find( addr ); if ( i != _ex_heap.end() ) { return i->second; @@ -340,45 +340,45 @@ __FIT_DECLSPEC void EvManager::Remove( void *channel ) { - Locker _x1( _lock_xheap ); - Locker _x2( _lock_iheap ); + scoped_lock _x1( _lock_xheap ); + scoped_lock _x2( _lock_iheap ); unsafe_Remove( channel ); } void EvManager::settrf( unsigned f ) { - Locker _x1( _lock_tr ); + scoped_lock _x1( _lock_tr ); _trflags |= f; } void EvManager::unsettrf( unsigned f ) { - Locker _x1( _lock_tr ); + scoped_lock _x1( _lock_tr ); _trflags &= (0xffffffff & ~f); } void EvManager::resettrf( unsigned f ) { - Locker _x1( _lock_tr ); + scoped_lock _x1( _lock_tr ); _trflags = f; } void EvManager::cleantrf() { - Locker _x1( _lock_tr ); + scoped_lock _x1( _lock_tr ); _trflags = 0; } unsigned EvManager::trflags() const { - Locker _x1( _lock_tr ); + scoped_lock _x1( _lock_tr ); return _trflags; } void EvManager::settrs( std::ostream *s ) { - Locker _x1( _lock_tr ); + scoped_lock _x1( _lock_tr ); _trs = s; } @@ -407,7 +407,7 @@ __FIT_DECLSPEC const detail::transport& EvManager::transport( addr_type id ) const { - Locker _x1( _lock_xheap ); + scoped_lock _x1( _lock_xheap ); if ( (id & extbit) != 0 ) { ext_uuid_heap_type::const_iterator i = _ex_heap.find( id ); if ( i == _ex_heap.end() ) { @@ -470,7 +470,7 @@ if ( !reinterpret_cast<NetTransport_base *>(link)->push( e, gaddr_dst, gaddr_src) ) { #ifdef __FIT_STEM_TRACE try { - Locker lk(_lock_tr); + scoped_lock lk(_lock_tr); if ( _trs != 0 && _trs->good() && (_trflags & tracenet) ) { *_trs << "Remove net channel " << link << endl; } @@ -493,7 +493,7 @@ catch ( std::logic_error& err ) { // #ifdef __FIT_STEM_TRACE try { - Locker lk(_lock_tr); + scoped_lock lk(_lock_tr); if ( _trs != 0 && _trs->good() && (_trflags & tracefault) ) { *_trs << err.what() << " " << __FILE__ << ":" << __LINE__ << endl; @@ -507,7 +507,7 @@ catch ( std::runtime_error& err ) { // #ifdef __FIT_STEM_TRACE try { - Locker lk(_lock_tr); + scoped_lock lk(_lock_tr); if ( _trs != 0 && _trs->good() && (_trflags & tracefault) ) { *_trs << err.what() << " " << __FILE__ << ":" << __LINE__ << endl; @@ -521,7 +521,7 @@ catch ( ... ) { // #ifdef __FIT_STEM_TRACE try { - Locker lk(_lock_tr); + scoped_lock lk(_lock_tr); if ( _trs != 0 && _trs->good() && (_trflags & tracefault) ) { *_trs << "Unknown, uncatched exception: " << __FILE__ << ":" << __LINE__ << endl; @@ -545,7 +545,7 @@ try { #ifdef __FIT_STEM_TRACE try { - Locker lk(_lock_tr); + scoped_lock lk(_lock_tr); if ( _trs != 0 && _trs->good() && (_trflags & tracedispatch) ) { *_trs << object->classtype().name() << " (" << object << ")\n"; @@ -560,7 +560,7 @@ } catch ( std::logic_error& err ) { try { - Locker lk(_lock_tr); + scoped_lock lk(_lock_tr); if ( _trs != 0 && _trs->good() && (_trflags & tracefault) ) { *_trs << err.what() << "\n" << object->classtype().name() << " (" << object << ")\n"; @@ -573,7 +573,7 @@ } catch ( ... ) { try { - Locker lk(_lock_tr); + scoped_lock lk(_lock_tr); if ( _trs != 0 && _trs->good() && (_trflags & tracefault) ) { *_trs << "Unknown, uncatched exception during process:\n" << object->classtype().name() << " (" << object << ")\n"; @@ -588,7 +588,7 @@ catch ( std::logic_error& err ) { // #ifdef __FIT_STEM_TRACE try { - Locker lk(_lock_tr); + scoped_lock lk(_lock_tr); if ( _trs != 0 && _trs->good() && (_trflags & tracefault) ) { *_trs << err.what() << "\n" << __FILE__ << ":" << __LINE__ << endl; @@ -602,7 +602,7 @@ catch ( std::runtime_error& err ) { // #ifdef __FIT_STEM_TRACE try { - Locker lk(_lock_tr); + scoped_lock lk(_lock_tr); if ( _trs != 0 && _trs->good() && (_trflags & tracefault) ) { *_trs << err.what() << " " << __FILE__ << ":" << __LINE__ << endl; @@ -616,7 +616,7 @@ catch ( ... ) { // #ifdef __FIT_STEM_TRACE try { - Locker lk(_lock_tr); + scoped_lock lk(_lock_tr); if ( _trs != 0 && _trs->good() && (_trflags & tracefault) ) { *_trs << "Unknown, uncatched exception: " << __FILE__ << ":" << __LINE__ << endl; @@ -690,7 +690,7 @@ s << hex << showbase; { - Locker lk( _lock_heap ); + scoped_lock lk( _lock_heap ); for ( local_heap_type::const_iterator i = heap.begin(); i != heap.end(); ++i ) { s << i->first << "\t=> " << i->second << "\n"; @@ -699,7 +699,7 @@ s << "\nInfo map:\n"; { - Locker lk( _lock_iheap ); + scoped_lock lk( _lock_iheap ); for ( info_heap_type::const_iterator i = iheap.begin(); i != iheap.end(); ++i ) { s << i->first << "\t=> '" << i->second << "'\n"; @@ -707,7 +707,7 @@ } { - Locker lk( _lock_xheap ); + scoped_lock lk( _lock_xheap ); s << "\nExternal address map:\n"; for ( ext_uuid_heap_type::const_iterator i = _ex_heap.begin(); i != _ex_heap.end(); ++i ) { Modified: branches/complement-xmt/explore/lib/stem/NetTransport.cc =================================================================== --- branches/complement-xmt/explore/lib/stem/NetTransport.cc 2007-06-14 06:47:19 UTC (rev 1586) +++ branches/complement-xmt/explore/lib/stem/NetTransport.cc 2007-06-29 09:52:17 UTC (rev 1587) @@ -362,7 +362,7 @@ while ( me.pop( ev, dst, src ) ) { #ifdef __FIT_STEM_TRACE try { - xmt::Locker lk(manager()->_lock_tr); + xmt::scoped_lock lk(manager()->_lock_tr); if ( manager()->_trs != 0 && manager()->_trs->good() && (manager()->_trflags & EvManager::tracenet) ) { *manager()->_trs << "Pid/ppid: " << xmt::getpid() << "/" << xmt::getppid() << "\n"; manager()->dump( *manager()->_trs ) << endl; @@ -375,7 +375,7 @@ if ( xdst == badaddr ) { #ifdef __FIT_STEM_TRACE try { - xmt::Locker lk(manager()->_lock_tr); + xmt::scoped_lock lk(manager()->_lock_tr); if ( manager()->_trs != 0 && manager()->_trs->good() && (manager()->_trflags & (EvManager::tracefault)) ) { *manager()->_trs << __FILE__ << ":" << __LINE__ << " (" @@ -398,7 +398,7 @@ } #ifdef __FIT_STEM_TRACE try { - xmt::Locker lk(manager()->_lock_tr); + xmt::scoped_lock lk(manager()->_lock_tr); if ( manager()->_trs != 0 && manager()->_trs->good() && (manager()->_trflags & (EvManager::tracenet)) ) { *manager()->_trs << __FILE__ << ":" << __LINE__ << endl; } Modified: branches/complement-xmt/explore/test/sockios/sockios_test.cc =================================================================== --- branches/complement-xmt/explore/test/sockios/sockios_test.cc 2007-06-14 06:47:19 UTC (rev 1586) +++ branches/complement-xmt/explore/test/sockios/sockios_test.cc 2007-06-29 09:52:17 UTC (rev 1587) @@ -59,10 +59,10 @@ { public: Cnt( sockstream& ) - { xmt::Locker lk(lock); ++cnt; ++visits; } + { xmt::scoped_lock lk(lock); ++cnt; ++visits; } ~Cnt() - { xmt::Locker lk(lock); --cnt; } + { xmt::scoped_lock lk(lock); --cnt; } void connect( sockstream& ) { } @@ -71,7 +71,7 @@ { } static int get_visits() - { xmt::Locker lk(lock); return visits; } + { xmt::scoped_lock lk(lock); return visits; } static xmt::Mutex lock; static int cnt; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2007-06-14 06:47:35
|
Revision: 1586 http://svn.sourceforge.net/complement/?rev=1586&view=rev Author: complement Date: 2007-06-13 23:47:19 -0700 (Wed, 13 Jun 2007) Log Message: ----------- step to interface like boost or http://www.open-std.org/jtc1/sc22/WG21/docs/papers/2007/n2178.html; Locker* changed to basic_lock or basic_read_lock, internal lock flag added, lock/unlock methods added to basic_*_lock and exception lock_error added too. Modified Paths: -------------- branches/complement-xmt/explore/include/mt/shm.h branches/complement-xmt/explore/include/mt/xmt.h branches/complement-xmt/explore/lib/mt/ChangeLog branches/complement-xmt/explore/lib/mt/xmt.cc Modified: branches/complement-xmt/explore/include/mt/shm.h =================================================================== --- branches/complement-xmt/explore/include/mt/shm.h 2007-06-08 19:40:15 UTC (rev 1585) +++ branches/complement-xmt/explore/include/mt/shm.h 2007-06-14 06:47:19 UTC (rev 1586) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <07/02/07 10:11:34 ptr> +// -*- C++ -*- Time-stamp: <07/06/14 10:16:59 ptr> /* * Copyright (c) 2006, 2007 @@ -303,7 +303,7 @@ template <class T> void named( const T& obj, int name ) { - xmt::__Locker<__Mutex<false,true> > lk( _lock ); + xmt::basic_lock<__Mutex<false,true> > lk( _lock ); if ( _last == 255 ) { throw std::range_error( "too many named objects" ); } @@ -328,7 +328,7 @@ template <class T> T& named( int name ) { - xmt::__Locker<__Mutex<false,true> > lk( _lock ); + xmt::basic_lock<__Mutex<false,true> > lk( _lock ); for ( int i = 0; _nm_table[i].name != -1; ++i ) { if ( _nm_table[i].name == name ) { ++_nm_table[i].count; @@ -341,7 +341,7 @@ template <class T> const T& named( int name ) const { - xmt::__Locker<__Mutex<false,true> > lk( _lock ); + xmt::basic_lock<__Mutex<false,true> > lk( _lock ); for ( int i = 0; _nm_table[i].name != -1; ++i ) { if ( _nm_table[i].name == name ) { ++_nm_table[i].count; @@ -354,7 +354,7 @@ template <class T> void release( int name ) { - xmt::__Locker<__Mutex<false,true> > lk( _lock ); + xmt::basic_lock<__Mutex<false,true> > lk( _lock ); for ( int i = 0; _nm_table[i].name != -1; ++i ) { if ( _nm_table[i].name == name ) { if ( --_nm_table[i].count == 0 ) { @@ -371,7 +371,7 @@ int count( int name ) const throw() { - xmt::__Locker<__Mutex<false,true> > lk( _lock ); + xmt::basic_lock<__Mutex<false,true> > lk( _lock ); for ( int i = 0; _nm_table[i].name != -1; ++i ) { if ( _nm_table[i].name == name ) { return _nm_table[i].count; @@ -480,7 +480,7 @@ if ( p != reinterpret_cast<pointer>(-1) ) { _master *m = reinterpret_cast<_master *>( p ); if ( m->_nm == 0 ) { - xmt::__Locker<xmt::__Mutex<false,true> > lk( m->_lock ); + xmt::basic_lock<xmt::__Mutex<false,true> > lk( m->_lock ); void *nm = _traverse( &m->_first, sizeof(shm_name_mgr<_Inst>) ); m->_nm = reinterpret_cast<char *>(nm) - reinterpret_cast<char *>(p); return *new ( nm ) shm_name_mgr<_Inst>(); @@ -496,7 +496,7 @@ { _master *m = reinterpret_cast<_master *>( _seg.address() ); if ( m != reinterpret_cast<_master *>(-1) ) { - xmt::__Locker<xmt::__Mutex<false,true> > lk( m->_lock ); + xmt::basic_lock<xmt::__Mutex<false,true> > lk( m->_lock ); return _traverse( &m->_first, n ); } @@ -513,7 +513,7 @@ { m._magic = MAGIC; new ( &m._lock ) xmt::__Mutex<false,true>(); - xmt::__Locker<xmt::__Mutex<false,true> > lk( m._lock ); + xmt::basic_lock<xmt::__Mutex<false,true> > lk( m._lock ); m._first = sizeof( _master ); m._nm = 0; _fheader& h = *new ( reinterpret_cast<char *>(&m) + sizeof(_master) ) _fheader(); @@ -535,7 +535,7 @@ n = max( n + (__align - n % __align) % __align, sizeof(_fheader) ); _master *m = reinterpret_cast<_master *>( _seg.address() ); if ( m != reinterpret_cast<_master *>(-1) && (reinterpret_cast<char *>(p) - reinterpret_cast<char *>(_seg.address())) < (_seg.max_size() + sizeof(_master) + sizeof(_aheader) ) ) { - xmt::__Locker<xmt::__Mutex<false,true> > lk( m->_lock ); + xmt::basic_lock<xmt::__Mutex<false,true> > lk( m->_lock ); _aheader *a = reinterpret_cast<_aheader *>( reinterpret_cast<char *>(p) - sizeof(_aheader) ); size_type off = reinterpret_cast<char *>(p) - reinterpret_cast<char *>(_seg.address()); if ( m->_first == 0 ) { Modified: branches/complement-xmt/explore/include/mt/xmt.h =================================================================== --- branches/complement-xmt/explore/include/mt/xmt.h 2007-06-08 19:40:15 UTC (rev 1585) +++ branches/complement-xmt/explore/include/mt/xmt.h 2007-06-14 06:47:19 UTC (rev 1586) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <07/03/12 20:09:11 ptr> +// -*- C++ -*- Time-stamp: <07/06/14 10:15:07 ptr> /* * Copyright (c) 1997-1999, 2002-2007 @@ -121,6 +121,32 @@ namespace xmt { + +// Exceptions + +// class thread_exit; +// class thread_cancel: public thread_exit; +// class thread_error: public exception; + +class lock_error : + public std::exception +{ + private: + int r_; + + public: + + explicit lock_error( int r ) : + r_( r ) + { } + + virtual char const *what() throw() + { return "std::lock_error"; } + + int error() const + { return r_; } +}; + namespace detail { #ifdef __FIT_PSHARED_MUTEX @@ -321,7 +347,7 @@ } #if !defined( WIN32 ) || (defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x0400) - int trylock() + int try_lock() { #ifdef _PTHREADS return pthread_mutex_trylock( &this->_M_lock ); @@ -384,7 +410,7 @@ # endif } - int trylock() + int try_lock() { # ifdef _PTHREADS return pthread_spin_trylock( &this->_M_lock ); @@ -434,7 +460,7 @@ # endif // !_NOTHREADS } - int trylock() + int try_lock() { # ifdef _NOTHREADS return 0; @@ -549,11 +575,11 @@ // Equivalent to lock(), except that if the mutex object referenced // by mutex is currently locked the call return immediately. // If mutex is currently owned by the calling thread, the mutex lock count - // incremented by one and the trylock() function immediately return success + // incremented by one and the try_lock() function immediately return success // (value 0). Otherwise, if mutex is currently owned by another thread, // return error (non-zero). - int trylock() + int try_lock() { # ifdef _NOTHREADS return 0; @@ -718,7 +744,7 @@ #endif } - void wrlock() + void lock() { #ifdef _PTHREADS pthread_rwlock_wrlock( &this->_M_lock ); @@ -734,7 +760,7 @@ } #if !defined( WIN32 ) || (defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x0400) - int tryrdlock() + int try_rdlock() { #ifdef _PTHREADS return pthread_rwlock_tryrdlock( &this->_M_lock ); @@ -753,7 +779,7 @@ #endif } - int trywrlock() + int try_lock() { #ifdef _PTHREADS return pthread_rwlock_trywrlock( &this->_M_lock ); @@ -797,52 +823,82 @@ #endif // __FIT_RWLOCK template <class M> -class __Locker +class basic_lock { public: - __Locker( const M& point ) : - m( point ) - { const_cast<M&>(m).lock(); } - ~__Locker() - { const_cast<M&>(m).unlock(); } + basic_lock( const M& point, bool initially_locked = true ) : + m( point ), + lk( false ) + { if ( initially_locked ) lock(); } + ~basic_lock() + { if ( lk ) const_cast<M&>(m).unlock(); } + void lock() + { + if ( lk ) { + throw lock_error( 0 ); + } + const_cast<M&>(m).lock(); + lk = true; + } + + void unlock() + { + if ( !lk ) { + throw lock_error( 0 ); + } + lk = false; + const_cast<M&>(m).unlock(); + } + private: - __Locker( const __Locker& ) + basic_lock( const basic_lock& ) { } + basic_lock& operator =( const basic_lock& ) + { return *this; } + const M& m; + bool lk; }; #ifdef __FIT_RWLOCK -template <bool SCOPE> -class __LockerRd +template <class M> +class basic_read_lock { public: - __LockerRd( const __MutexRW<SCOPE>& point ) : - m( point ) - { const_cast<__MutexRW<SCOPE>&>(m).rdlock(); } - ~__LockerRd() - { const_cast<__MutexRW<SCOPE>&>(m).unlock(); } + basic_read_lock( const M& point, bool initially_locked = true ) : + m( point ), + lk( false ) + { if ( initially_locked ) lock(); } + ~basic_read_lock() + { if ( lk ) const_cast<M&>(m).unlock(); } - private: - __LockerRd( const __LockerRd& ) - { } - const __MutexRW<SCOPE>& m; -}; + void lock() + { + if ( lk ) { + throw lock_error( 0 ); + } + const_cast<M&>(m).rdlock(); + lk = true; + } -template <bool SCOPE> -class __LockerWr -{ - public: - __LockerWr( const __MutexRW<SCOPE>& point ) : - m( point ) - { const_cast<__MutexRW<SCOPE>&>(m).wrlock(); } - ~__LockerWr() - { const_cast<__MutexRW<SCOPE>&>(m).unlock(); } + void unlock() + { + if ( !lk ) { + throw lock_error( 0 ); + } + lk = false; + const_cast<M&>(m).unlock(); + } private: - __LockerWr( const __LockerWr& ) + basic_read_lock( const basic_read_lock& ) { } - const __MutexRW<SCOPE>& m; + basic_read_lock& operator =( const basic_read_lock& ) + { return *this; } + + const M& m; + bool lk; }; #endif // __FIT_RWLOCK @@ -857,16 +913,17 @@ typedef __Spinlock<true,false> SpinlockRS; #endif // __FIT_RWLOCK -typedef __Locker<Mutex> Locker; -typedef __Locker<MutexRS> LockerRS; -typedef __Locker<MutexRS> LockerSDS; // obsolete, use instead LockerRS +typedef basic_lock<Mutex> Locker; +typedef basic_lock<Mutex> scoped_lock; +typedef basic_lock<MutexRS> LockerRS; +typedef basic_lock<MutexRS> LockerSDS; // obsolete, use instead LockerRS #ifdef __FIT_RWLOCK -typedef __LockerRd<false> LockerRd; -typedef __LockerWr<false> LockerWr; +typedef basic_read_lock<__MutexRW<false> > LockerRd; +typedef basic_lock<__MutexRW<false> > LockerWr; #endif // __FIT_RWLOCK #ifdef __FIT_PTHREAD_SPINLOCK -typedef __Locker<Spinlock> LockerSpin; -typedef __Locker<SpinlockRS> LockerSpinRS; +typedef basic_lock<Spinlock> LockerSpin; +typedef basic_lock<SpinlockRS> LockerSpinRS; #endif // __FIT_RWLOCK class LockerExt @@ -963,7 +1020,7 @@ bool set( bool __v, bool _broadcast = false ) { - __Locker<__Mutex<false,SCOPE> > _x1( _lock ); + basic_lock<__Mutex<false,SCOPE> > _x1( _lock ); bool tmp = _val; _val = __v; @@ -1004,7 +1061,7 @@ _lock.lock(); #endif #if defined(__FIT_UITHREADS) || defined(_PTHREADS) - __Locker<__Mutex<false,SCOPE> > _x1( _lock ); + basic_lock<__Mutex<false,SCOPE> > _x1( _lock ); #endif if ( _val == false ) { #ifdef __FIT_WIN32THREADS @@ -1047,7 +1104,7 @@ return 0; #endif #if defined(_PTHREADS) || defined(__FIT_UITHREADS) - __Locker<__Mutex<false,SCOPE> > lk( _lock ); + basic_lock<__Mutex<false,SCOPE> > lk( _lock ); _val = false; int ret; while ( !_val ) { @@ -1085,7 +1142,7 @@ int signal( bool _broadcast = false ) { - __Locker<__Mutex<false,SCOPE> > _x1( _lock ); + basic_lock<__Mutex<false,SCOPE> > _x1( _lock ); _val = true; #ifdef __FIT_WIN32THREADS Modified: branches/complement-xmt/explore/lib/mt/ChangeLog =================================================================== --- branches/complement-xmt/explore/lib/mt/ChangeLog 2007-06-08 19:40:15 UTC (rev 1585) +++ branches/complement-xmt/explore/lib/mt/ChangeLog 2007-06-14 06:47:19 UTC (rev 1586) @@ -1,3 +1,11 @@ +2007-06-14 Petr Ovtchenkov <pt...@is...> + + * xmt.h, xmt.cc, shm.h: step to interface like boost or + http://www.open-std.org/jtc1/sc22/WG21/docs/papers/2007/n2178.html; + Locker* changed to basic_lock or basic_read_lock, internal lock flag + added, lock/unlock methods added to basic_*_lock and exception + lock_error added too. + 2007-03-12 Petr Ovtchenkov <pt...@is...> * xmt.h, xmt.cc: code for Novell NetWare removed. Modified: branches/complement-xmt/explore/lib/mt/xmt.cc =================================================================== --- branches/complement-xmt/explore/lib/mt/xmt.cc 2007-06-08 19:40:15 UTC (rev 1585) +++ branches/complement-xmt/explore/lib/mt/xmt.cc 2007-06-14 06:47:19 UTC (rev 1586) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <07/03/12 20:14:35 ptr> +// -*- C++ -*- Time-stamp: <07/06/14 10:10:54 ptr> /* * Copyright (c) 1997-1999, 2002-2007 @@ -926,7 +926,7 @@ int Thread::xalloc() { - Locker _l( _idx_lock ); + scoped_lock _l( _idx_lock ); return _idx++; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2007-06-08 19:40:28
|
Revision: 1585 http://svn.sourceforge.net/complement/?rev=1585&view=rev Author: complement Date: 2007-06-08 12:40:15 -0700 (Fri, 08 Jun 2007) Log Message: ----------- move gmake-specific files into gmake catalog Modified Paths: -------------- trunk/complement/explore/Makefiles/ChangeLog trunk/complement/explore/Makefiles/gmake/app/top.mak trunk/complement/explore/Makefiles/gmake/lib/top.mak trunk/complement/explore/Makefiles/top.mak trunk/complement/explore/configure Added Paths: ----------- trunk/complement/explore/Makefiles/gmake/clean.mak trunk/complement/explore/Makefiles/gmake/extern.mak Removed Paths: ------------- trunk/complement/explore/Makefiles/clean.mak trunk/complement/explore/Makefiles/extern.mak Property Changed: ---------------- trunk/complement/explore/Makefiles/ trunk/complement/explore/Makefiles/gmake/ Property changes on: trunk/complement/explore/Makefiles ___________________________________________________________________ Name: svn:ignore - config.mak + Modified: trunk/complement/explore/Makefiles/ChangeLog =================================================================== --- trunk/complement/explore/Makefiles/ChangeLog 2007-06-06 18:03:04 UTC (rev 1584) +++ trunk/complement/explore/Makefiles/ChangeLog 2007-06-08 19:40:15 UTC (rev 1585) @@ -1,3 +1,12 @@ +2007-06-08 Petr Ovtchenkov <pt...@is...> + + * clean.mak, extern.mak, config.mak: move to gmake catalog + + * top.mak: move some files in gmake catalog; replace USE_MAKE + by gmake; + + * gmake/app/top.mak, gmake/lib/top.mak: replace USE_MAKE by gmake. + 2007-05-31 Petr Ovtchenkov <pt...@is...> * gmake/app/gcc.mak, gmake/targets.mak, gmake/windows/rules-so.mak: Deleted: trunk/complement/explore/Makefiles/clean.mak =================================================================== --- trunk/complement/explore/Makefiles/clean.mak 2007-06-06 18:03:04 UTC (rev 1584) +++ trunk/complement/explore/Makefiles/clean.mak 2007-06-08 19:40:15 UTC (rev 1585) @@ -1,48 +0,0 @@ -# -*- Makefile -*- Time-stamp: <06/11/17 00:25:42 ptr> -# -# Copyright (c) 1997-1999, 2002, 2003, 2005, 2006 -# Petr Ovtchenkov -# -# Portion Copyright (c) 1999-2001 -# Parallel Graphics Ltd. -# -# Licensed under the Academic Free License version 3.0 -# - -PHONY += clean distclean mostlyclean maintainer-clean uninstall - -define obj_clean -clean:: - @-rm -f $$($(1)_OBJ) $$($(1)_DEP) - @-rm -f $$($(1)_OBJ_DBG) $$($(1)_DEP_DBG) - @-rm -f $$($(1)_OBJ_STLDBG) $$($(1)_DEP_STLDBG) -endef - -clean:: - @-rm -f core core.* -ifdef PRGNAME - @-rm -f $(OBJ) $(DEP) - @-rm -f $(OBJ_DBG) $(DEP_DBG) - @-rm -f $(OBJ_STLDBG) $(DEP_STLDBG) -endif -ifdef LIBNAME - @-rm -f $(OBJ) $(DEP) - @-rm -f $(OBJ_DBG) $(DEP_DBG) - @-rm -f $(OBJ_STLDBG) $(DEP_STLDBG) -endif - -$(foreach prg,$(PRGNAMES),$(eval $(call obj_clean,$(prg)))) - -$(foreach prg,$(LIBNAMES),$(eval $(call obj_clean,$(prg)))) - -distclean:: clean -# $(DEPENDS_COLLECTION) removed before directory, -# see app/clean.mak and lib/clean.mak - -mostlyclean:: clean - @-rm -f $(DEPENDS_COLLECTION) - @-rm -f TAGS tags - -maintainer-clean:: distclean - @rm -f ${RULESBASE}/config.mak - @-rm -f TAGS tags Deleted: trunk/complement/explore/Makefiles/extern.mak =================================================================== --- trunk/complement/explore/Makefiles/extern.mak 2007-06-06 18:03:04 UTC (rev 1584) +++ trunk/complement/explore/Makefiles/extern.mak 2007-06-08 19:40:15 UTC (rev 1585) @@ -1,40 +0,0 @@ -# Time-stamp: <07/03/08 22:41:26 ptr> -# -# Copyright (c) 1997-1999, 2002, 2003, 2005, 2006 -# Petr Ovtchenkov -# -# Portion Copyright (c) 1999-2001 -# Parallel Graphics Ltd. -# -# Licensed under the Academic Free License version 3.0 -# - -# Complement project: - -CoMT_DIR ?= ${SRCROOT} - -CoMT_LIB_DIR ?= ${INSTALL_LIB_DIR} -CoMT_LIB_DIR_DBG ?= ${INSTALL_LIB_DIR_DBG} -CoMT_LIB_DIR_STLDBG ?= ${INSTALL_LIB_DIR_STLDBG} -CoMT_BIN_DIR ?= ${INSTALL_BIN_DIR} -CoMT_BIN_DIR_DBG ?= ${INSTALL_BIN_DIR_DBG} -CoMT_BIN_DIR_STLDBG ?= ${INSTALL_BIN_DIR_STLDBG} - -CoMT_INCLUDE_DIR ?= ${CoMT_DIR}/include - -# boost (http://www.boost.org, http://boost.sourceforge.net) - -ifdef BOOST_DIR -BOOST_INCLUDE_DIR ?= ${BOOST_DIR} -endif - -# STLport library - -ifndef WITHOUT_STLPORT -STLPORT_DIR ?= ${HOME}/STLport.lab/STLport -endif - -ifdef STLPORT_DIR -STLPORT_LIB_DIR ?= $(STLPORT_DIR)/${TARGET_NAME}lib -STLPORT_INCLUDE_DIR ?= $(STLPORT_DIR)/stlport -endif Property changes on: trunk/complement/explore/Makefiles/gmake ___________________________________________________________________ Name: svn:ignore + config.mak Modified: trunk/complement/explore/Makefiles/gmake/app/top.mak =================================================================== --- trunk/complement/explore/Makefiles/gmake/app/top.mak 2007-06-06 18:03:04 UTC (rev 1584) +++ trunk/complement/explore/Makefiles/gmake/app/top.mak 2007-06-08 19:40:15 UTC (rev 1585) @@ -1,6 +1,6 @@ -# -*- makefile -*- Time-stamp: <07/03/08 21:59:26 ptr> +# -*- makefile -*- Time-stamp: <07/06/08 23:35:09 ptr> # -# Copyright (c) 1997-1999, 2002, 2003, 2005, 2006 +# Copyright (c) 1997-1999, 2002, 2003, 2005-2007 # Petr Ovtchenkov # # Portion Copyright (c) 1999-2001 @@ -33,9 +33,9 @@ LDFLAGS += ${LDSEARCH} -include ${RULESBASE}/${USE_MAKE}/app/${COMPILER_NAME}.mak -include ${RULESBASE}/${USE_MAKE}/app/rules.mak -include ${RULESBASE}/${USE_MAKE}/app/rules-install.mak +include ${RULESBASE}/gmake/app/${COMPILER_NAME}.mak +include ${RULESBASE}/gmake/app/rules.mak +include ${RULESBASE}/gmake/app/rules-install.mak define prog_clean clean:: Copied: trunk/complement/explore/Makefiles/gmake/clean.mak (from rev 1582, trunk/complement/explore/Makefiles/clean.mak) =================================================================== --- trunk/complement/explore/Makefiles/gmake/clean.mak (rev 0) +++ trunk/complement/explore/Makefiles/gmake/clean.mak 2007-06-08 19:40:15 UTC (rev 1585) @@ -0,0 +1,48 @@ +# -*- Makefile -*- Time-stamp: <06/11/17 00:25:42 ptr> +# +# Copyright (c) 1997-1999, 2002, 2003, 2005, 2006 +# Petr Ovtchenkov +# +# Portion Copyright (c) 1999-2001 +# Parallel Graphics Ltd. +# +# Licensed under the Academic Free License version 3.0 +# + +PHONY += clean distclean mostlyclean maintainer-clean uninstall + +define obj_clean +clean:: + @-rm -f $$($(1)_OBJ) $$($(1)_DEP) + @-rm -f $$($(1)_OBJ_DBG) $$($(1)_DEP_DBG) + @-rm -f $$($(1)_OBJ_STLDBG) $$($(1)_DEP_STLDBG) +endef + +clean:: + @-rm -f core core.* +ifdef PRGNAME + @-rm -f $(OBJ) $(DEP) + @-rm -f $(OBJ_DBG) $(DEP_DBG) + @-rm -f $(OBJ_STLDBG) $(DEP_STLDBG) +endif +ifdef LIBNAME + @-rm -f $(OBJ) $(DEP) + @-rm -f $(OBJ_DBG) $(DEP_DBG) + @-rm -f $(OBJ_STLDBG) $(DEP_STLDBG) +endif + +$(foreach prg,$(PRGNAMES),$(eval $(call obj_clean,$(prg)))) + +$(foreach prg,$(LIBNAMES),$(eval $(call obj_clean,$(prg)))) + +distclean:: clean +# $(DEPENDS_COLLECTION) removed before directory, +# see app/clean.mak and lib/clean.mak + +mostlyclean:: clean + @-rm -f $(DEPENDS_COLLECTION) + @-rm -f TAGS tags + +maintainer-clean:: distclean + @rm -f ${RULESBASE}/config.mak + @-rm -f TAGS tags Copied: trunk/complement/explore/Makefiles/gmake/extern.mak (from rev 1582, trunk/complement/explore/Makefiles/extern.mak) =================================================================== --- trunk/complement/explore/Makefiles/gmake/extern.mak (rev 0) +++ trunk/complement/explore/Makefiles/gmake/extern.mak 2007-06-08 19:40:15 UTC (rev 1585) @@ -0,0 +1,40 @@ +# Time-stamp: <07/03/08 22:41:26 ptr> +# +# Copyright (c) 1997-1999, 2002, 2003, 2005, 2006 +# Petr Ovtchenkov +# +# Portion Copyright (c) 1999-2001 +# Parallel Graphics Ltd. +# +# Licensed under the Academic Free License version 3.0 +# + +# Complement project: + +CoMT_DIR ?= ${SRCROOT} + +CoMT_LIB_DIR ?= ${INSTALL_LIB_DIR} +CoMT_LIB_DIR_DBG ?= ${INSTALL_LIB_DIR_DBG} +CoMT_LIB_DIR_STLDBG ?= ${INSTALL_LIB_DIR_STLDBG} +CoMT_BIN_DIR ?= ${INSTALL_BIN_DIR} +CoMT_BIN_DIR_DBG ?= ${INSTALL_BIN_DIR_DBG} +CoMT_BIN_DIR_STLDBG ?= ${INSTALL_BIN_DIR_STLDBG} + +CoMT_INCLUDE_DIR ?= ${CoMT_DIR}/include + +# boost (http://www.boost.org, http://boost.sourceforge.net) + +ifdef BOOST_DIR +BOOST_INCLUDE_DIR ?= ${BOOST_DIR} +endif + +# STLport library + +ifndef WITHOUT_STLPORT +STLPORT_DIR ?= ${HOME}/STLport.lab/STLport +endif + +ifdef STLPORT_DIR +STLPORT_LIB_DIR ?= $(STLPORT_DIR)/${TARGET_NAME}lib +STLPORT_INCLUDE_DIR ?= $(STLPORT_DIR)/stlport +endif Modified: trunk/complement/explore/Makefiles/gmake/lib/top.mak =================================================================== --- trunk/complement/explore/Makefiles/gmake/lib/top.mak 2007-06-06 18:03:04 UTC (rev 1584) +++ trunk/complement/explore/Makefiles/gmake/lib/top.mak 2007-06-08 19:40:15 UTC (rev 1585) @@ -1,6 +1,6 @@ -# -*- makefile -*- Time-stamp: <03/10/10 16:15:53 ptr> +# -*- makefile -*- Time-stamp: <07/06/08 23:34:51 ptr> # -# Copyright (c) 1997-1999, 2002, 2003, 2005, 2006 +# Copyright (c) 1997-1999, 2002, 2003, 2005-2007 # Petr Ovtchenkov # # Portion Copyright (c) 1999-2001 @@ -12,26 +12,26 @@ LDFLAGS ?= ifneq ("$(findstring $(OSNAME),darwin windows)","") -include ${RULESBASE}/${USE_MAKE}/${OSNAME}/lib.mak +include ${RULESBASE}/gmake/${OSNAME}/lib.mak else -include ${RULESBASE}/${USE_MAKE}/unix/lib.mak +include ${RULESBASE}/gmake/unix/lib.mak endif -include ${RULESBASE}/${USE_MAKE}/lib/${COMPILER_NAME}.mak +include ${RULESBASE}/gmake/lib/${COMPILER_NAME}.mak ifneq ("$(findstring $(OSNAME),windows)","") -include ${RULESBASE}/${USE_MAKE}/${OSNAME}/rules-so.mak +include ${RULESBASE}/gmake/${OSNAME}/rules-so.mak else -include ${RULESBASE}/${USE_MAKE}/unix/rules-so.mak +include ${RULESBASE}/gmake/unix/rules-so.mak endif -include ${RULESBASE}/${USE_MAKE}/lib/rules-a.mak +include ${RULESBASE}/gmake/lib/rules-a.mak ifneq ("$(findstring $(OSNAME),windows)","") -include ${RULESBASE}/${USE_MAKE}/${OSNAME}/rules-install-so.mak +include ${RULESBASE}/gmake/${OSNAME}/rules-install-so.mak else -include ${RULESBASE}/${USE_MAKE}/unix/rules-install-so.mak +include ${RULESBASE}/gmake/unix/rules-install-so.mak endif -include ${RULESBASE}/${USE_MAKE}/lib/rules-install-a.mak -include ${RULESBASE}/${USE_MAKE}/lib/clean.mak +include ${RULESBASE}/gmake/lib/rules-install-a.mak +include ${RULESBASE}/gmake/lib/clean.mak Modified: trunk/complement/explore/Makefiles/top.mak =================================================================== --- trunk/complement/explore/Makefiles/top.mak 2007-06-06 18:03:04 UTC (rev 1584) +++ trunk/complement/explore/Makefiles/top.mak 2007-06-08 19:40:15 UTC (rev 1585) @@ -1,4 +1,4 @@ -# Time-stamp: <07/03/08 22:57:35 ptr> +# Time-stamp: <07/06/08 23:23:03 ptr> # # Copyright (c) 1997-1999, 2002, 2003, 2005, 2006 # Petr Ovtchenkov @@ -18,7 +18,7 @@ RULESBASE ?= $(SRCROOT)/Makefiles # include file, generated by configure, if available --include ${RULESBASE}/config.mak +-include ${RULESBASE}/gmake/config.mak ifndef COMPILER_NAME # gcc is default compiler, others specify explicitly; @@ -73,47 +73,44 @@ NOT_USE_NOSTDLIB := 1 endif -# define what make clone we use -USE_MAKE := gmake - ifndef OSNAME # identify OS and build date -include ${RULESBASE}/$(USE_MAKE)/sysid.mak +include ${RULESBASE}/gmake/sysid.mak endif # OS-specific definitions, like ln, install, etc. (guest host) -include ${RULESBASE}/$(USE_MAKE)/$(BUILD_OSNAME)/sys.mak +include ${RULESBASE}/gmake/$(BUILD_OSNAME)/sys.mak # target OS-specific definitions, like ar, etc. -include ${RULESBASE}/$(USE_MAKE)/$(OSNAME)/targetsys.mak +include ${RULESBASE}/gmake/$(OSNAME)/targetsys.mak # compiler, compiler options -include ${RULESBASE}/$(USE_MAKE)/$(COMPILER_NAME).mak +include ${RULESBASE}/gmake/$(COMPILER_NAME).mak # rules to make dirs for targets -include ${RULESBASE}/$(USE_MAKE)/targetdirs.mak +include ${RULESBASE}/gmake/targetdirs.mak # Extern projects for everyday usage and settings for ones -include ${RULESBASE}/extern.mak +include ${RULESBASE}/gmake/extern.mak # os-specific local rules (or other project-specific definitions) -include specific.mak # derive common targets (*.o, *.d), # build rules (including output catalogs) -include ${RULESBASE}/$(USE_MAKE)/targets.mak +include ${RULESBASE}/gmake/targets.mak # dependency -include ${RULESBASE}/$(USE_MAKE)/depend.mak +include ${RULESBASE}/gmake/depend.mak # general clean -include ${RULESBASE}/clean.mak +include ${RULESBASE}/gmake/clean.mak # if target is library, rules for library ifdef LIBNAME -include ${RULESBASE}/$(USE_MAKE)/lib/top.mak +include ${RULESBASE}/gmake/lib/top.mak endif # if target is program, rules for executable ifdef PRGNAME -include ${RULESBASE}/$(USE_MAKE)/app/top.mak +include ${RULESBASE}/gmake/app/top.mak else ifdef PRGNAMES -include ${RULESBASE}/$(USE_MAKE)/app/top.mak +include ${RULESBASE}/gmake/app/top.mak endif endif Modified: trunk/complement/explore/configure =================================================================== --- trunk/complement/explore/configure 2007-06-06 18:03:04 UTC (rev 1584) +++ trunk/complement/explore/configure 2007-06-08 19:40:15 UTC (rev 1585) @@ -1,8 +1,8 @@ #!/bin/sh -# Time-stamp: <06/11/10 15:47:21 ptr> +# Time-stamp: <07/06/08 23:24:03 ptr> -configmak=Makefiles/config.mak +configmak=Makefiles/gmake/config.mak # rm -f ${configmak} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2007-06-06 18:03:15
|
Revision: 1584 http://svn.sourceforge.net/complement/?rev=1584&view=rev Author: complement Date: 2007-06-06 11:03:04 -0700 (Wed, 06 Jun 2007) Log Message: ----------- branch for modification of xmt lib for proposed http://www.open-std.org/jtc1/sc22/WG21/docs/papers/2007/n2178.html Added Paths: ----------- branches/complement-xmt/ Copied: branches/complement-xmt (from rev 1583, trunk/complement) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2007-06-06 17:56:25
|
Revision: 1583 http://svn.sourceforge.net/complement/?rev=1583&view=rev Author: complement Date: 2007-06-06 10:56:23 -0700 (Wed, 06 Jun 2007) Log Message: ----------- test for build with static libstlport; use make release-static Modified Paths: -------------- trunk/complement/explore/inquiry/STLport/static/Makefile trunk/complement/explore/inquiry/STLport/static/test.cc Modified: trunk/complement/explore/inquiry/STLport/static/Makefile =================================================================== --- trunk/complement/explore/inquiry/STLport/static/Makefile 2007-06-06 16:23:28 UTC (rev 1582) +++ trunk/complement/explore/inquiry/STLport/static/Makefile 2007-06-06 17:56:23 UTC (rev 1583) @@ -1,30 +1,8 @@ # -*- Makefile -*- Time-stamp: <03/07/09 18:08:47 ptr> -# $Id$ SRCROOT := ../../.. COMPILER_NAME := gcc -#STLPORT_DIR := /export/home/ptr/STLport.lab/cvs.stlport.com/STLport-R451_dev -STLPORT_DIR := /export/home/ptr/STLport.lab/STLport +#STLPORT_DIR := /export/home/ptr/STLport.lab/STLport-Makefiles include Makefile.inc include ${SRCROOT}/Makefiles/top.mak - - -INCLUDES += -I$(SRCROOT)/include -I$(STLPORT_INCLUDE_DIR) - -LDFLAGS += -Wl,-rpath=$(STLPORT_LIB_DIR) - -release-shared: LDSEARCH = -L${STLPORT_LIB_DIR} -stldbg-shared: LDSEARCH = -L${STLPORT_LIB_DIR} -dbg-shared: LDSEARCH = -L${STLPORT_LIB_DIR} - -ifeq ($(OSNAME),sunos) -release-shared : LDLIBS = -lstlport_gcc -lrt -stldbg-shared : LDLIBS = -lstlport_gcc_stldebug -lrt -dbg-shared : LDLIBS = -lstlport_gcc -lrt -else -release-shared : LDLIBS = -Wl,-dn -lstlport_gcc -Wl,-dy -stldbg-shared : LDLIBS = -Wl,-dn -lstlport_gcc_stldebug -Wl,-dy -dbg-shared : LDLIBS = -Wl,-dn -lstlport_gcc -Wl,-dy -endif - Modified: trunk/complement/explore/inquiry/STLport/static/test.cc =================================================================== --- trunk/complement/explore/inquiry/STLport/static/test.cc 2007-06-06 16:23:28 UTC (rev 1582) +++ trunk/complement/explore/inquiry/STLport/static/test.cc 2007-06-06 17:56:23 UTC (rev 1583) @@ -8,6 +8,7 @@ */ #include <sstream> +#include <iostream> using namespace std; @@ -22,5 +23,8 @@ int main(int argc, char* argv[]) { + + cerr << "Hello!" << endl; + return(0); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2007-06-06 16:23:30
|
Revision: 1582 http://svn.sourceforge.net/complement/?rev=1582&view=rev Author: complement Date: 2007-06-06 09:23:28 -0700 (Wed, 06 Jun 2007) Log Message: ----------- oh, first working Modified Paths: -------------- trunk/complement/explore/test/virtual_time/vtime.cc trunk/complement/explore/test/virtual_time/vtime.h trunk/complement/explore/test/virtual_time/vtime_main.cc Modified: trunk/complement/explore/test/virtual_time/vtime.cc =================================================================== --- trunk/complement/explore/test/virtual_time/vtime.cc 2007-06-05 16:20:15 UTC (rev 1581) +++ trunk/complement/explore/test/virtual_time/vtime.cc 2007-06-06 16:23:28 UTC (rev 1582) @@ -133,39 +133,20 @@ bool operator <=( const vtime_type& l, const vtime_type& r ) { - if ( r.empty() ) { - return l.empty(); - } - if ( l.empty() ) { return true; } - vtime_type::const_iterator i = l.begin(); - vtime_type::const_iterator j = r.begin(); - - while ( i != l.end() && j != r.end() ) { - if ( i->first < j->first ) { // v <= 0 --- false - return false; - } - while ( j != r.end() && i->first > j->first ) { // 0 <= v --- true - ++j; - } - - while ( i != l.end() && j != r.end() && i->first == j->first ) { - if ( i->second > j->second ) { + for ( vtime_type::const_iterator i = l.begin(); i != l.end(); ++i ) { + if ( i->second > 0 ) { + vtime_type::const_iterator j = r.find( i->first ); + if ( j == r.end() || i->second > j->second ) { return false; } - ++i; - ++j; } } - if ( i == l.end() ) { - return true; - } - - return false; + return true; } vtime_type operator -( const vtime_type& l, const vtime_type& r ) @@ -173,11 +154,13 @@ vtime_type tmp( r.begin(), r.end() ); for ( vtime_type::iterator i = tmp.begin(); i != tmp.end(); ++i ) { - vtime_type::const_iterator p = l.find(i->first); - if ( p == l.end() || p->second < i->second ) { - throw range_error( "vtime different: right value grater then left" ); + if ( i->second > 0 ) { + vtime_type::const_iterator p = l.find(i->first); + if ( p == l.end() || p->second < i->second ) { + throw range_error( "vtime different: right value grater then left" ); + } + i->second = p->second - i->second; } - i->second = p->second - i->second; } for ( vtime_type::const_iterator i = l.begin(); i != l.end(); ++i ) { @@ -221,6 +204,17 @@ return tmp; } +// template <> +vtime max( const vtime& l, const vtime& r ) +{ + vtime tmp( l ); + + for ( vtime_type::const_iterator i = r.vt.begin(); i != r.vt.end(); ++i ) { + tmp[i->first] = std::max( tmp[i->first], i->second ); + } + return tmp; +} + vtime& vtime::operator +=( const vtime_type::value_type& t ) { vt[t.first] += t.second; @@ -235,6 +229,38 @@ return gvt; } +gvtime_type& operator +=( gvtime_type& l, const gvtime_type& r ) +{ + for ( gvtime_type::const_iterator g = r.begin(); g != r.end(); ++g ) { + l[g->first] += g->second; + } + + return l; +} + +gvtime_type operator -( const gvtime_type& l, const gvtime_type& r ) +{ + gvtime_type tmp( r ); + + for ( gvtime_type::iterator g = tmp.begin(); g != tmp.end(); ++g ) { + gvtime_type::const_iterator i = l.find( g->first ); + if ( i == l.end() ) { + throw range_error( "gvtime different: right value grater then left" ); + } + + g->second = i->second - g->second; + } + + for ( gvtime_type::const_iterator g = l.begin(); g != l.end(); ++g ) { + gvtime_type::const_iterator i = tmp.find(g->first); + if ( i == tmp.end() ) { + tmp[g->first] = g->second; + } + } + + return tmp; +} + gvtime& gvtime::operator +=( const gvtime_type::value_type& t ) { gvt[t.first] += t.second; @@ -242,51 +268,98 @@ return *this; } +gvtime& gvtime::operator +=( const gvtime& t ) +{ + for ( gvtime_type::const_iterator g = t.gvt.begin(); g != t.gvt.end(); ++g ) { + gvt[g->first] += g->second; + } + + return *this; +} + void Proc::mess( const stem::Event_base<VTmess>& ev ) { cout << self_id() << " " << ev.value().mess << endl; - cout << ev.value().gvt.gvt << endl; + // cout << ev.value().gvt.gvt << endl; - cout << order_correct( ev ) << endl; - - // if ( order_correct( ev ) ) { - // - // } + if ( order_correct( ev ) ) { + cout << "Order correct" << endl; + lvt[ev.src()] += ev.value().gvt.gvt; + lvt[ev.src()][ev.value().grp][ev.src()] = vt.gvt[ev.value().grp][ev.src()] + 1; + vt.gvt[ev.value().grp] = vt::max( vt.gvt[ev.value().grp], lvt[ev.src()][ev.value().grp] ); + cout << vt.gvt << endl; + } else { + cout << "Order not correct" << endl; + } } bool Proc::order_correct( const stem::Event_base<VTmess>& ev ) { - // 1. - gvtime gvt( ev.value().gvt ); if ( vt.gvt[ev.value().grp][ev.src()] + 1 != gvt[ev.value().grp][ev.src()] ) { + cerr << "1" << endl; + cerr << vt.gvt[ev.value().grp][ev.src()] << "\n" + << gvt[ev.value().grp][ev.src()] + << endl; return false; } - vtime xvt = lvt[ev.value().grp] + gvt[ev.value().grp]; + vtime xvt = lvt[ev.src()][ev.value().grp] + gvt[ev.value().grp]; xvt[ev.src()] = 0; if ( !(xvt <= vt[ev.value().grp]) ) { + cerr << "2" << endl; + cerr << xvt << "\n\n" + << vt[ev.value().grp] << endl; return false; } - // change: iteration through all groups of this object (not the same as below) for ( groups_container_type::const_iterator l = groups.begin(); l != groups.end(); ++l ) { if ( *l != ev.value().grp ) { - xvt = lvt[*l] + gvt[*l]; + xvt = lvt[ev.src()][*l] + gvt[*l]; if ( !(xvt <= vt[*l]) ) { + cerr << "3" << endl; + cerr << "group " << *l << xvt << "\n\n" + << vt[*l] << endl; return false; } } } - // lvt += gvt; - return true; } +void Proc::SendVC( group_type g, const std::string& mess ) +{ + try { + stem::Event_base<VTmess> m( MESS ); + m.value().mess = mess; + m.value().grp = g; + + vtime_type& gr = vt[g].vt; + + gr[self_id()] += 1; + + for ( vtime_type::const_iterator p = gr.begin(); p != gr.end(); ++p ) { + if ( p->first != self_id() ) { + m.dest( p->first ); + + m.value().gvt.gvt = vt.gvt - lvt[p->first]; + m.value().gvt.gvt[g][self_id()] = gr[self_id()]; + + lvt[p->first] = vt.gvt; + + Send(m); + } + } + } + catch ( const range_error& err ) { + cerr << err.what() << endl; + } +} + DEFINE_RESPONSE_TABLE( Proc ) EV_Event_base_T_( ST_NULL, MESS, mess, VTmess ) END_RESPONSE_TABLE @@ -304,21 +377,24 @@ { o << "[\n"; for ( vt::vtime_type::const_iterator i = v.begin(); i != v.end(); ++i ) { - o << *i; + o << " " << *i; } - return o << "]\n"; + return o << " ]\n"; } +ostream& operator <<( ostream& o, const vt::vtime& v ) +{ return o << v.vt; } + ostream& operator <<( ostream& o, const vt::gvtime_type::value_type& v ) { - o << v.first << ": " << v.second.vt; + o << "group " << v.first << ": " << v.second.vt; } ostream& operator <<( ostream& o, const vt::gvtime_type& v ) { o << "{\n"; for ( vt::gvtime_type::const_iterator i = v.begin(); i != v.end(); ++i ) { - o << *i; + o << " " << *i; } return o << "}\n"; } Modified: trunk/complement/explore/test/virtual_time/vtime.h =================================================================== --- trunk/complement/explore/test/virtual_time/vtime.h 2007-06-05 16:20:15 UTC (rev 1581) +++ trunk/complement/explore/test/virtual_time/vtime.h 2007-06-06 16:23:28 UTC (rev 1582) @@ -84,11 +84,16 @@ vtime_type vt; }; + +vtime max( const vtime& l, const vtime& r ); + // typedef std::pair<group_type, vtime> vtime_group_type; // typedef std::list<vtime_group_type> gvtime_type; typedef std::hash_map<group_type, vtime> gvtime_type; gvtime_type& operator +=( gvtime_type&, const gvtime_type::value_type& ); +gvtime_type& operator +=( gvtime_type&, const gvtime_type& ); +gvtime_type operator -( const gvtime_type& l, const gvtime_type& r ); struct gvtime : public stem::__pack_base @@ -108,6 +113,7 @@ { gvt = _gvt.gvt; } gvtime& operator +=( const gvtime_type::value_type& ); + gvtime& operator +=( const gvtime& ); gvtime_type::data_type& operator[]( const gvtime_type::key_type k ) { return gvt[k]; } @@ -149,6 +155,11 @@ void add_group( group_type g ) { groups.push_back( g ); } + void add_group_member( group_type g, oid_type p ) + { vt[g][p]; } + + void SendVC( group_type, const std::string& mess ); + void mess( const stem::Event_base<VTmess>& ); typedef std::list<group_type> groups_container_type; @@ -157,7 +168,9 @@ bool order_correct( const stem::Event_base<VTmess>& ); - gvtime lvt; + typedef std::hash_map<oid_type, gvtime_type> delta_vtime_type; + + delta_vtime_type lvt; gvtime vt; groups_container_type groups; @@ -173,6 +186,7 @@ ostream& operator <<( ostream&, const vt::vtime_type::value_type& ); ostream& operator <<( ostream&, const vt::vtime_type& ); +ostream& operator <<( ostream&, const vt::vtime& ); ostream& operator <<( ostream&, const vt::gvtime_type::value_type& ); ostream& operator <<( ostream&, const vt::gvtime_type& ); Modified: trunk/complement/explore/test/virtual_time/vtime_main.cc =================================================================== --- trunk/complement/explore/test/virtual_time/vtime_main.cc 2007-06-05 16:20:15 UTC (rev 1581) +++ trunk/complement/explore/test/virtual_time/vtime_main.cc 2007-06-06 16:23:28 UTC (rev 1582) @@ -24,31 +24,33 @@ m2.add_group( 0 ); r1.add_group( 0 ); + m1.add_group_member( 0, m2.self_id() ); + m1.add_group_member( 0, r1.self_id() ); + + r1.add_group_member( 0, m1.self_id() ); + r1.add_group_member( 0, m2.self_id() ); + + m2.add_group_member( 0, m1.self_id() ); + m2.add_group_member( 0, r1.self_id() ); + m1.add_group( 1 ); m2.add_group( 1 ); r2.add_group( 1 ); - stem::Event_base<VTmess> mess( MESS ); - - mess.dest( m2.self_id() ); + m1.add_group_member( 1, m2.self_id() ); + m1.add_group_member( 1, r2.self_id() ); - mess.value().mess = "Hello!"; - mess.value().grp = 0; - mess.value().gvt.gvt[0][m1.self_id()] = 1; + r2.add_group_member( 1, m1.self_id() ); + r2.add_group_member( 1, m2.self_id() ); - m1.Send( mess ); + m2.add_group_member( 1, m1.self_id() ); + m2.add_group_member( 1, r2.self_id() ); - mess.dest( r1.self_id() ); + r1.SendVC( 0, "Hello!" ); - m1.Send( mess ); + m1.SendVC( 0, "How are you?" ); - // mess.value().gvt.gvt[0][m1.self_id()] += 1; - - // mess.value().mess = "How are you?"; - // m1.Send( mess ); - cnd.wait(); return 0; } - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2007-06-05 16:20:18
|
Revision: 1581 http://svn.sourceforge.net/complement/?rev=1581&view=rev Author: complement Date: 2007-06-05 09:20:15 -0700 (Tue, 05 Jun 2007) Log Message: ----------- dev Modified Paths: -------------- trunk/complement/explore/test/virtual_time/vtime.cc trunk/complement/explore/test/virtual_time/vtime.h trunk/complement/explore/test/virtual_time/vtime_main.cc Modified: trunk/complement/explore/test/virtual_time/vtime.cc =================================================================== --- trunk/complement/explore/test/virtual_time/vtime.cc 2007-06-04 16:49:00 UTC (rev 1580) +++ trunk/complement/explore/test/virtual_time/vtime.cc 2007-06-05 16:20:15 UTC (rev 1581) @@ -242,48 +242,49 @@ return *this; } -vtime_unit_type comp( const gvtime_type& gvt, group_type g, oid_type p ) +void Proc::mess( const stem::Event_base<VTmess>& ev ) { - gvtime_type::const_iterator k = gvt.begin(); - for ( ; k != gvt.end(); ++k ) { - if ( k->first == g ) { - for ( vtime_type::const_iterator i = k->second.vt.begin(); i != k->second.vt.end(); ++i ) { - if ( i->first == p ) { - return i->second; // found (p_i, t) in g_k - } else if ( i->first > p ) { - return 0; // pair sorted, so no pair required (p_i, t) expected more - } - } - return 0; // no pair (p_i, * ) - } else if ( k->first > g ) { // groups sorted, so no required group expected more - return 0; - } - } + cout << self_id() << " " << ev.value().mess << endl; - return 0; + cout << ev.value().gvt.gvt << endl; + + cout << order_correct( ev ) << endl; + + // if ( order_correct( ev ) ) { + // + // } } - -void Proc::mess( const stem::Event_base<VTmess>& ev ) +bool Proc::order_correct( const stem::Event_base<VTmess>& ev ) { - cout << ev.value().mess << endl; + // 1. - cout << ev.value().gvt.gvt << endl; + gvtime gvt( ev.value().gvt ); - cout << order_correct( ev ) << endl; + if ( vt.gvt[ev.value().grp][ev.src()] + 1 != gvt[ev.value().grp][ev.src()] ) { + return false; + } - if ( order_correct( ev ) ) { - gvtime_type::const_iterator gr = ev.value().gvt.gvt.begin(); - gvtime_type::const_iterator ge = ev.value().gvt.gvt.end(); - for ( ; gr != ge; ++gr ) { // over all groups - // vt[gr->first] = max( vt[gr->first], vt[gr->first] + gr->second.vt ); + vtime xvt = lvt[ev.value().grp] + gvt[ev.value().grp]; + xvt[ev.src()] = 0; + + if ( !(xvt <= vt[ev.value().grp]) ) { + return false; + } + + // change: iteration through all groups of this object (not the same as below) + for ( groups_container_type::const_iterator l = groups.begin(); l != groups.end(); ++l ) { + if ( *l != ev.value().grp ) { + xvt = lvt[*l] + gvt[*l]; + if ( !(xvt <= vt[*l]) ) { + return false; + } } } -} -bool Proc::order_correct( const stem::Event_base<VTmess>& ev ) -{ - return false; + // lvt += gvt; + + return true; } DEFINE_RESPONSE_TABLE( Proc ) Modified: trunk/complement/explore/test/virtual_time/vtime.h =================================================================== --- trunk/complement/explore/test/virtual_time/vtime.h 2007-06-04 16:49:00 UTC (rev 1580) +++ trunk/complement/explore/test/virtual_time/vtime.h 2007-06-05 16:20:15 UTC (rev 1581) @@ -88,7 +88,6 @@ // typedef std::list<vtime_group_type> gvtime_type; typedef std::hash_map<group_type, vtime> gvtime_type; -vtime_unit_type comp( const gvtime_type&, group_type, oid_type ); gvtime_type& operator +=( gvtime_type&, const gvtime_type::value_type& ); struct gvtime : @@ -110,6 +109,9 @@ gvtime& operator +=( const gvtime_type::value_type& ); + gvtime_type::data_type& operator[]( const gvtime_type::key_type k ) + { return gvt[k]; } + gvtime_type gvt; }; @@ -144,23 +146,21 @@ stem::EventHandler( id ) { } + void add_group( group_type g ) + { groups.push_back( g ); } + void mess( const stem::Event_base<VTmess>& ); + typedef std::list<group_type> groups_container_type; + private: - bool order_correct( const stem::Event_base<VTmess>& ); + bool order_correct( const stem::Event_base<VTmess>& ); - enum vtgroup { - first_group, - second_group, - n_groups - }; + gvtime lvt; + gvtime vt; + groups_container_type groups; - // vtime_type vt[n_groups]; - gvtime_type lvt; - gvtime_type vt; - // vtime_type last_vt[n_groups]; - // gvtime_type last_vt; DECLARE_RESPONSE_TABLE( Proc, stem::EventHandler ); }; Modified: trunk/complement/explore/test/virtual_time/vtime_main.cc =================================================================== --- trunk/complement/explore/test/virtual_time/vtime_main.cc 2007-06-04 16:49:00 UTC (rev 1580) +++ trunk/complement/explore/test/virtual_time/vtime_main.cc 2007-06-05 16:20:15 UTC (rev 1581) @@ -18,28 +18,35 @@ Proc m1( 100 ); Proc m2( 101 ); Proc r1( 102 ); - Proc r3( 103 ); + Proc r2( 103 ); + m1.add_group( 0 ); + m2.add_group( 0 ); + r1.add_group( 0 ); + + m1.add_group( 1 ); + m2.add_group( 1 ); + r2.add_group( 1 ); + stem::Event_base<VTmess> mess( MESS ); - mess.dest( 101 ); + mess.dest( m2.self_id() ); - // gvtime_type::value_type gvt; - - // gvt.first = 0; // group - // gvt.second += make_pair( 100, 1 ); - mess.value().mess = "Hello!"; mess.value().grp = 0; - mess.value().gvt.gvt[0][100] = 1; + mess.value().gvt.gvt[0][m1.self_id()] = 1; m1.Send( mess ); - mess.value().gvt.gvt[0][100] += 1; + mess.dest( r1.self_id() ); - mess.value().mess = "How are you?"; m1.Send( mess ); + // mess.value().gvt.gvt[0][m1.self_id()] += 1; + + // mess.value().mess = "How are you?"; + // m1.Send( mess ); + cnd.wait(); return 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2007-06-04 16:49:01
|
Revision: 1580 http://svn.sourceforge.net/complement/?rev=1580&view=rev Author: complement Date: 2007-06-04 09:49:00 -0700 (Mon, 04 Jun 2007) Log Message: ----------- dev Modified Paths: -------------- trunk/complement/explore/test/virtual_time/vtime.cc trunk/complement/explore/test/virtual_time/vtime.h trunk/complement/explore/test/virtual_time/vtime_main.cc Modified: trunk/complement/explore/test/virtual_time/vtime.cc =================================================================== --- trunk/complement/explore/test/virtual_time/vtime.cc 2007-06-01 16:58:36 UTC (rev 1579) +++ trunk/complement/explore/test/virtual_time/vtime.cc 2007-06-04 16:49:00 UTC (rev 1580) @@ -35,12 +35,13 @@ uint8_t n; __unpack( s, n ); while ( n-- > 0 ) { - vtime_proc_type v; + oid_type oid; + vtime_unit_type v; - __unpack( s, v.first ); - __unpack( s, v.second ); + __unpack( s, oid ); + __unpack( s, v ); - vt.push_back( v ); + vt[oid] = v; } } @@ -50,12 +51,13 @@ uint8_t n; __net_unpack( s, n ); while ( n-- > 0 ) { - vtime_proc_type v; + oid_type oid; + vtime_unit_type v; - __net_unpack( s, v.first ); - __net_unpack( s, v.second ); + __net_unpack( s, oid ); + __net_unpack( s, v ); - vt.push_back( v ); + vt[oid] = v; } } @@ -83,9 +85,9 @@ uint8_t n; __unpack( s, n ); while ( n-- > 0 ) { - gvt.push_back( vtime_group_type() ); - __unpack( s, gvt.back().first ); - gvt.back().second.unpack( s ); + group_type gid; + __unpack( s, gid ); + gvt[gid].unpack( s ); } } @@ -95,9 +97,9 @@ uint8_t n; __net_unpack( s, n ); while ( n-- > 0 ) { - gvt.push_back( vtime_group_type() ); - __net_unpack( s, gvt.back().first ); - gvt.back().second.net_unpack( s ); + group_type gid; + __net_unpack( s, gid ); + gvt[gid].net_unpack( s ); } } @@ -168,48 +170,31 @@ vtime_type operator -( const vtime_type& l, const vtime_type& r ) { - if ( r.empty() ) { - return l; - } + vtime_type tmp( r.begin(), r.end() ); - vtime_type vt; - vtime_type::const_iterator i = l.begin(); - vtime_type::const_iterator j = r.begin(); - - while ( i != l.end() && j != r.end() ) { - while ( i != l.end() && i->first < j->first ) { - vt.push_back( make_pair( i->first, i->second ) ); - ++i; + for ( vtime_type::iterator i = tmp.begin(); i != tmp.end(); ++i ) { + vtime_type::const_iterator p = l.find(i->first); + if ( p == l.end() || p->second < i->second ) { + throw range_error( "vtime different: right value grater then left" ); } - - while ( i != l.end() && j != r.end() && i->first == j->first ) { - if ( i->second < j->second ) { - throw range_error( "vtime different: right value grater then left" ); - } else if ( i->second > j->second ) { - vt.push_back( make_pair( i->first, i->second - j->second ) ); - } - ++i; - ++j; - } + i->second = p->second - i->second; } - if ( i == l.end() && j != r.end() ) { - throw range_error( "vtime different: right value grater then left" ); + for ( vtime_type::const_iterator i = l.begin(); i != l.end(); ++i ) { + vtime_type::iterator p = tmp.find(i->first); + if ( p == tmp.end() ) { + tmp[i->first] = i->second; + } } - while ( i != l.end() ) { - vt.push_back( make_pair( i->first, i->second ) ); - ++i; - } - - return vt; + return tmp; } vtime_type operator +( const vtime_type& l, const vtime_type& r ) { vtime_type tmp( l.begin(), l.end() ); - for ( i = r.begin(); i != r.end(); ++i ) { + for ( vtime_type::const_iterator i = r.begin(); i != r.end(); ++i ) { tmp[i->first] += i->second; } @@ -218,7 +203,7 @@ vtime_type& operator +=( vtime_type& l, const vtime_type& r ) { - for ( i = r.begin(); i != r.end(); ++i ) { + for ( vtime_type::const_iterator i = r.begin(); i != r.end(); ++i ) { l[i->first] += i->second; } @@ -230,43 +215,30 @@ { vtime_type tmp( l.begin(), l.end() ); - for ( i = r.begin(); i != r.end(); ++i ) { - pair<vtime_type::iterator,bool> p = tmp.insert(i->first); - if ( p->second == false ) { - *p->first = i->second; - } else { - *p->first = max( *p->first->second, i->second ); - } + for ( vtime_type::const_iterator i = r.begin(); i != r.end(); ++i ) { + tmp[i->first] = std::max( tmp[i->first], i->second ); } return tmp; } -vtime& vtime::operator +=( const vtime_proc_type& t ) +vtime& vtime::operator +=( const vtime_type::value_type& t ) { vt[t.first] += t.second; return *this; } -gvtime_type& operator +=( gvtime_type& gvt, const vtime_group_type& t ) +gvtime_type& operator +=( gvtime_type& gvt, gvtime_type::value_type& t ) { - gvtime_type::iterator i = gvt.begin(); + gvt[t.first] += t.second; - for ( ; i != gvt.end(); ++i ) { - if ( i->first > t.first ) { - break; - } else if ( i->first == t.first ) { - i->second += t.second; - return gvt; - } - } - gvt.insert( i, t ); return gvt; } -gvtime& gvtime::operator +=( const vtime_group_type& t ) +gvtime& gvtime::operator +=( const gvtime_type::value_type& t ) { - gvt += t; + gvt[t.first] += t.second; + return *this; } @@ -311,41 +283,7 @@ bool Proc::order_correct( const stem::Event_base<VTmess>& ev ) { - gvtime_type::const_iterator gr = ev.value().gvt.gvt.begin(); - gvtime_type::const_iterator ge = ev.value().gvt.gvt.end(); - - bool fine = false; - - group_type mgrp = ev.value().grp; - - for ( ; gr != ge; ++gr ) { // over all groups - if ( gr->first == mgrp ) { - if ( comp( lvt, mgrp, ev.src() ) + 1 != comp( ev.value().gvt.gvt, mgrp, ev.src() ) ) { - return false; - } - for ( gvtime_type::const_iterator i = lvt.begin(); i != lvt.end(); ++i ) { - if ( mgrp == i->first ) { - for ( vtime_type::const_iterator j = ) { - } - } - } - } else { - for ( gvtime_type::const_iterator i = lvt.begin(); i != lvt.end(); ++i ) { - if ( gr->first == i->first ) { - vtime vt_tmp = i->second + gr->second; - for ( gvtime_type::const_iterator j = vt.begin(); j != vt.end(); ++j ) { - if ( i->first == j->first ) { - if ( !(vt_tmp <= j->second) ) { - return false; - } - } - } - } - } - } - } - - return fine; + return false; } DEFINE_RESPONSE_TABLE( Proc ) @@ -356,7 +294,7 @@ namespace std { -ostream& operator <<( ostream& o, const vt::vtime_proc_type& v ) +ostream& operator <<( ostream& o, const vt::vtime_type::value_type& v ) { return o << "(" << v.first << "," << v.second << ")\n"; } @@ -370,7 +308,7 @@ return o << "]\n"; } -ostream& operator <<( ostream& o, const vt::vtime_group_type& v ) +ostream& operator <<( ostream& o, const vt::gvtime_type::value_type& v ) { o << v.first << ": " << v.second.vt; } Modified: trunk/complement/explore/test/virtual_time/vtime.h =================================================================== --- trunk/complement/explore/test/virtual_time/vtime.h 2007-06-01 16:58:36 UTC (rev 1579) +++ trunk/complement/explore/test/virtual_time/vtime.h 2007-06-04 16:49:00 UTC (rev 1580) @@ -51,13 +51,10 @@ { } vtime& operator =( const vtime& _vt ) - { - vt.clear(); - std::copy( _vt.vt.begin(), _vt.vt.end(), std::back_insert_iterator<vtime_type>(vt) ); - } + { vt = _vt.vt; } - bool operator ==( const vtime& r ) const - { return vt == r.vt; } + // bool operator ==( const vtime& r ) const + // { return vt == r.vt; } bool operator <=( const vtime& r ) const { return vt <= r.vt; } @@ -79,17 +76,20 @@ return *this; } - vtime& operator +=( const vtime_proc_type& ); + vtime& operator +=( const vtime_type::value_type& ); + + vtime_type::data_type& operator[]( const vtime_type::key_type k ) + { return vt[k]; } vtime_type vt; }; // typedef std::pair<group_type, vtime> vtime_group_type; // typedef std::list<vtime_group_type> gvtime_type; -typedef std::hash_map<group_type, vtime_type> gvtime_type; +typedef std::hash_map<group_type, vtime> gvtime_type; vtime_unit_type comp( const gvtime_type&, group_type, oid_type ); -gvtime_type& operator +=( gvtime_type&, const vtime_group_type& ); +gvtime_type& operator +=( gvtime_type&, const gvtime_type::value_type& ); struct gvtime : public stem::__pack_base @@ -106,12 +106,9 @@ { } gvtime& operator =( const gvtime& _gvt ) - { - gvt.clear(); - std::copy( _gvt.gvt.begin(), _gvt.gvt.end(), std::back_insert_iterator<gvtime_type>(gvt) ); - } + { gvt = _gvt.gvt; } - gvtime& operator +=( const vtime_group_type& ); + gvtime& operator +=( const gvtime_type::value_type& ); gvtime_type gvt; }; @@ -174,9 +171,9 @@ namespace std { -ostream& operator <<( ostream&, const vt::vtime_proc_type& ); +ostream& operator <<( ostream&, const vt::vtime_type::value_type& ); ostream& operator <<( ostream&, const vt::vtime_type& ); -ostream& operator <<( ostream&, const vt::vtime_group_type& ); +ostream& operator <<( ostream&, const vt::gvtime_type::value_type& ); ostream& operator <<( ostream&, const vt::gvtime_type& ); } // namespace std Modified: trunk/complement/explore/test/virtual_time/vtime_main.cc =================================================================== --- trunk/complement/explore/test/virtual_time/vtime_main.cc 2007-06-01 16:58:36 UTC (rev 1579) +++ trunk/complement/explore/test/virtual_time/vtime_main.cc 2007-06-04 16:49:00 UTC (rev 1580) @@ -24,18 +24,18 @@ mess.dest( 101 ); - vtime_group_type gvt; + // gvtime_type::value_type gvt; - gvt.first = 0; // group - gvt.second += make_pair( 100, 1 ); + // gvt.first = 0; // group + // gvt.second += make_pair( 100, 1 ); mess.value().mess = "Hello!"; mess.value().grp = 0; - mess.value().gvt += gvt; + mess.value().gvt.gvt[0][100] = 1; m1.Send( mess ); - mess.value().gvt += gvt; + mess.value().gvt.gvt[0][100] += 1; mess.value().mess = "How are you?"; m1.Send( mess ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <com...@us...> - 2007-06-01 16:58:48
|
Revision: 1579 http://svn.sourceforge.net/complement/?rev=1579&view=rev Author: complement Date: 2007-06-01 09:58:36 -0700 (Fri, 01 Jun 2007) Log Message: ----------- dev Modified Paths: -------------- trunk/complement/explore/test/virtual_time/vtime.cc trunk/complement/explore/test/virtual_time/vtime.h Modified: trunk/complement/explore/test/virtual_time/vtime.cc =================================================================== --- trunk/complement/explore/test/virtual_time/vtime.cc 2007-05-31 18:37:14 UTC (rev 1578) +++ trunk/complement/explore/test/virtual_time/vtime.cc 2007-06-01 16:58:36 UTC (rev 1579) @@ -207,143 +207,44 @@ vtime_type operator +( const vtime_type& l, const vtime_type& r ) { - if ( r.empty() ) { - return l; - } + vtime_type tmp( l.begin(), l.end() ); - if ( l.empty() ) { - return r; + for ( i = r.begin(); i != r.end(); ++i ) { + tmp[i->first] += i->second; } - vtime_type vt; - vtime_type::const_iterator i = l.begin(); - vtime_type::const_iterator j = r.begin(); - - while ( i != l.end() && j != r.end() ) { - while ( i != l.end() && i->first < j->first ) { - vt.push_back( make_pair( i->first, i->second ) ); - ++i; - } - - while ( i != l.end() && j != r.end() && i->first == j->first ) { - vt.push_back( make_pair( i->first, i->second + j->second ) ); - ++i; - ++j; - } - if ( i != l.end() ) { - while ( j != r.end() && j->first < i->first ) { - vt.push_back( make_pair( j->first, j->second ) ); - ++j; - } - } - } - - while ( i != l.end() ) { - vt.push_back( make_pair( i->first, i->second ) ); - ++i; - } - while ( j != r.end() ) { - vt.push_back( make_pair( j->first, j->second ) ); - ++j; - } - - return vt; + return tmp; } vtime_type& operator +=( vtime_type& l, const vtime_type& r ) { - if ( r.empty() ) { - return l; + for ( i = r.begin(); i != r.end(); ++i ) { + l[i->first] += i->second; } - if ( l.empty() ) { - l = r; - return l; - } - - vtime_type::iterator i = l.begin(); - vtime_type::const_iterator j = r.begin(); - - while ( i != l.end() && j != r.end() ) { - while ( i != l.end() && i->first < j->first ) { - ++i; - } - - while ( i != l.end() && j != r.end() && i->first == j->first ) { - i->second += j->second; - ++i; - ++j; - } - - while ( i != l.end() && j != r.end() && j->first < i->first ) { - l.insert( i, make_pair( j->first, j->second ) ); - ++i; - ++j; - } - } - - while ( j != r.end() ) { - l.push_back( make_pair( j->first, j->second ) ); - ++j; - } - return l; } // template <> vtime_type max( const vtime_type& l, const vtime_type& r ) { - if ( l.empty() ) { - return r; - } + vtime_type tmp( l.begin(), l.end() ); - if ( r.empty() ) { - return l; - } - - // here l and r non-empty - - vtime_type vt; - vtime_type::const_iterator i = l.begin(); - vtime_type::const_iterator j = r.begin(); - - while ( i != l.end() && j != r.end() ) { - while ( i != l.end() && i->first < j->first ) { - vt.push_back( make_pair( i->first, i->second ) ); - ++i; + for ( i = r.begin(); i != r.end(); ++i ) { + pair<vtime_type::iterator,bool> p = tmp.insert(i->first); + if ( p->second == false ) { + *p->first = i->second; + } else { + *p->first = max( *p->first->second, i->second ); } - - while ( i != l.end() && j != r.end() && i->first == j->first ) { - vt.push_back( make_pair( i->first, std::max( i->second, j->second ) ) ); - ++i; - ++j; - } } - while ( i != l.end() ) { - vt.push_back( make_pair( i->first, i->second ) ); - ++i; - } - while ( j != r.end() ) { - vt.push_back( make_pair( j->first, j->second ) ); - ++j; - } - - return vt; + return tmp; } vtime& vtime::operator +=( const vtime_proc_type& t ) { - vtime_type::iterator i = vt.begin(); + vt[t.first] += t.second; - for ( ; i != vt.end(); ++i ) { - if ( i->first > t.first ) { - break; - } else if ( i->first == t.first ) { - i->second += t.second; - return *this; - } - } - vt.insert( i, t ); return *this; } Modified: trunk/complement/explore/test/virtual_time/vtime.h =================================================================== --- trunk/complement/explore/test/virtual_time/vtime.h 2007-05-31 18:37:14 UTC (rev 1578) +++ trunk/complement/explore/test/virtual_time/vtime.h 2007-06-01 16:58:36 UTC (rev 1579) @@ -23,45 +23,6 @@ typedef uint32_t group_type; typedef std::hash_map<oid_type, vtime_unit_type> vtime_type; -template <class _InputIter1, class _InputIter2, class _OutputIter, - class _Compare> -_OutputIter vt_union(_InputIter1 __first1, _InputIter1 __last1, - _InputIter2 __first2, _InputIter2 __last2, - _OutputIter __result, _Equal __equal, _Aggregate __aggr ) -{ - - while ( __first1 != __last1 ) { - _InputIter1 __cur1 = __first1; - for ( ; __cur1 != __last1, ++__cur1 ) { - if ( __equal(*__cur1, *__first2) ) { - __aggr( __cur1, __first2, __result ); - ++__first2; - break; - } - ++__result; - } - if ( __cur1 == __last1 ) { - - } - } - - while (__first1 != __last1 && __first2 != __last2) { - if (__comp(*__first1, *__first2)) { - *__result = *__first1; - ++__first1; - } else if (__comp(*__first2, *__first1)) { - *__result = *__first2; - ++__first2; - } else { - *__result = *__first1; - ++__first1; - ++__first2; - } - ++__result; - } - return copy(__first2, __last2, copy(__first1, __last1, __result)); -} - // typedef std::pair<oid_type, vtime_unit_type> vtime_proc_type; // typedef std::list<vtime_proc_type> vtime_type; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |