gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash/cygnal/IO .cvsignore Buffer.hpp IO_Device...


From: Eric Hughes
Subject: [Gnash-commit] gnash/cygnal/IO .cvsignore Buffer.hpp IO_Device...
Date: Thu, 19 Jul 2007 02:23:41 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Eric Hughes <eh9>       07/07/19 02:23:41

Modified files:
        cygnal/IO      : .cvsignore Buffer.hpp IO_Device.hpp 
                         IO_Generator.cpp IO_Generator.hpp 
        cygnal/IO/test_support: Null_Device.hpp Null_Filter.hpp 
                                String_Generator.cpp 
                                String_Generator.hpp 
        cygnal/IO/unit_tests: Test_Service.cpp 
Added files:
        cygnal/IO      : Change_Log.txt IO.doxygen.txt 
        cygnal/IO/test_support: .cvsignore 
        cygnal/IO/unit_tests: .cvsignore 

Log message:
        

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/cygnal/IO/.cvsignore?cvsroot=gnash&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/gnash/cygnal/IO/Buffer.hpp?cvsroot=gnash&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/gnash/cygnal/IO/IO_Device.hpp?cvsroot=gnash&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/gnash/cygnal/IO/IO_Generator.cpp?cvsroot=gnash&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/gnash/cygnal/IO/IO_Generator.hpp?cvsroot=gnash&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/gnash/cygnal/IO/Change_Log.txt?cvsroot=gnash&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/gnash/cygnal/IO/IO.doxygen.txt?cvsroot=gnash&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/gnash/cygnal/IO/test_support/Null_Device.hpp?cvsroot=gnash&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/gnash/cygnal/IO/test_support/Null_Filter.hpp?cvsroot=gnash&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/gnash/cygnal/IO/test_support/String_Generator.cpp?cvsroot=gnash&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/gnash/cygnal/IO/test_support/String_Generator.hpp?cvsroot=gnash&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/gnash/cygnal/IO/test_support/.cvsignore?cvsroot=gnash&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/gnash/cygnal/IO/unit_tests/Test_Service.cpp?cvsroot=gnash&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/gnash/cygnal/IO/unit_tests/.cvsignore?cvsroot=gnash&rev=1.1

Patches:
Index: .cvsignore
===================================================================
RCS file: /sources/gnash/gnash/cygnal/IO/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- .cvsignore  17 Jul 2007 19:19:01 -0000      1.1
+++ .cvsignore  19 Jul 2007 02:23:40 -0000      1.2
@@ -1,3 +1,4 @@
+.svn
 .deps
 .libs
 Makefile

Index: Buffer.hpp
===================================================================
RCS file: /sources/gnash/gnash/cygnal/IO/Buffer.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- Buffer.hpp  1 Jul 2007 10:53:53 -0000       1.2
+++ Buffer.hpp  19 Jul 2007 02:23:40 -0000      1.3
@@ -85,6 +85,7 @@
 
        //-------------------------
        /**     \class Segment
+        *      \brief The unit of memory for a buffer, a single contiguous 
range of memory.
         */
        template< class Ch >
        struct Segment
@@ -248,6 +249,9 @@
        //--------------------------------------------------
        // Basic_Segment_Iterator_Base
        //--------------------------------------------------
