CVSROOT: /sources/gnash Module name: gnash Changes by: Eric Hughes <eh9> 07/10/01 15:49:41
Modified files: cygnal/ACT : ACT.hpp Change_Log.txt Cygnal_Instances.cpp Handle.hpp Listen.hpp Scheduler.T.cpp Scheduler.hpp Scheduling_Queue.hpp cygnal/ACT/test_support: Supplied_Service.cpp cygnal/ACT/unit_tests: Test_ACT.cpp Log message: -- Cleaned up standard exception usage. -- Dereferenced some friend declarations that cannot take typedefs. -- Tightened up class keyword syntax. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/gnash/cygnal/ACT/ACT.hpp?cvsroot=gnash&r1=1.5&r2=1.6 http://cvs.savannah.gnu.org/viewcvs/gnash/cygnal/ACT/Change_Log.txt?cvsroot=gnash&r1=1.4&r2=1.5 http://cvs.savannah.gnu.org/viewcvs/gnash/cygnal/ACT/Cygnal_Instances.cpp?cvsroot=gnash&r1=1.4&r2=1.5 http://cvs.savannah.gnu.org/viewcvs/gnash/cygnal/ACT/Handle.hpp?cvsroot=gnash&r1=1.5&r2=1.6 http://cvs.savannah.gnu.org/viewcvs/gnash/cygnal/ACT/Listen.hpp?cvsroot=gnash&r1=1.1&r2=1.2 http://cvs.savannah.gnu.org/viewcvs/gnash/cygnal/ACT/Scheduler.T.cpp?cvsroot=gnash&r1=1.1&r2=1.2 http://cvs.savannah.gnu.org/viewcvs/gnash/cygnal/ACT/Scheduler.hpp?cvsroot=gnash&r1=1.4&r2=1.5 http://cvs.savannah.gnu.org/viewcvs/gnash/cygnal/ACT/Scheduling_Queue.hpp?cvsroot=gnash&r1=1.4&r2=1.5 http://cvs.savannah.gnu.org/viewcvs/gnash/cygnal/ACT/test_support/Supplied_Service.cpp?cvsroot=gnash&r1=1.1&r2=1.2 http://cvs.savannah.gnu.org/viewcvs/gnash/cygnal/ACT/unit_tests/Test_ACT.cpp?cvsroot=gnash&r1=1.4&r2=1.5 Patches: Index: ACT.hpp =================================================================== RCS file: /sources/gnash/gnash/cygnal/ACT/ACT.hpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -b -r1.5 -r1.6 --- ACT.hpp 18 Jul 2007 14:14:11 -0000 1.5 +++ ACT.hpp 1 Oct 2007 15:49:40 -0000 1.6 @@ -46,7 +46,7 @@ * - Ready. * The action spontaneously yielded control. * An immediate call to this action would immediately continue. - * - Waiting. + * - Would_Block. * The action returned because it would block otherwise. * An immediate call to this action is unlikely to do anything else. * - Action has finished. Index: Change_Log.txt =================================================================== RCS file: /sources/gnash/gnash/cygnal/ACT/Change_Log.txt,v retrieving revision 1.4 retrieving revision 1.5 diff -u -b -r1.4 -r1.5 --- Change_Log.txt 21 Jul 2007 17:51:20 -0000 1.4 +++ Change_Log.txt 1 Oct 2007 15:49:40 -0000 1.5 @@ -1,6 +1,14 @@ Change Log for GNU Cygnal, Module ACT ===================================== +2007-01-10 Eric Hughes <[EMAIL PROTECTED]> + * Cygnal_Instances.cpp: Added class keyword for explicit template instantiation. Replaced typedef in explicit instantiation with its referent. + * Handle.hpp: Replaced typedefs in friend declarations with their referents. + * Listen.hpp: Removed extraneous typename declaration. + * Scheduler.hpp: Added class keyword in a friend declaration. + * Scheduler.T.cpp: Added typename declaration in an auto variable declaration. + * Scheduling_Queue.hpp: Removed dummy template parameters in a friend declaration. Added a forward declaration. + 2007-07-21 Eric Hughes <[EMAIL PROTECTED]> * Handle.hpp: Changed operator declarations in Handled from references to values. * test_support/Supplied_Service.hpp: Changed auto_ptr to shared_ptr to enable implicit copy constructor. Index: Cygnal_Instances.cpp =================================================================== RCS file: /sources/gnash/gnash/cygnal/ACT/Cygnal_Instances.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -b -r1.4 -r1.5 --- Cygnal_Instances.cpp 10 Jul 2007 14:09:08 -0000 1.4 +++ Cygnal_Instances.cpp 1 Oct 2007 15:49:40 -0000 1.5 @@ -34,7 +34,9 @@ namespace ACT { // Explicit template instantiations. - template Basic_Scheduler< aspect::Null_Aspect_0 >::queue_type ; - template Basic_Scheduler< aspect::Null_Aspect_0 > ; + template class Scheduling_Queue< Basic_Scheduled_Item, wakeup_listener_allocated< Basic_Scheduler< aspect::Null_Aspect_0 > > > ; + // Was: + // template class Basic_Scheduler< aspect::Null_Aspect_0 >::queue_type ; + template class Basic_Scheduler< aspect::Null_Aspect_0 > ; } // end namespace ACT Index: Handle.hpp =================================================================== RCS file: /sources/gnash/gnash/cygnal/ACT/Handle.hpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -b -r1.5 -r1.6 --- Handle.hpp 21 Jul 2007 17:51:21 -0000 1.5 +++ Handle.hpp 1 Oct 2007 15:49:40 -0000 1.6 @@ -128,10 +128,16 @@ typedef Aspect< T, Handle_Registry_Leader > aspect_type ; /// The aspect class is a friend - friend class aspect_type ; + friend class Aspect< T, Handle_Registry_Leader > ; + // * Note that the following declaration does not work: + // * friend class aspect_type ; + // * A friend declaration must be an elaborated-type-specifier, and that doesn't include the use of typedefs. /// The cooperative Handled aspect is also a friend. - friend typename Handled< T, Aspect >::aspect_type ; + friend class Aspect< T, Handled< T, Aspect > > ; + // * Here's the intended declaration. + // * friend typename Handled< T, Aspect >::aspect_type ; + // * We've had to unpack the clean definition to satisfy the anti-typedef restriction. /// Type declaration of the class registry typedef Vector_with_Handle_Index< T *, Handle_Registry_Leader > vector_type ; @@ -196,7 +202,9 @@ typedef Aspect< T, Leader, Handle_Registry_Follower > aspect_type ; /// The aspect class is a friend - friend class aspect_type ; + friend class Aspect< T, Leader, Handle_Registry_Follower > ; + // Was: + // friend class aspect_type ; /// Marker class derived from Leader typedef typename Leader::handle_type::marker_type marker_type ; @@ -258,7 +266,9 @@ typedef Aspect< T, Handled > aspect_type ; /// The aspect class is a friend - friend class aspect_type ; + friend class Aspect< T, Handled > ; + // Was: + // friend class aspect_type ; private: /// Type declaration of the class registry Index: Listen.hpp =================================================================== RCS file: /sources/gnash/gnash/cygnal/ACT/Listen.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -b -r1.1 -r1.2 --- Listen.hpp 10 Jul 2007 14:09:08 -0000 1.1 +++ Listen.hpp 1 Oct 2007 15:49:40 -0000 1.2 @@ -98,7 +98,7 @@ typedef Scheduler::handle_type handle_type ; /// Type of the class registry of monitors - typedef typename Handle_Registry_Follower< boost::weak_ptr< Monitor >, Scheduler > follower_registry_type ; + typedef Handle_Registry_Follower< boost::weak_ptr< Monitor >, Scheduler > follower_registry_type ; /** A vector of monitors, indexed by Scheduler handles. * Index: Scheduler.T.cpp =================================================================== RCS file: /sources/gnash/gnash/cygnal/ACT/Scheduler.T.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -b -r1.1 -r1.2 --- Scheduler.T.cpp 10 Jul 2007 14:09:08 -0000 1.1 +++ Scheduler.T.cpp 1 Oct 2007 15:49:40 -0000 1.2 @@ -127,7 +127,7 @@ } // Assert the_queue is not empty - queue_type::pointer item = the_queue.top_ptr() ; + typename queue_type::pointer item = the_queue.top_ptr() ; ACT_State result = item -> the_action( the_queue.auxiliary_top() -> get() ) ; if ( result.working() ) { switch ( item -> action_type ) Index: Scheduler.hpp =================================================================== RCS file: /sources/gnash/gnash/cygnal/ACT/Scheduler.hpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -b -r1.4 -r1.5 --- Scheduler.hpp 10 Jul 2007 14:09:08 -0000 1.4 +++ Scheduler.hpp 1 Oct 2007 15:49:40 -0000 1.5 @@ -254,7 +254,7 @@ : public Scheduler { /// - friend Basic_Wakeup_Listener< Basic_Scheduler > ; + friend class Basic_Wakeup_Listener< Basic_Scheduler > ; /// The type of our internal queue. typedef Scheduling_Queue< Basic_Scheduled_Item, wakeup_listener_allocated< Basic_Scheduler > > queue_type ; Index: Scheduling_Queue.hpp =================================================================== RCS file: /sources/gnash/gnash/cygnal/ACT/Scheduling_Queue.hpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -b -r1.4 -r1.5 --- Scheduling_Queue.hpp 10 Jul 2007 14:09:08 -0000 1.4 +++ Scheduling_Queue.hpp 1 Oct 2007 15:49:40 -0000 1.5 @@ -98,6 +98,10 @@ } ; //------------------------- + // forward declaration for Scheduled_Item_Pointer + template< class T, class Aux > class Scheduling_Queue ; + + //------------------------- /** \class Scheduled_Item_Pointer * \brief A pointer into an item within a scheduling queue. * Since items within the underlying container of a queue move around, @@ -106,7 +110,7 @@ template< class T, class Aux > class Scheduled_Item_Pointer { - template< class T, class Aux > friend class Scheduling_Queue ; + template< class, class > friend class Scheduling_Queue ; size_t index ; @@ -151,7 +155,7 @@ class Scheduling_Queue { // friends - template< class T, class Aux > friend class Scheduled_Item_Pointer ; + template< class T1, class Aux1 > friend class Scheduled_Item_Pointer ; template< class S > friend class Basic_Wakeup_Listener ; /// The main queue for scheduled items. Index: test_support/Supplied_Service.cpp =================================================================== RCS file: /sources/gnash/gnash/cygnal/ACT/test_support/Supplied_Service.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -b -r1.1 -r1.2 --- test_support/Supplied_Service.cpp 10 Jul 2007 14:09:09 -0000 1.1 +++ test_support/Supplied_Service.cpp 1 Oct 2007 15:49:40 -0000 1.2 @@ -22,6 +22,7 @@ /// \brief A service that takes an outside supply of actions and supplies them as a service. #include "Supplied_Service.hpp" +#include <stdexcept> namespace ACT { shared_ptr< basic_act > @@ -45,7 +46,7 @@ Supplied_Generator:: add_task( shared_ptr< basic_act > x ) { - if ( ! active ) throw std::exception( "Not accepting new actions after shutdown" ) ; + if ( ! active ) throw std::runtime_error( "Not accepting new actions after shutdown" ) ; the_tasks.push_back( x ) ; } Index: unit_tests/Test_ACT.cpp =================================================================== RCS file: /sources/gnash/gnash/cygnal/ACT/unit_tests/Test_ACT.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -b -r1.4 -r1.5 --- unit_tests/Test_ACT.cpp 21 Jul 2007 17:51:21 -0000 1.4 +++ unit_tests/Test_ACT.cpp 1 Oct 2007 15:49:40 -0000 1.5 @@ -27,6 +27,8 @@ #include "ACT/test_support/Simple_Actions.hpp" #include "ACT/test_support/Listening_Actions.hpp" +#include <stdexcept> + using namespace ACT ; //-------------------------------------------------- @@ -59,7 +61,7 @@ // Note: // case 2 should never be called, since the guard for calling run requires that the action still be working } - throw std::exception( "Not Reached" ) ; + throw std::logic_error( "Not Reached" ) ; } } ; _______________________________________________ Gnash-commit mailing list Gnash-commit@gnu.org http://lists.gnu.org/mailman/listinfo/gnash-commit