+       /** \class Basic_Segment_Iterator_Base
+        *      \brief Base class for segment iterators, whose differences are 
const-vs.-non-const access.
+        */
        template< class Ch >
        class Basic_Segment_Iterator_Base
        {
@@ -393,7 +397,7 @@
        // E_AV_Buffer
        //--------------------------------------------------
        /**     \class E_AV_Buffer_Base
-        *      \brief 
+        *      \brief Base class for E_AV_Buffer containing everything not 
dependent on template parameters, which is almost everything.
         */
        template< class Ch = char >
        class E_AV_Buffer_Base
@@ -474,6 +478,9 @@
        //--------------------------------------------------
        // Basic_Buffer
        //--------------------------------------------------
+       /**     \class Basic_Buffer
+        *      \brief A wrapper around an Abstract_Buffer.
+        */
        template< class Ch >
        class Basic_Buffer
        {

Index: IO_Device.hpp
===================================================================
RCS file: /sources/gnash/gnash/cygnal/IO/IO_Device.hpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- IO_Device.hpp       10 Jul 2007 14:09:10 -0000      1.3
+++ IO_Device.hpp       19 Jul 2007 02:23:40 -0000      1.4
@@ -80,6 +80,8 @@
 
        //-------------------------
        /** \class Source
+        *      \brief A stream source with an asynchronous interface.
+        *              Abstract base class of an asynchronous I/O device.
         */
        class Source
                : public ACT::autonomous_act
@@ -98,10 +100,10 @@
 
        //-------------------------
        /** \class Sink
-        *      \brief Abstract base class of an asynchronous I/O device that 
acts as a sink.
-        *      A sink is also an action, in this case a write action to the 
device it represents.
+        *      \brief A stream sink with an asynchronous interface.
+        *              Abstract base class of an asynchronous I/O device.
+        *
         *
-        *      The write action
         */
        class Sink
                : public ACT::autonomous_act
@@ -121,6 +123,9 @@
        //-------------------------
        // SSource
        //-------------------------
+       /**     \class SSource
+        *      \brief A renaming wrapper around Source to allow two actions 
within Device.
+        */
        class SSource 
                : public Source 
        {
@@ -155,7 +160,12 @@
        //-------------------------
        // SSink
        //-------------------------
-       class SSink : public Sink {
+       /**     \class SSink
+        *      \brief A renaming wrapper around Sink to allow two actions 
within Device.
+        */
+       class SSink
+               : public Sink
+       {
        protected:
                virtual ACT::ACT_State sink_run( ACT::wakeup_listener * ) =0 ;
                inline ACT::ACT_State run( ACT::wakeup_listener * w ) { return 
sink_run( w ) ; }
@@ -223,6 +233,8 @@
        } ;
 
        //-------------------------
+       /** \b Obsolescent. Adapter for old-style sources.
+        */
        template< class Oldsource, class Action >
        class adapter_for_old_source
                : public Source

Index: IO_Generator.cpp
===================================================================
RCS file: /sources/gnash/gnash/cygnal/IO/IO_Generator.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- IO_Generator.cpp    10 Jul 2007 14:09:10 -0000      1.3
+++ IO_Generator.cpp    19 Jul 2007 02:23:40 -0000      1.4
@@ -21,33 +21,32 @@
 
 namespace IO {
        //-------------------------
-       Device_Adapter::
-       Device_Adapter( Device_Generator & x, Behavior_Factory & y ) 
+       IO_Generator::
+       IO_Generator( Old_Device_Generator & x, Behavior_Factory & y ) 
                : the_generator( x ),
-               the_behavior_factory( y )
+               the_behavior_factory( y ),
+               complete( false )
        {}
 
        //-------------------------
-       ACT::ACT_State
-       Device_Adapter::
-       run( ACT::wakeup_listener * w )
+       shared_ptr< ACT::basic_act >
+       IO_Generator::
+       next_action( ACT::wakeup_listener * w )
        {
+               if ( ! complete ) {
                the_generator( w ) ;
-               if ( the_generator.bad() ) return set_bad() ;
-               if ( the_generator.working() ) return set_ready() ;
+                       if ( the_generator.completed() ) {
                // Assert the_generator has a result ready for us.
-               
-               the_result = the_behavior_factory( the_generator.result() ) ;
-               return set_completed() ;
+                               return the_behavior_factory( 
the_generator.result() ) ;
        }
+                       // Assert no result is ready; return must be null
 
-       //-------------------------
-       ACT::act 
-       Device_Adapter::
-       result()
-       {
-               return the_result ;
+                       if ( the_generator.bad() ) {
+                               // A good generator is required for continued 
operation.
+                               set_completed() ;
+                       }
+               }
+               return shared_ptr< ACT::basic_act >() ;
        }
-
 
 } // end namespace IO

Index: IO_Generator.hpp
===================================================================
RCS file: /sources/gnash/gnash/cygnal/IO/IO_Generator.hpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- IO_Generator.hpp    10 Jul 2007 14:09:10 -0000      1.3
+++ IO_Generator.hpp    19 Jul 2007 02:23:40 -0000      1.4
@@ -30,7 +30,8 @@
 namespace IO {
        //-------------------------
        /**     \class Behavior
-        *      \brief 
+        *      \brief A behavior is a task whose constructor parameter is a 
Device.
+        *              When the Device is an internet socket, this task acts 
as a protocol handler.
         */
        class Behavior 
                : public ACT::autonomous_act
@@ -49,8 +50,25 @@
        typedef shared_ptr< ACT::autonomous_act > Behavior_Factory( shared_ptr< 
Device > x ) ;
 
        //-------------------------
+       /**     \class Old_Device_Generator
+        *      \brief Legacy generator.  On its way out.
+        *
+        */
+       class Old_Device_Generator
+               : public ACT::autonomous_act
+       {
+       public:
+
+               ///
+               virtual shared_ptr< IO::Device > result() =0 ;
+
+               void reset() {} ;
+       } ;
+
+       //-------------------------
        /**     \class Device_Generator
-        *      \brief A generator is an ACT whose result is a Device.
+        *      \brief A device generator is an input stream of devices.
+        *              Its interface is modeled after ACT::Generator.
         *
         *      The prototypical Generator is a bound listening socket.
         *      A successful call to accept(), yielding a new connection, 
triggers completion of the action.
@@ -60,42 +78,64 @@
         *      Subsequent devices will be made available after a reset and 
then another activation.
         */
        class Device_Generator
-               : public ACT::autonomous_act
        {
        public:
 
-               ///
-               virtual shared_ptr< IO::Device > result() =0 ;
-
-               void reset() {} ;
+               /// Next device in the generator stream.
+               /// \post
+               /// - return is a null shared pointer at the current end of the 
stream.
+               virtual shared_ptr< IO::Device > next_device() =0 ;
+
+               /// Query whether generator will ever return non-null again.
+               /// See also ACT::Generator::completed.
+               virtual bool completed() { return false ; }
+
+               /// Order a shutdown.
+               /// See also ACT::Generator::shutdown.
+               virtual void shutdown() =0 ;
        } ;
 
        //-------------------------
-       /**     \class Device_Adapter
+       /**     \class IO_Generator
+        *      \brief A device adapter converts a device generator into an 
action generator.
+        *              It does so by passing a device from our upstream 
generator to a behavior factory.
+        *              The result is the downstream result of our activity as 
an action generator.
+        *      
+        *      To use this class, create an instance and pass it to the 
constructor of ACT::Service.
+        *      The Service class provides for control under a scheduler.
+        *      The wakeup_listener function provided to next_action is that of 
this Service instance.
+        *
+        *      \invariant
+        *      - the_generator.bad() implies complete
         */
-       class Device_Adapter
-               : public ACT::Obsolete_Generator                // will rewrite 
as deriving from ACT::Generator
+       class IO_Generator
+               : public ACT::Generator
        {
-               /// We use shared_ptr here
-               Device_Generator & the_generator ;
+               /// Our device generator provides us a stream of device.
+               Old_Device_Generator & the_generator ;
 
-               ///
+               /// Our behavior factory provices bind-conversion of devices to 
actions.
                Behavior_Factory & the_behavior_factory ;
 
-               shared_ptr< ACT::autonomous_act > the_result ;
+               /// Operation of this generator is complete, initially false 
except for null generators.
+               bool complete ;
 
-       public:
-               ///
-               Device_Adapter( Device_Generator & x, Behavior_Factory & y ) ;
+               /// Since completion is one-way, perhaps this belongs in the 
base class.
+               inline void set_completed() { complete = true ; }
 
-               ///
-               ACT::ACT_State run( ACT::wakeup_listener * w ) ;
+               /// Overrides ACT::Generator::completed
+               bool completed() { return complete ; }
 
-               ///
-               ACT::act result() ;
+       public:
+               /// Ordinary constructor
+               IO_Generator( Old_Device_Generator & x, Behavior_Factory & y ) ;
 
-       } ;
+               /// Implements of ACT::Generator::next_action
+               virtual shared_ptr< ACT::basic_act > next_action( 
ACT::wakeup_listener * ) =0 ;
 
+               /// Implements of ACT::Generator::shutdown
+               void shutdown() ;
+       } ;
 
 } // end namespace IO
 

Index: test_support/Null_Device.hpp
===================================================================
RCS file: /sources/gnash/gnash/cygnal/IO/test_support/Null_Device.hpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- test_support/Null_Device.hpp        10 Jul 2007 14:09:10 -0000      1.3
+++ test_support/Null_Device.hpp        19 Jul 2007 02:23:41 -0000      1.4
@@ -28,6 +28,9 @@
 namespace IO {
 
        //-------------------------
+       /**     \class Null_Source
+        *      \brief An eternal source of empty buffers.
+        */
        class Null_Source
                : public Source
        {
@@ -49,6 +52,9 @@
        } ;
 
        //-------------------------
+       /** \class Null_Sink
+        *      \brief A sink which is also the bit bucket.
+        */
        class Null_Sink
                : public Sink
        {
@@ -74,6 +80,9 @@
        } ;
 
        //-------------------------
+       /**     \class Null_Device
+        *      \brief A device that never has input and write all output to 
the bit bucket.
+        */
        class Null_Device
                : public Device
        {

Index: test_support/Null_Filter.hpp
===================================================================
RCS file: /sources/gnash/gnash/cygnal/IO/test_support/Null_Filter.hpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- test_support/Null_Filter.hpp        10 Jul 2007 14:09:10 -0000      1.3
+++ test_support/Null_Filter.hpp        19 Jul 2007 02:23:41 -0000      1.4
@@ -30,6 +30,8 @@
 
        //-------------------------
        /** \class null_read_filter
+        *      \brief Should probably be named identity_read_filter.
+        *              A pass-through for read actions.
         */
        class null_read_filter
                : public Source

Index: test_support/String_Generator.cpp
===================================================================
RCS file: /sources/gnash/gnash/cygnal/IO/test_support/String_Generator.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- test_support/String_Generator.cpp   10 Jul 2007 14:09:10 -0000      1.3
+++ test_support/String_Generator.cpp   19 Jul 2007 02:23:41 -0000      1.4
@@ -21,15 +21,65 @@
 #include "String_Device.hpp"
 
 namespace IO {
-
        String_Generator::
        String_Generator()
-               : the_result( new String_Device( "" ) )
+               : complete( false )
        {
        }
 
        String_Generator::
        String_Generator( std::string initial )
+               : complete( false )
+       {
+               add_source( initial ) ;
+       }
+
+       void
+       String_Generator::
+       add_source( std::string x )
+       {
+               if ( complete ) {
+                       throw std::runtime_error( "May not add sources after 
shutdown" ) ;
+               }
+               the_list.push_front( x ) ;
+       }
+
+       void 
+       String_Generator::
+       shutdown()
+       {
+               complete = true ;
+       }
+
+       bool
+       String_Generator::
+       completed()
+       {
+               return complete ;
+       }
+
+       shared_ptr< IO::Device >
+       String_Generator::
+       next_device()
+       {
+               if ( the_list.empty() ) return shared_ptr< IO::Device >() ;
+               shared_ptr< IO::Device > x( new String_Device( the_list.back() 
) ) ;
+               the_list.pop_back() ;
+               return x ;
+       }
+
+} // end namespace IO
+
+namespace IO {
+
+       Old_String_Generator::
+       Old_String_Generator()
+               : the_result( new String_Device( "" ) )
+       {
+       }
+
+       Old_String_Generator::
+       Old_String_Generator( std::string initial )
                : the_result( new String_Device( "" ) )
        {
                add_source( initial ) ;
@@ -37,7 +87,7 @@
 
        ///
        ACT::ACT_State 
-       String_Generator::
+       Old_String_Generator::
        run( ACT::wakeup_listener * )
        {
                if ( the_queue.empty() ) return ACT::ACT_State( 
ACT::ACT_State::Ready ) ;
@@ -47,21 +97,21 @@
        }
 
        void
-       String_Generator::
+       Old_String_Generator::
        add_source( std::string x )
        {
                the_queue.push( x ) ;
        }
 
        shared_ptr< IO::Device >
-       String_Generator::
+       Old_String_Generator::
        result()
        {
                return the_result ;
        }
 
        void
-       String_Generator::
+       Old_String_Generator::
        reset()
        {
                if ( bad() ) return ;

Index: test_support/String_Generator.hpp
===================================================================
RCS file: /sources/gnash/gnash/cygnal/IO/test_support/String_Generator.hpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- test_support/String_Generator.hpp   10 Jul 2007 14:09:10 -0000      1.3
+++ test_support/String_Generator.hpp   19 Jul 2007 02:23:41 -0000      1.4
@@ -26,18 +26,23 @@
 
 #include <string>
 #include <queue>
+#include <list>
 #include <boost/shared_ptr.hpp>
 
 namespace IO {
 
        //-------------------------
+       /**     \class String_Generator
+        *      \brief A generator of string devices.
+        */
        class String_Generator
                : public Device_Generator
        {
                ///
-               std::queue< std::string > the_queue ;
+               std::list< std::string > the_list ;
 
-               shared_ptr< IO::Device > the_result ;
+               /// Received shutdown?
+               bool complete ;
 
        public:
                ///
@@ -49,6 +54,38 @@
                ///
                void add_source( std::string x ) ;
 
+               /// Implements Device_Generator::next_device.
+               shared_ptr< IO::Device > next_device() ;
+
+               /// Implements Device_Generator::shutdown.
+               void shutdown() ;
+
+               /// Implements Device_Generator::completed.
+               bool completed() ;
+       } ;
+
+       //-------------------------
+       /**     \class Old_String_Generator
+        *      \brief A legacy generator of string devices.
+        */
+       class Old_String_Generator
+               : public Old_Device_Generator
+       {
+               ///
+               std::queue< std::string > the_queue ;
+
+               shared_ptr< IO::Device > the_result ;
+
+       public:
+               ///
+               Old_String_Generator() ;
+
+               ///
+               Old_String_Generator( std::string initial ) ;
+
+               ///
+               void add_source( std::string x ) ;
+
                ///
                ACT::ACT_State run( ACT::wakeup_listener * ) ;
 

Index: unit_tests/Test_Service.cpp
===================================================================
RCS file: /sources/gnash/gnash/cygnal/IO/unit_tests/Test_Service.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- unit_tests/Test_Service.cpp 10 Jul 2007 14:09:11 -0000      1.3
+++ unit_tests/Test_Service.cpp 19 Jul 2007 02:23:41 -0000      1.4
@@ -22,6 +22,12 @@
 #include "../test_support/String_Generator.hpp"
 #include "ACT/Service.hpp"
 
+//-------------------------
+/**    \brief A behavior that does nothing.
+ *
+ *     This is different from ACT::no_action only in that it derives from 
IO::Behavior.
+ *     Well, it also has no tracker, but that's incidental.
+ */
 class Null_Behavior
        : public IO::Behavior
 {
@@ -37,9 +43,51 @@
        return shared_ptr< ACT::autonomous_act >( new Null_Behavior() ) ;
 }
 
+//-------------------------
 BOOST_AUTO_UNIT_TEST( Generator_Basic )
 {
        IO::String_Generator generator( "a" ) ;
+
+       BOOST_CHECK( ! generator.completed() ) ;
+       shared_ptr< IO::Device > device( generator.next_device() ) ;
+       BOOST_CHECK_MESSAGE( ! ! device, "Device should not be null." ) ;
+       // Check contents of source here. Should be "a".
+
+       // Internal queue is empty.
+       BOOST_CHECK( ! generator.completed() ) ;
+       device = generator.next_device() ;
+       // Left negation operator is on shared_ptr, right negation operator is 
on bool.
+       BOOST_CHECK_MESSAGE( ! device, "Saw non-null device pointer where null 
expected." ) ;
+       BOOST_CHECK( ! generator.completed() ) ;
+
+       // Add two more sources.
+       generator.add_source( "b" ) ;
+       generator.add_source( "c" ) ;
+
+       BOOST_CHECK( ! generator.completed() ) ;
+       device = generator.next_device() ;
+       BOOST_CHECK_MESSAGE( ! ! device, "Device should not be null." ) ;
+       // Check contents of source here. Should be "b".
+
+       BOOST_CHECK( ! generator.completed() ) ;
+       device = generator.next_device() ;
+       BOOST_CHECK_MESSAGE( ! ! device, "Device should not be null." ) ;
+       // Check contents of source here. Should be "c".
+
+       // Internal queue is empty again.
+       BOOST_CHECK( ! generator.completed() ) ;
+       device = generator.next_device() ;
+       BOOST_CHECK_MESSAGE( ! device, "Saw non-null device pointer where null 
expected." ) ;
+       BOOST_CHECK( ! generator.completed() ) ;
+
+       // Shut down
+       generator.shutdown() ;
+       BOOST_CHECK( generator.completed() ) ;
+}
+
+BOOST_AUTO_UNIT_TEST( Generator_Basic_Legacy )
+{
+       IO::Old_String_Generator generator( "a" ) ;
        generator.add_source( "b" ) ;
        generator.add_source( "c" ) ;
 
@@ -72,7 +120,7 @@
 
 BOOST_AUTO_UNIT_TEST( Service_Basic )
 {
-       IO::String_Generator x( "" ) ;
+       IO::Old_String_Generator x( "" ) ;
        x.add_source( "" ) ;
        x.add_source( "" ) ;
 

Index: Change_Log.txt
===================================================================
RCS file: Change_Log.txt
diff -N Change_Log.txt
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ Change_Log.txt      19 Jul 2007 02:23:40 -0000      1.1
@@ -0,0 +1,16 @@
+Change Log for GNU Cygnal, Module IO
+====================================
+
+2007-07-18 Eric Hughes <address@hidden>
+       * IO_Generator.hpp: New interface class Device_Generator.
+       * test_support/String_Generator.[hc]pp: New class String_Generator, 
deriving from Device_Generator.
+       * unit_tests/Test_Service.cpp: New test Generator_Basic, exercising new 
String_Generator.
+
+2007-07-17 Eric Hughes <address@hidden>
+       * ../ACT/Service.hpp: Removed class Obsolete_Generator, only used here 
in IO.
+       * IO_Generator.[hc]pp: Renamed Device_Generator to 
Old_Device_Generator.  Device_Generator doesn't need to be an ACT.
+       * test_support/String_Generator.[hc]pp, unit_tests/Test_Service.cpp: 
Renamed String_Generator to Old_String_Generator.
+
+2007-07-12 Eric Hughes <address@hidden>
+       * IO_Generator.[hc]pp: Renamed Device_Adapter to IO_Generator.  Rewrote 
it to derive from ACT::Generator.
+       * 
Buffer.hpp,IO_Device.hpp,test_support/{Null_Device.hpp,Null_Filter.hpp,String_Generator.hpp},unit_tests/Test_Service.cpp:
 New doxygen comments
\ No newline at end of file

Index: IO.doxygen.txt
===================================================================
RCS file: IO.doxygen.txt
diff -N IO.doxygen.txt
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ IO.doxygen.txt      19 Jul 2007 02:23:41 -0000      1.1
@@ -0,0 +1,46 @@
+/**
+
+\page IO Module IO: Asynchronous I/O
+
+       The ACT environment has unique interface requirements for the control 
of asynchronous I/O.
+       The ordinary stream abstraction, for example, assumes full information 
about data availability,
+               which is either present or at end-of-file.
+       For an asynchronous stream, however, there's a third state of no 
current information,
+               frequently indicated by the return value "would block".
+       This distinction is at the core of the present module.
+
+\section s_IO_Elements Elements of the IO Module
+       - \b Devices. 
+               The central abstractions of this module are the unidirectional 
Source and Sink classes which combine to form a Device.
+               A Device instance, in this module, refers to a connection 
(which might be used as a stream),
+                       rather than to any specific hardware device.
+               In other words, it's a view of a device ignoring multiplexing, 
+                       as if its user had exclusive access to it and were 
using it for just one connection.
+               These are abstract interface classes, rather than simply model 
specifications, 
+                       in order to allow a Device user to operate with 
multiple Devices.
+               The immediate motivation for this choice is to enable automatic 
test of Device users.
+               A string device is present for this purpose.
+
+       - \b Device Generators and \b Behaviors.
+               Writing an internet server entails requests and responses over 
a network connection.
+               This module splits these into two concerns: generators and 
behaviors.
+               A generator encapsulates a facility that makes new connections, 
such as a server socket listening on a well-known port.
+               A behavior is the request/response interaction independent of 
the kind of I/O present.
+               A generator is a producer of Device instances; a behavior is 
their consumer.
+               Combining a generator and a kind of behavior yields a task 
generator that can initialize a service (see ACT::Service).
+
+       - \b Buffers.
+               The essence of efficient network I/O uses two elements: block 
interface rather than character interface,
+                       and a zero-copy discipline that necessitates 
scatter-gather primitives.
+               The present buffer combines a common way of interacting with 
memory chopped up into segments,
+                       each of which is a single continguous block of memory.  
        
+               There are two ways of viewing this memory: either as a sequence 
of segments or as a sequence of characters.
+               Buffers provide iterators to both.
+
+       - \b Streams.
+               A stream, in the present model, is primarily a means of using 
buffered input.
+               The present stream abstraction does not hide the 
segment-sequence underpinnings,
+                       but rather handles issues arising from asynchronous 
control,
+                       particular obtaining new input for an incomplete scan 
or parse.
+       
+ */

Index: test_support/.cvsignore
===================================================================
RCS file: test_support/.cvsignore
diff -N test_support/.cvsignore
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ test_support/.cvsignore     19 Jul 2007 02:23:41 -0000      1.1
@@ -0,0 +1,10 @@
+.svn
+.deps
+.libs
+Makefile
+Makefile.in
+*.lo
+*.la
+gnash.log
+gnash.sum
+site.exp

Index: unit_tests/.cvsignore
===================================================================
RCS file: unit_tests/.cvsignore
diff -N unit_tests/.cvsignore
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ unit_tests/.cvsignore       19 Jul 2007 02:23:41 -0000      1.1
@@ -0,0 +1,10 @@
+.svn
+.deps
+.libs
+Makefile
+Makefile.in
+*.lo
+*.la
+gnash.log
+gnash.sum
+site.exp




reply via email to

[Prev in Thread] Current Thread [Next in Thread]