diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2011-03-24 13:32:13 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2011-03-24 13:32:13 +0000 |
commit | 6e3ca7c91ae325a2eaefe8b7b1b5636a91a06d04 (patch) | |
tree | 301fec054a49366ac910f2907466fde8054fa6f7 /ACE/examples | |
parent | b344c17ae152f6df1d1da81e3b2a68e131a86d49 (diff) | |
download | ATCD-6e3ca7c91ae325a2eaefe8b7b1b5636a91a06d04.tar.gz |
Thu Mar 24 13:26:32 UTC 2011 Johnny Willemsen <jwillemsen@remedy.nl>
* examples/Bounded_Packet_Relay/BPR_Drivers.h:
* examples/Bounded_Packet_Relay/BPR_Drivers.cpp:
* examples/Bounded_Packet_Relay/BPR_Drivers_T.h:
* examples/Bounded_Packet_Relay/BPR_Drivers_T.cpp:
* examples/Bounded_Packet_Relay/Thread_Bounded_Packet_Relay.h:
* examples/Bounded_Packet_Relay/Thread_Bounded_Packet_Relay.cpp:
* examples/Bounded_Packet_Relay/bpr_thread.cpp:
* examples/Connection/misc/Connection_Handler.cpp:
* examples/DLL/Magazine.h:
* examples/DLL/Newsweek.h:
* examples/DLL/Today.h:
* examples/IPC_SAP/UPIPE_SAP/ex1.cpp:
* examples/IPC_SAP/UPIPE_SAP/ex2.cpp:
* examples/IPC_SAP/UPIPE_SAP/ex3.cpp:
* examples/Log_Msg/test_callback.cpp:
* examples/Log_Msg/test_log_msg.cpp:
* examples/Log_Msg/test_ostream.cpp:
* examples/Logger/simple-server/Logging_Acceptor.h:
* examples/Logger/simple-server/Logging_Handler.h:
* examples/Logger/simple-server/Reactor_Singleton.h:
* examples/Misc/test_trace.cpp:
* examples/NT_Service/main.cpp:
* examples/NT_Service/ntsvc.h:
* examples/NT_Service/ntsvc.cpp:
* examples/OS/Process/imore.cpp:
* examples/OS/Process/process.cpp:
* examples/QOS/Change_Receiver_FlowSpec/Fill_ACE_QoS.h:
* examples/QOS/Change_Receiver_FlowSpec/FlowSpec_Dbase.h:
* examples/QOS/Change_Receiver_FlowSpec/QoS_Signal_Handler.h:
* examples/QOS/Change_Receiver_FlowSpec/QoS_Util.h:
* examples/QOS/Change_Receiver_FlowSpec/Receiver_QoS_Event_Handler.h:
* examples/QOS/Change_Receiver_FlowSpec/Receiver_QoS_Event_Handler.cpp:
* examples/QOS/Change_Receiver_FlowSpec/Sender_QoS_Event_Handler.h:
* examples/QOS/Change_Receiver_FlowSpec/Sender_QoS_Event_Handler.cpp:
* examples/QOS/Change_Receiver_FlowSpec/receiver.cpp:
* examples/QOS/Change_Receiver_FlowSpec/sender.cpp:
* examples/QOS/Change_Sender_TSpec/Fill_ACE_QoS.h:
* examples/QOS/Change_Sender_TSpec/FlowSpec_Dbase.h:
* examples/QOS/Change_Sender_TSpec/QoS_Signal_Handler.h:
* examples/QOS/Change_Sender_TSpec/QoS_Util.h:
* examples/QOS/Change_Sender_TSpec/Receiver_QoS_Event_Handler.h:
* examples/QOS/Change_Sender_TSpec/Receiver_QoS_Event_Handler.cpp:
* examples/QOS/Change_Sender_TSpec/Sender_QoS_Event_Handler.h:
* examples/QOS/Change_Sender_TSpec/Sender_QoS_Event_Handler.cpp:
* examples/QOS/Change_Sender_TSpec/receiver.cpp:
* examples/QOS/Change_Sender_TSpec/sender.cpp:
* examples/QOS/Simple/Fill_ACE_QoS.h:
* examples/QOS/Simple/FlowSpec_Dbase.h:
* examples/QOS/Simple/QoS_Signal_Handler.h:
* examples/QOS/Simple/QoS_Util.h:
* examples/QOS/Simple/Receiver_QoS_Event_Handler.h:
* examples/QOS/Simple/Receiver_QoS_Event_Handler.cpp:
* examples/QOS/Simple/Sender_QoS_Event_Handler.h:
* examples/QOS/Simple/Sender_QoS_Event_Handler.cpp:
* examples/QOS/Simple/receiver.cpp:
* examples/QOS/Simple/sender.cpp:
* examples/Reactor/Misc/test_early_timeouts.cpp:
* examples/Reactor/Proactor/Aio_Platform_Test_C.cpp:
* examples/Reactor/Proactor/post_completions.cpp:
* examples/Reactor/Proactor/simple_test_proactor.cpp:
* examples/Reactor/Proactor/test_aiocb.cpp:
* examples/Reactor/Proactor/test_aiocb_ace.cpp:
* examples/Reactor/Proactor/test_aiosig.cpp:
* examples/Reactor/Proactor/test_aiosig_ace.cpp:
* examples/Reactor/Proactor/test_cancel.cpp:
* examples/Reactor/Proactor/test_end_event_loop.cpp:
* examples/Reactor/Proactor/test_multiple_loops.cpp:
* examples/Reactor/Proactor/test_proactor.cpp:
* examples/Reactor/Proactor/test_proactor2.cpp:
* examples/Reactor/Proactor/test_proactor3.cpp:
* examples/Reactor/Proactor/test_timeout.cpp:
* examples/Reactor/Proactor/test_timeout_st.cpp:
* examples/Reactor/Proactor/test_udp_proactor.cpp:
* examples/Reactor/WFMO_Reactor/APC.cpp:
* examples/Reactor/WFMO_Reactor/Abandoned.cpp:
* examples/Reactor/WFMO_Reactor/Console_Input.cpp:
* examples/Reactor/WFMO_Reactor/Directory_Changes.cpp:
* examples/Reactor/WFMO_Reactor/Exceptions.cpp:
* examples/Reactor/WFMO_Reactor/Handle_Close.cpp:
* examples/Reactor/WFMO_Reactor/Multithreading.cpp:
* examples/Reactor/WFMO_Reactor/Network_Events.cpp:
* examples/Reactor/WFMO_Reactor/Prerun_State_Changes.cpp:
* examples/Reactor/WFMO_Reactor/Registration.cpp:
* examples/Reactor/WFMO_Reactor/Registry_Changes.cpp:
* examples/Reactor/WFMO_Reactor/Removals.cpp:
* examples/Reactor/WFMO_Reactor/Suspended_Removals.cpp:
* examples/Reactor/WFMO_Reactor/Talker.cpp:
* examples/Reactor/WFMO_Reactor/Timeouts.cpp:
* examples/Reactor/WFMO_Reactor/Window_Messages.cpp:
* examples/Service_Configurator/Misc/main.cpp:
* examples/Threads/TSS_Data.h:
* examples/Threads/TSS_Obj.h:
* examples/Threads/TSS_Task.h:
* examples/Threads/future1.cpp:
* examples/Threads/future2.cpp:
* examples/Threads/process_manager.cpp:
* examples/Threads/task_five.cpp:
* examples/Threads/tss1.cpp:
* examples/Threads/tss2.cpp:
* examples/Timer_Queue/Custom_Handler.h:
* examples/Timer_Queue/Custom_Handler.cpp:
* examples/Timer_Queue/Thread_Timer_Queue_Custom_Handler_Test.h:
* examples/Timer_Queue/Thread_Timer_Queue_Custom_Handler_Test.cpp:
* examples/Timer_Queue/main_thread_custom_handler.cpp:
* examples/Web_Crawler/Command_Processor.h:
* examples/Web_Crawler/HTTP_URL.h:
* examples/Web_Crawler/Iterators.h:
* examples/Web_Crawler/Mem_Map_Stream.h:
* examples/Web_Crawler/Options.h:
* examples/Web_Crawler/URL.h:
* examples/Web_Crawler/URL_Addr.h:
* examples/Web_Crawler/URL_Status.h:
* examples/Web_Crawler/URL_Visitor.h:
* examples/Web_Crawler/URL_Visitor_Factory.h:
* examples/Web_Crawler/Web_Crawler.h:
* examples/Web_Crawler/main.cpp:
Converted to doxygen style of documentation
Diffstat (limited to 'ACE/examples')
116 files changed, 3203 insertions, 3387 deletions
diff --git a/ACE/examples/Bounded_Packet_Relay/BPR_Drivers.cpp b/ACE/examples/Bounded_Packet_Relay/BPR_Drivers.cpp index bc6984be3ef..38d50a014bd 100644 --- a/ACE/examples/Bounded_Packet_Relay/BPR_Drivers.cpp +++ b/ACE/examples/Bounded_Packet_Relay/BPR_Drivers.cpp @@ -1,27 +1,18 @@ -// $Id$ - -// ============================================================================ -// = LIBRARY -// examples -// -// = FILENAME -// BPR_Driver.cpp -// -// = DESCRIPTION -// This code builds an abstraction to factor out common code for -// the different implementations of the Timer_Queue. -// -// = AUTHORS -// Chris Gill <cdgill@cs.wustl.edu> and -// Douglas C. Schmidt <schmidt@cs.wustl.edu> -// -// Based on the Timer Queue Test example written by -// -// Carlos O'Ryan <coryan@cs.wustl.edu> and -// Douglas C. Schmidt <schmidt@cs.wustl.edu> and -// Sergio Flores-Gaitan <sergio@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file BPR_Drivers.cpp + * + * $Id$ + * + * This code builds an abstraction to factor out common code for + * the different implementations of the Timer_Queue. + * + * + * @author Chris Gill <cdgill@cs.wustl.edu> and Douglas C. Schmidt <schmidt@cs.wustl.edu> Based on the Timer Queue Test example written by Carlos O'Ryan <coryan@cs.wustl.edu> and Douglas C. Schmidt <schmidt@cs.wustl.edu> and Sergio Flores-Gaitan <sergio@cs.wustl.edu> + */ +//============================================================================= + #include "ace/OS_NS_sys_time.h" #include "BPR_Drivers.h" diff --git a/ACE/examples/Bounded_Packet_Relay/BPR_Drivers.h b/ACE/examples/Bounded_Packet_Relay/BPR_Drivers.h index f39a544c512..8c1ffdbb3b2 100644 --- a/ACE/examples/Bounded_Packet_Relay/BPR_Drivers.h +++ b/ACE/examples/Bounded_Packet_Relay/BPR_Drivers.h @@ -1,30 +1,20 @@ /* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// examples -// -// = FILENAME -// BPR_Drivers.h -// -// = DESCRIPTION -// This code builds abstractions to factor out common code from -// the different possible implementations of the Timer_Queue based -// bounded packet relay example. -// -// = AUTHORS -// Chris Gill <cdgill@cs.wustl.edu> and -// Douglas C. Schmidt <schmidt@cs.wustl.edu> -// -// Based on the Timer Queue Test example written by -// -// Carlos O'Ryan <coryan@cs.wustl.edu> and -// Douglas C. Schmidt <schmidt@cs.wustl.edu> and -// Sergio Flores-Gaitan <sergio@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file BPR_Drivers.h + * + * $Id$ + * + * This code builds abstractions to factor out common code from + * the different possible implementations of the Timer_Queue based + * bounded packet relay example. + * + * + * @author Chris Gill <cdgill@cs.wustl.edu> and Douglas C. Schmidt <schmidt@cs.wustl.edu> Based on the Timer Queue Test example written by Carlos O'Ryan <coryan@cs.wustl.edu> and Douglas C. Schmidt <schmidt@cs.wustl.edu> and Sergio Flores-Gaitan <sergio@cs.wustl.edu> + */ +//============================================================================= + #ifndef _BPR_DRIVERS_H_ #define _BPR_DRIVERS_H_ @@ -42,20 +32,22 @@ class Input_Device_Wrapper_Base; class Output_Device_Wrapper_Base; +/** + * @class Bounded_Packet_Relay + * + * @brief This class defines a packet relay abstraction for a + * transmission bounded external commands to start and end the + * transmission. The transmission may be bounded by the number + * of packets to send, the dration of the transmission, or any + * other factors. + * + * The relay abstraction implemented by this class registers a + * callback command with an input device wrapper, and relays + * input to an output device at a pace specified in the start + * transmission call. + */ class Bounded_Packet_Relay { - // = TITLE - // This class defines a packet relay abstraction for a - // transmission bounded external commands to start and end the - // transmission. The transmission may be bounded by the number - // of packets to send, the dration of the transmission, or any - // other factors. - // - // = DESCRIPTION - // The relay abstraction implemented by this class registers a - // callback command with an input device wrapper, and relays - // input to an output device at a pace specified in the start - // transmission call. public: // = Enumerates possible status values for a transmission. enum Transmission_Status @@ -74,214 +66,220 @@ public: DEFAULT_LWM = 0x7FFFFFFF }; + /// Command entry point type definition. typedef int (Bounded_Packet_Relay::*ACTION) (void *); - // Command entry point type definition. // = Initialization method + /// Constructor. Bounded_Packet_Relay (ACE_Thread_Manager *input_task_mgr, Input_Device_Wrapper_Base *input_wrapper, Output_Device_Wrapper_Base *output_wrapper); - // Constructor. + /// Destructor. virtual ~Bounded_Packet_Relay (void); - // Destructor. + /// Requests output be sent to output device. int send_input (void); - // Requests output be sent to output device. + /// Requests a transmission be started. int start_transmission (u_long packet_count, u_long arrival_period, int logging_level); - // Requests a transmission be started. + /// Requests a transmission be ended. int end_transmission (Transmission_Status status); - // Requests a transmission be ended. + /// Requests a report of statistics from the last transmission. int report_statistics (void); - // Requests a report of statistics from the last transmission. // = Command accessible entry points. + /// Public entry point to which to push input. int receive_input (void *); - // Public entry point to which to push input. // = Accessors and mutators for relay settings + /// Get high water mark for relay queue. ACE_UINT32 queue_hwm (void); - // Get high water mark for relay queue. + /// Set high water mark for relay queue. void queue_hwm (ACE_UINT32 hwm); - // Set high water mark for relay queue. + /// Get low water mark for relay queue. ACE_UINT32 queue_lwm (void); - // Get low water mark for relay queue. + /// Set low water mark for relay queue. void queue_lwm (ACE_UINT32 lwm); - // Set low water mark for relay queue. private: // = Concurrency Management. + /// flag for whether or not a transmission is active int is_active_; - // flag for whether or not a transmission is active + /// Thread manager for the input device task. ACE_Thread_Manager * input_task_mgr_; - // Thread manager for the input device task. + /// Pointer to the input device wrapper. Input_Device_Wrapper_Base * input_wrapper_; - // Pointer to the input device wrapper. + /// Pointer to the output device wrapper. Output_Device_Wrapper_Base * output_wrapper_; - // Pointer to the output device wrapper. + /// Queue used to buffer input messages. ACE_Message_Queue<ACE_SYNCH> queue_; - // Queue used to buffer input messages. + /// High water mark for relay queue. ACE_UINT32 queue_hwm_; - // High water mark for relay queue. + /// Low water mark for relay queue. ACE_UINT32 queue_lwm_; - // Low water mark for relay queue. + /// Lock for thread-safe synchronization of transmission startup and + /// termination. ACE_SYNCH_MUTEX transmission_lock_; - // Lock for thread-safe synchronization of transmission startup and - // termination. // = Transmission Statistics + /// Returns string corresponding to current status. const char *status_msg (void); - // Returns string corresponding to current status. + /// Number of transmissions sent. u_long transmission_number_; - // Number of transmissions sent. + /// Count of packets sent in the most recent transmission. u_long packets_sent_; - // Count of packets sent in the most recent transmission. + /// Status of the current or most recent transmission. Transmission_Status status_; - // Status of the current or most recent transmission. + /// Start time of the most recent transmission. ACE_Time_Value transmission_start_; - // Start time of the most recent transmission. + /// Ending time of the most recent transmission. ACE_Time_Value transmission_end_; - // Ending time of the most recent transmission. }; +/** + * @class Input_Device_Wrapper_Base + * + * @brief This class defines an abstract base class for an input device + * wrapper that hides the details of the specific device and + * provides a consistent message passing interface without + * knowing anything about the implementation of the input device + * or the message receiver. + * The abstract base class ctor takes a command template object + * that is instantiated with the correct receiver and action + * types. This command object is used to send newly created input + * messages to the receiver. + * The abstract base class is designed to operate in an active + * "push" mode, sending input data to the receiver whenever the + * data is ready. The underlying device may be active, notifying + * the wrapper when data is ready, or may be passive in which + * case the wrapper must rely on a reactive and/or polling + * mechanism. + * + * Derived classes are responsible for filling in concrete + * definitions for the abstract message creation method and the + * svc method. + */ class Input_Device_Wrapper_Base : public ACE_Task_Base { - // = TITLE - // This class defines an abstract base class for an input device - // wrapper that hides the details of the specific device and - // provides a consistent message passing interface without - // knowing anything about the implementation of the input device - // or the message receiver. - // - // The abstract base class ctor takes a command template object - // that is instantiated with the correct receiver and action - // types. This command object is used to send newly created input - // messages to the receiver. - // - // The abstract base class is designed to operate in an active - // "push" mode, sending input data to the receiver whenever the - // data is ready. The underlying device may be active, notifying - // the wrapper when data is ready, or may be passive in which - // case the wrapper must rely on a reactive and/or polling - // mechanism. - // - // = DESCRIPTION - // Derived classes are responsible for filling in concrete - // definitions for the abstract message creation method and the - // svc method. public: // = Initialization and termination methods. + /// Constructor. Input_Device_Wrapper_Base (ACE_Thread_Manager *input_task_mgr); - // Constructor. + /// Destructor. virtual ~Input_Device_Wrapper_Base (); - // Destructor. + /// Sets send input message command in the input device driver + /// object. int set_send_input_msg_cmd (ACE_Command_Base *send_input_msg_cmd); - // Sets send input message command in the input device driver - // object. + /// Sets period (in usecs) between when inputs are created. int set_input_period (u_long input_period); - // Sets period (in usecs) between when inputs are created. + /// Sets count of messages to send. int set_send_count (long count); - // Sets count of messages to send. + /** + * Requests that the input device stop sending messages and + * terminate its thread. Should return 1 if it will do so, 0 if it + * has already done so, or -1 if there is a problem doing so. + */ int request_stop (void); - // Requests that the input device stop sending messages and - // terminate its thread. Should return 1 if it will do so, 0 if it - // has already done so, or -1 if there is a problem doing so. + /// This method runs the input device loop in the new thread. virtual int svc (void); - // This method runs the input device loop in the new thread. + /// Provides an abstract interface to allow modifying device + /// settings. virtual int modify_device_settings (void *) = 0; - // Provides an abstract interface to allow modifying device - // settings. protected: + /// Creates a new message block, carrying data read from the + /// underlying input device. virtual ACE_Message_Block *create_input_message (void) = 0; - // Creates a new message block, carrying data read from the - // underlying input device. + /** + * Sends a newly created message block, carrying data read from the + * underlying input device, by passing a pointer to the message + * block to its command execution. + */ virtual int send_input_message (ACE_Message_Block *); - // Sends a newly created message block, carrying data read from the - // underlying input device, by passing a pointer to the message - // block to its command execution. + /// Send newly created input message. ACE_Command_Base *send_input_msg_cmd_; - // Send newly created input message. + /// Period between when input values are produced (usecs). u_long input_period_; - // Period between when input values are produced (usecs). + /// Reactor used to multiplex input streams, timeouts. ACE_Reactor reactor_; - // Reactor used to multiplex input streams, timeouts. + /// Flag to indicate whether or not input object is + /// (and should remain) active. int is_active_; - // Flag to indicate whether or not input object is - // (and should remain) active. + /// Count of messages to send before stopping (-1 indicates the + /// device should not stop). long send_count_; - // Count of messages to send before stopping (-1 indicates the - // device should not stop). + /// Currently remaining count of messages to send before stopping + /// (-1 indicates the device should not stop). long current_count_; - // Currently remaining count of messages to send before stopping - // (-1 indicates the device should not stop). }; +/** + * @class Output_Device_Wrapper_Base + * + * @brief This class defines an abstract base class for an output device + * wrapper that hides the details of the specific device and + * provides a consistent write method interface without knowing + * anything about the implementation. + * + * The abstract methods write_output_message () and + * modify_device_settings () are defined in derived classes to + * write the contents of the passed message out the underlying + * output device, and update device settings, respectively. + */ class Output_Device_Wrapper_Base { - // = TITLE - // This class defines an abstract base class for an output device - // wrapper that hides the details of the specific device and - // provides a consistent write method interface without knowing - // anything about the implementation. - // - // = DESCRIPTION - // The abstract methods write_output_message () and - // modify_device_settings () are defined in derived classes to - // write the contents of the passed message out the underlying - // output device, and update device settings, respectively. public: virtual ~Output_Device_Wrapper_Base (void); + /// Writes contents of the passed message block out to the underlying + /// output device. virtual int write_output_message (void *) = 0; - // Writes contents of the passed message block out to the underlying - // output device. + /// Provides an abstract interface to allow modifying device + /// settings. virtual int modify_device_settings (void *) = 0; - // Provides an abstract interface to allow modifying device - // settings. }; // include the templates diff --git a/ACE/examples/Bounded_Packet_Relay/BPR_Drivers_T.cpp b/ACE/examples/Bounded_Packet_Relay/BPR_Drivers_T.cpp index bc80ec0ea8f..2f6a78abcaa 100644 --- a/ACE/examples/Bounded_Packet_Relay/BPR_Drivers_T.cpp +++ b/ACE/examples/Bounded_Packet_Relay/BPR_Drivers_T.cpp @@ -1,27 +1,18 @@ -// $Id$ - -// ============================================================================ -// = LIBRARY -// examples -// -// = FILENAME -// BPR_Driver.cpp -// -// = DESCRIPTION -// This code builds an abstraction to factor out common code for -// the different implementations of the Timer_Queue. -// -// = AUTHORS -// Chris Gill <cdgill@cs.wustl.edu> and -// Douglas C. Schmidt <schmidt@cs.wustl.edu> -// -// Based on the Timer Queue Test example written by -// -// Carlos O'Ryan <coryan@cs.wustl.edu> and -// Douglas C. Schmidt <schmidt@cs.wustl.edu> and -// Sergio Flores-Gaitan <sergio@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file BPR_Drivers_T.cpp + * + * $Id$ + * + * This code builds an abstraction to factor out common code for + * the different implementations of the Timer_Queue. + * + * + * @author Chris Gill <cdgill@cs.wustl.edu> and Douglas C. Schmidt <schmidt@cs.wustl.edu> Based on the Timer Queue Test example written by Carlos O'Ryan <coryan@cs.wustl.edu> and Douglas C. Schmidt <schmidt@cs.wustl.edu> and Sergio Flores-Gaitan <sergio@cs.wustl.edu> + */ +//============================================================================= + #ifndef _BPR_DRIVER_T_CPP_ #define _BPR_DRIVER_T_CPP_ diff --git a/ACE/examples/Bounded_Packet_Relay/BPR_Drivers_T.h b/ACE/examples/Bounded_Packet_Relay/BPR_Drivers_T.h index 4d0ca6bdfb4..4de42942283 100644 --- a/ACE/examples/Bounded_Packet_Relay/BPR_Drivers_T.h +++ b/ACE/examples/Bounded_Packet_Relay/BPR_Drivers_T.h @@ -1,30 +1,20 @@ /* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// examples -// -// = FILENAME -// BPR_Drivers_T.h -// -// = DESCRIPTION -// This code factors out common class templates for use in -// the different possible implementations of the Timer_Queue -// based bounded packet relay example. -// -// = AUTHORS -// Chris Gill <cdgill@cs.wustl.edu> and -// Douglas C. Schmidt <schmidt@cs.wustl.edu> -// -// Based on the Timer Queue Test example written by -// -// Carlos O'Ryan <coryan@cs.wustl.edu> and -// Douglas C. Schmidt <schmidt@cs.wustl.edu> and -// Sergio Flores-Gaitan <sergio@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file BPR_Drivers_T.h + * + * $Id$ + * + * This code factors out common class templates for use in + * the different possible implementations of the Timer_Queue + * based bounded packet relay example. + * + * + * @author Chris Gill <cdgill@cs.wustl.edu> and Douglas C. Schmidt <schmidt@cs.wustl.edu> Based on the Timer Queue Test example written by Carlos O'Ryan <coryan@cs.wustl.edu> and Douglas C. Schmidt <schmidt@cs.wustl.edu> and Sergio Flores-Gaitan <sergio@cs.wustl.edu> + */ +//============================================================================= + #ifndef _BPR_DRIVERS_T_H_ #define _BPR_DRIVERS_T_H_ @@ -39,132 +29,138 @@ class Input_Device_Wrapper_Base; class Output_Device_Wrapper_Base; +/** + * @class Bounded_Packet_Relay_Driver + * + * @brief This abstract base class provides a simple abstraction for a + * test driver for the bounded packet relay example. + * + * This is the place where the common code to test the different + * implementations of the timer queue resides. This class has + * the logic for the parse_commands () method, the run (), + * read_input () and get_next_request () methods. Subclasses can + * override these methods if there is some logic that is specific + * to that implementation. + */ template <class TQ> class Bounded_Packet_Relay_Driver { - // = TITLE - // This abstract base class provides a simple abstraction for a - // test driver for the bounded packet relay example. - // - // = DESCRIPTION - // This is the place where the common code to test the different - // implementations of the timer queue resides. This class has - // the logic for the parse_commands () method, the run (), - // read_input () and get_next_request () methods. Subclasses can - // override these methods if there is some logic that is specific - // to that implementation. public: + /// Constructor. Bounded_Packet_Relay_Driver (void); - // Constructor. + /// Destructor. virtual ~Bounded_Packet_Relay_Driver (void); - // Destructor. + /// Breaks up the input string buffer into pieces and executes the + /// appropriate method to handle that operation. virtual int parse_commands (const char *buf); - // Breaks up the input string buffer into pieces and executes the - // appropriate method to handle that operation. + /** + * This is the main entry point for the driver. The user of the + * class should normally invoke this method. Returns 0 when + * successful, or 0 otherwise. + */ virtual int run (void); - // This is the main entry point for the driver. The user of the - // class should normally invoke this method. Returns 0 when - // successful, or 0 otherwise. + /// This internal method gets the next request from the user. + /// Returns -1 when user wants to exit. Returns 0 otherwise. virtual int get_next_request (void); - // This internal method gets the next request from the user. - // Returns -1 when user wants to exit. Returns 0 otherwise. + /** + * Reads input from the user into the buffer <buf> with a maximum of + * <bufsiz> bytes. Returns the amount of bytes actually read + * Otherwise, a -1 is returned and errno is set to indicate the + * error. + */ virtual ssize_t read_input (char *buf, size_t bufsiz); - // Reads input from the user into the buffer <buf> with a maximum of - // <bufsiz> bytes. Returns the amount of bytes actually read - // Otherwise, a -1 is returned and errno is set to indicate the - // error. + /// Prints the user interface for the driver to STDERR. virtual int display_menu (void)=0; - // Prints the user interface for the driver to STDERR. + /// Initializes values and operations for the driver. virtual int init (void)=0; - // Initializes values and operations for the driver. + /// Get count of packets to send in a transmission. u_long packet_count (void); - // Get count of packets to send in a transmission. + /// Set count of packets to send in a transmission. void packet_count (u_long pc); - // Set count of packets to send in a transmission. + /// Get rate at which input packets are to arrive. u_long arrival_period (void); - // Get rate at which input packets are to arrive. + /// Set rate at which input packets are to arrive. void arrival_period (u_long ap); - // Set rate at which input packets are to arrive. + /// Get rate at which packets are to be relayed (usec). u_long send_period (void); - // Get rate at which packets are to be relayed (usec). + /// Set rate at which packets are to be relayed (usec). void send_period (u_long sp); - // Set rate at which packets are to be relayed (usec). + /// Get limit on the duration of the transmission (usec). u_long duration_limit (void); - // Get limit on the duration of the transmission (usec). + /// Set limit on the duration of the transmission (usec). void duration_limit (u_long dl); - // Set limit on the duration of the transmission (usec). + /// Get logging level. int logging_level (void); - // Get logging level. + /// Set logging level. void logging_level (int ll); - // Set logging level. protected: // = Major Driver Mechanisms + /// Timer queue for transmission timeouts. TQ timer_queue_; - // Timer queue for transmission timeouts. // = Set of commands to be executed. + /// Set packet count command. ACE_Command_Base *packet_count_cmd_; - // Set packet count command. + /// Set arrival period command. ACE_Command_Base *arrival_period_cmd_; - // Set arrival period command. + /// Set transmit period command. ACE_Command_Base *transmit_period_cmd_; - // Set transmit period command. + /// Set duration limit command. ACE_Command_Base *duration_limit_cmd_; - // Set duration limit command. + /// Set logging level command. ACE_Command_Base *logging_level_cmd_; - // Set logging level command. + /// Run transmission command. ACE_Command_Base *run_transmission_cmd_; - // Run transmission command. + /// Cancel transmission command. ACE_Command_Base *cancel_transmission_cmd_; - // Cancel transmission command. + /// Report statistics command. ACE_Command_Base *report_stats_cmd_; - // Report statistics command. + /// Shut down the driver. ACE_Command_Base *shutdown_cmd_; - // Shut down the driver. private: + /// Count of packets to send in a transmission. u_long packet_count_; - // Count of packets to send in a transmission. + /// Rate at which input packets are to arrive. u_long arrival_period_; - // Rate at which input packets are to arrive. + /// Rate at which packets are to be relayed (usec). u_long send_period_; - // Rate at which packets are to be relayed (usec). + /// Limit on the duration of the transmission (usec). u_long duration_limit_; - // Limit on the duration of the transmission (usec). + /// Logging level. int logging_level_; - // Logging level. }; #if defined (ACE_TEMPLATES_REQUIRE_SOURCE) diff --git a/ACE/examples/Bounded_Packet_Relay/Thread_Bounded_Packet_Relay.cpp b/ACE/examples/Bounded_Packet_Relay/Thread_Bounded_Packet_Relay.cpp index 2b8d2495175..27a0a715842 100644 --- a/ACE/examples/Bounded_Packet_Relay/Thread_Bounded_Packet_Relay.cpp +++ b/ACE/examples/Bounded_Packet_Relay/Thread_Bounded_Packet_Relay.cpp @@ -1,27 +1,17 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// examples -// -// = FILENAME -// Thread_Bounded_Packet_Relay.cpp -// -// = DESCRIPTION -// Method definitions for the threaded-bounded packet relay class. -// -// = AUTHORS -// Chris Gill <cdgill@cs.wustl.edu> and -// Douglas C. Schmidt <schmidt@cs.wustl.edu> -// -// Based on the Timer Queue Test example written by -// -// Carlos O'Ryan <coryan@cs.wustl.edu> and -// Douglas C. Schmidt <schmidt@cs.wustl.edu> and -// Sergio Flores-Gaitan <sergio@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file Thread_Bounded_Packet_Relay.cpp + * + * $Id$ + * + * Method definitions for the threaded-bounded packet relay class. + * + * + * @author Chris Gill <cdgill@cs.wustl.edu> and Douglas C. Schmidt <schmidt@cs.wustl.edu> Based on the Timer Queue Test example written by Carlos O'Ryan <coryan@cs.wustl.edu> and Douglas C. Schmidt <schmidt@cs.wustl.edu> and Sergio Flores-Gaitan <sergio@cs.wustl.edu> + */ +//============================================================================= + #include "ace/OS_NS_string.h" #include "ace/OS_NS_sys_time.h" diff --git a/ACE/examples/Bounded_Packet_Relay/Thread_Bounded_Packet_Relay.h b/ACE/examples/Bounded_Packet_Relay/Thread_Bounded_Packet_Relay.h index ccd5782b487..5d28cf5d88b 100644 --- a/ACE/examples/Bounded_Packet_Relay/Thread_Bounded_Packet_Relay.h +++ b/ACE/examples/Bounded_Packet_Relay/Thread_Bounded_Packet_Relay.h @@ -1,29 +1,19 @@ /* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// examples -// -// = FILENAME -// Thread_Bounded_Packet_Relay.h -// -// = DESCRIPTION -// This code provides a thread based implementation -// of the bounded packet relay example. -// -// = AUTHORS -// Chris Gill <cdgill@cs.wustl.edu> and -// Douglas C. Schmidt <schmidt@cs.wustl.edu> -// -// Based on the Timer Queue Test example written by -// -// Carlos O'Ryan <coryan@cs.wustl.edu> and -// Douglas C. Schmidt <schmidt@cs.wustl.edu> and -// Sergio Flores-Gaitan <sergio@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file Thread_Bounded_Packet_Relay.h + * + * $Id$ + * + * This code provides a thread based implementation + * of the bounded packet relay example. + * + * + * @author Chris Gill <cdgill@cs.wustl.edu> and Douglas C. Schmidt <schmidt@cs.wustl.edu> Based on the Timer Queue Test example written by Carlos O'Ryan <coryan@cs.wustl.edu> and Douglas C. Schmidt <schmidt@cs.wustl.edu> and Sergio Flores-Gaitan <sergio@cs.wustl.edu> + */ +//============================================================================= + #ifndef _THREAD_BOUNDED_PACKET_RELAY_H_ #define _THREAD_BOUNDED_PACKET_RELAY_H_ @@ -57,24 +47,25 @@ typedef ACE_Thread_Timer_Queue_Adapter<Timer_Heap> // Forward declaration. class Thread_Bounded_Packet_Relay_Driver; +/** + * @class Text_Input_Device_Wrapper + * + * @brief Defines a wrapper for a simple active looping text input + * pseudo-device. + * + * The wrapper is an active object, running in its own thread, + * and uses a reactor to generate timeouts. When a timeout + * occurs, the wrapper calls its concrete message creation + * method. The wrapper then calls its base class message send + * method to forward the message to the receiver. + * A more sophisticated version of this class would use the + * reactive capabilities as well as the timeout generating + * capabilities of the reactor, multiplexing several input + * streams. Comments to this effect appear in the definition of + * the event loop method. + */ class Text_Input_Device_Wrapper : public Input_Device_Wrapper_Base { - // = TITLE - // Defines a wrapper for a simple active looping text input - // pseudo-device. - // - // = DESCRIPTION - // The wrapper is an active object, running in its own thread, - // and uses a reactor to generate timeouts. When a timeout - // occurs, the wrapper calls its concrete message creation - // method. The wrapper then calls its base class message send - // method to forward the message to the receiver. - // - // A more sophisticated version of this class would use the - // reactive capabilities as well as the timeout generating - // capabilities of the reactor, multiplexing several input - // streams. Comments to this effect appear in the definition of - // the event loop method. public: // = Enumerated logging level flags @@ -82,51 +73,55 @@ public: LOG_MSGS_CREATED = 1}; // = Initialization and termination methods. + /// Constructor. Text_Input_Device_Wrapper (ACE_Thread_Manager *input_task_mgr, size_t read_length, const char* text, int logging = 0); - // Constructor. + /// Destructor. virtual ~Text_Input_Device_Wrapper (void); - // Destructor. + /** + * Modifies device settings based on passed pointer to a u_long. + * Turns logging on if u_long is non-zero, off if u_long is zero, + * and does nothing if the pointer is null. + */ virtual int modify_device_settings (void *logging); - // Modifies device settings based on passed pointer to a u_long. - // Turns logging on if u_long is non-zero, off if u_long is zero, - // and does nothing if the pointer is null. protected: + /// Creates a new message block, carrying data read from the + /// underlying input device. virtual ACE_Message_Block *create_input_message (void); - // Creates a new message block, carrying data read from the - // underlying input device. private: + /// Length of the buffer into which to "read". size_t read_length_; - // Length of the buffer into which to "read". + /// Text to "read" into the buffer. const char *text_; - // Text to "read" into the buffer. + /// Index into the string. size_t index_; - // Index into the string. + /// This value is 0 if logging is turned off, non-zero otherwise int logging_; - // This value is 0 if logging is turned off, non-zero otherwise + /// This value holds a count of packets created. u_long packet_count_; - // This value holds a count of packets created. }; +/** + * @class Text_Output_Device_Wrapper + * + * @brief Implements a simple wrapper for a output pseudo-device. + * + * Data from the passed output message is printed to the standard + * output stream, if logging is turned on. + */ class Text_Output_Device_Wrapper : public Output_Device_Wrapper_Base { - // = TITLE - // Implements a simple wrapper for a output pseudo-device. - // - // = DESCRIPTION - // Data from the passed output message is printed to the standard - // output stream, if logging is turned on. public: // = Enumerated logging level flags @@ -134,115 +129,120 @@ public: LOG_MSGS_RCVD = 2, PRINT_MSGS_RCVD = 4}; + /// Default constructor. Text_Output_Device_Wrapper (int logging = 0); - // Default constructor. // = Command Accessible Entry Points + /// Consumes and possibly prints out the passed message. virtual int write_output_message (void *message); - // Consumes and possibly prints out the passed message. + /** + * Modifies device settings based on passed pointer to a u_long. + * Turns logging on if u_long is non-zero, off if u_long is zero, + * and does nothing if the pointer is null. + */ virtual int modify_device_settings (void *logging); - // Modifies device settings based on passed pointer to a u_long. - // Turns logging on if u_long is non-zero, off if u_long is zero, - // and does nothing if the pointer is null. private: + /// This value holds the logging level. int logging_; - // This value holds the logging level. + /// This value holds a count of packets received. u_long packet_count_; - // This value holds a count of packets received. }; +/** + * @class User_Input_Task + * + * @brief Read user actions on the Timer_Queue from stdin. + * + * This class reads user input from stdin. The commands allow + * the control of a Timer_Queue, which is dispatched by another + * thread. + */ class User_Input_Task : public ACE_Task_Base { - // = TITLE - // Read user actions on the Timer_Queue from stdin. - // - // = DESCRIPTION - // This class reads user input from stdin. The commands allow - // the control of a Timer_Queue, which is dispatched by another - // thread. public: // = Trait for command accessible entry points. typedef int (User_Input_Task::*ACTION) (void *); + /// Constructor. User_Input_Task (Bounded_Packet_Relay *relay, Thread_Timer_Queue *queue, Thread_Bounded_Packet_Relay_Driver &timer_queue_driver); - // Constructor. + /// Destructor. virtual ~User_Input_Task (void); - // Destructor. + /// This method runs the event loop in the new thread. virtual int svc (void); - // This method runs the event loop in the new thread. // = Some helper methods. + /// Sets the number of packets for the next transmission. int set_packet_count (void *); - // Sets the number of packets for the next transmission. + /// Sets the input device packet arrival period (usecs) for the next + /// transmission. int set_arrival_period (void *); - // Sets the input device packet arrival period (usecs) for the next - // transmission. + /// Sets the period between output device sends (usecs) for the next + /// transmission. int set_send_period (void *); - // Sets the period between output device sends (usecs) for the next - // transmission. + /// Sets a limit on the transmission duration (usecs). int set_duration_limit (void *); - // Sets a limit on the transmission duration (usecs). + /// Sets logging level (0 or 1) for output device for the next + /// transmission. int set_logging_level (void *); - // Sets logging level (0 or 1) for output device for the next - // transmission. + /// Runs the next transmission (if one is not in progress). int run_transmission (void *); - // Runs the next transmission (if one is not in progress). + /// Ends the current transmission (if one is in progress). int end_transmission (void *); - // Ends the current transmission (if one is in progress). + /// Reports statistics for the previous transmission (if one is not + /// in progress). int report_stats (void *); - // Reports statistics for the previous transmission (if one is not - // in progress). + /// Shuts down the task. int shutdown (void *); - // Shuts down the task. + /// Helper method: clears all timers. int clear_all_timers (void); - // Helper method: clears all timers. private: + /// How many microseconds are in a second. const int usecs_; - // How many microseconds are in a second. + /// The bounded packet relay. Bounded_Packet_Relay *relay_; - // The bounded packet relay. + /// The timer queue implementation. Thread_Timer_Queue *queue_; - // The timer queue implementation. + /// The thread timer queue test driver. Thread_Bounded_Packet_Relay_Driver &driver_; - // The thread timer queue test driver. }; +/** + * @class BPR_Handler_Base + * + * @brief Base event handler class for bounded packet relay example. + * + * The base class provides a helper method that derived classes + * can register as a deferred execution callback that will cancel + * all timers in the underlying timer queue, and then delete "this". + */ class BPR_Handler_Base : public ACE_Event_Handler { - // = TITLE - // Base event handler class for bounded packet relay example. - // - // = DESCRIPTION - // The base class provides a helper method that derived classes - // can register as a deferred execution callback that will cancel - // all timers in the underlying timer queue, and then delete "this". - // public: // = Trait for command accessible entry points. @@ -250,125 +250,131 @@ public: typedef int (BPR_Handler_Base::*ACTION) (void *); + /// Constructor. BPR_Handler_Base (Bounded_Packet_Relay &relay, Thread_Timer_Queue &queue); - // Constructor. + /// Destructor. virtual ~BPR_Handler_Base (void); - // Destructor. // = Command accessible entry points. + /// Helper method: clears all timers. virtual int clear_all_timers (void *); - // Helper method: clears all timers. protected: + /// Stores a reference to the relay object on which to invoke + /// the appropritate calls when the timer expires. Bounded_Packet_Relay &relay_; - // Stores a reference to the relay object on which to invoke - // the appropritate calls when the timer expires. + /// Store a reference to the timer queue, in which to re-register + /// the send timer and handler if there are still sends to perform. Thread_Timer_Queue &queue_; - // Store a reference to the timer queue, in which to re-register - // the send timer and handler if there are still sends to perform. }; class Send_Handler; +/** + * @class Send_Handler + * + * @brief Event handler for message send timeout events. + * + * The <handle_timeout> hook method calls the relay's send + * method and decrements its count of messages to send. + * If there are still messages to send, it re-registers itself + * with the timer queue. Otherwise it calls the relay's end + * transmission method, and registers a deferred execution + * callback to clear the timer queue, and then delete "this". + */ class Send_Handler : public BPR_Handler_Base { - // = TITLE - // Event handler for message send timeout events. - // - // = DESCRIPTION - // The <handle_timeout> hook method calls the relay's send - // method and decrements its count of messages to send. - // If there are still messages to send, it re-registers itself - // with the timer queue. Otherwise it calls the relay's end - // transmission method, and registers a deferred execution - // callback to clear the timer queue, and then delete "this". public: // = Trait for command accessible entry points. typedef int (Send_Handler::*ACTION) (void *); + /// Constructor. Send_Handler (u_long send_count, const ACE_Time_Value &duration, Bounded_Packet_Relay &relay, Thread_Timer_Queue &queue, Thread_Bounded_Packet_Relay_Driver &driver); - // Constructor. + /// Destructor. virtual ~Send_Handler (void); - // Destructor. + /// Call back hook. virtual int handle_timeout (const ACE_Time_Value ¤t_time, const void *arg); - // Call back hook. + /// Cancellation hook. virtual int cancelled (void); - // Cancellation hook. // = Command accessible entry points. + /// Helper method: re-registers this handler. virtual int reregister (void *timeout); - // Helper method: re-registers this handler. private: + /// Count of the number of messages to send from the + /// relay object to the output device object. u_long send_count_; - // Count of the number of messages to send from the - // relay object to the output device object. + /// Stores the expected duration until expiration, and is used to + /// re-register the handler if there are still sends to perform. ACE_Time_Value duration_; - // Stores the expected duration until expiration, and is used to - // re-register the handler if there are still sends to perform. + /// Reference to the driver that will redisplay the user input menu. Thread_Bounded_Packet_Relay_Driver &driver_; - // Reference to the driver that will redisplay the user input menu. }; +/** + * @class Termination_Handler + * + * @brief Event handler for end transmission timeout events. + * + * The <handle_timeout> hook method calls the relay's end + * transmission method, then registers a deferred execution + * callback to clear all timers and then delete "this". + */ class Termination_Handler : public BPR_Handler_Base { - // = TITLE - // Event handler for end transmission timeout events. - // - // = DESCRIPTION - // The <handle_timeout> hook method calls the relay's end - // transmission method, then registers a deferred execution - // callback to clear all timers and then delete "this". public: + /// Constructor. Termination_Handler (Bounded_Packet_Relay &relay, Thread_Timer_Queue &queue, Thread_Bounded_Packet_Relay_Driver &driver); - // Constructor. + /// Destructor. virtual ~Termination_Handler (void); - // Destructor. + /// Call back hook. virtual int handle_timeout (const ACE_Time_Value ¤t_time, const void *arg); - // Call back hook. + /// Cancellation hook. virtual int cancelled (void); - // Cancellation hook. private: + /// Reference to the driver that will redisplay the user input menu. Thread_Bounded_Packet_Relay_Driver &driver_; - // Reference to the driver that will redisplay the user input menu. }; +/** + * @class Thread_Bounded_Packet_Relay_Driver + * + * @brief Implements an example application that exercises + * <Thread_Timer_Queue> timer queue. + * + * This class implements a simple test driver for the + * <Thread_Timer_Queue>. The <display_menu> hook method is + * called from the base class to print a menu specific to the + * thread implementation of the timer queue. + */ class Thread_Bounded_Packet_Relay_Driver : public Bounded_Packet_Relay_Driver <Thread_Timer_Queue> { - // = TITLE - // Implements an example application that exercises - // <Thread_Timer_Queue> timer queue. - // - // = DESCRIPTION - // This class implements a simple test driver for the - // <Thread_Timer_Queue>. The <display_menu> hook method is - // called from the base class to print a menu specific to the - // thread implementation of the timer queue. public: // = Trait for commands issued from this driver @@ -377,24 +383,24 @@ public: // = Initialization and termination methods. + /// Constructor. Thread_Bounded_Packet_Relay_Driver (Bounded_Packet_Relay *relay); - // Constructor. + /// Destructor. virtual ~Thread_Bounded_Packet_Relay_Driver (void); - // Destructor. + /// Displays the user menu. virtual int display_menu (void); - // Displays the user menu. + /// Initializes the driver. virtual int init (void); - // Initializes the driver. + /// Run the driver. virtual int run (void); - // Run the driver. private: + /// User input task, subclassed from ACE_Task. User_Input_Task input_task_; - // User input task, subclassed from ACE_Task. }; #endif /* _THREAD_BOUNDED_PACKET_RELAY_H_ */ diff --git a/ACE/examples/Bounded_Packet_Relay/bpr_thread.cpp b/ACE/examples/Bounded_Packet_Relay/bpr_thread.cpp index 931645a14ee..2f29e7ec1ce 100644 --- a/ACE/examples/Bounded_Packet_Relay/bpr_thread.cpp +++ b/ACE/examples/Bounded_Packet_Relay/bpr_thread.cpp @@ -1,27 +1,17 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// examples -// -// = FILENAME -// bpr_thread.cpp -// -// = DESCRIPTION -// Exercises drivers for a bounded packet relay, based on threaded timer queues. -// -// = AUTHORS -// Chris Gill <cdgill@cs.wustl.edu> and -// Douglas C. Schmidt <schmidt@cs.wustl.edu> -// -// Based on the Timer Queue Test example written by -// -// Carlos O'Ryan <coryan@cs.wustl.edu> and -// Douglas C. Schmidt <schmidt@cs.wustl.edu> and -// Sergio Flores-Gaitan <sergio@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file bpr_thread.cpp + * + * $Id$ + * + * Exercises drivers for a bounded packet relay, based on threaded timer queues. + * + * + * @author Chris Gill <cdgill@cs.wustl.edu> and Douglas C. Schmidt <schmidt@cs.wustl.edu> Based on the Timer Queue Test example written by Carlos O'Ryan <coryan@cs.wustl.edu> and Douglas C. Schmidt <schmidt@cs.wustl.edu> and Sergio Flores-Gaitan <sergio@cs.wustl.edu> + */ +//============================================================================= + #include "ace/Auto_Ptr.h" #include "Thread_Bounded_Packet_Relay.h" diff --git a/ACE/examples/Connection/misc/Connection_Handler.cpp b/ACE/examples/Connection/misc/Connection_Handler.cpp index 402e6a90696..efe96f514c0 100644 --- a/ACE/examples/Connection/misc/Connection_Handler.cpp +++ b/ACE/examples/Connection/misc/Connection_Handler.cpp @@ -1,20 +1,20 @@ -// $Id$ - -// ============================================================================ -// -// = FILENAME -// Connection_Handler.cpp -// -// = DESCRIPTION -// This test illustrates how to use the Acceptor pattern to -// create multiple threads, each running its own Reactor. You -// can connect to this via telnet and keep typing until you enter -// '^D'. -// -// = AUTHOR -// Doug Schmidt -// -// ============================================================================ + +//============================================================================= +/** + * @file Connection_Handler.cpp + * + * $Id$ + * + * This test illustrates how to use the Acceptor pattern to + * create multiple threads, each running its own Reactor. You + * can connect to this via telnet and keep typing until you enter + * '^D'. + * + * + * @author Doug Schmidt + */ +//============================================================================= + #include "ace/Acceptor.h" #include "ace/SOCK_Acceptor.h" diff --git a/ACE/examples/DLL/Magazine.h b/ACE/examples/DLL/Magazine.h index aa95017beb2..de68758e11f 100644 --- a/ACE/examples/DLL/Magazine.h +++ b/ACE/examples/DLL/Magazine.h @@ -1,42 +1,40 @@ /* -*- C++ -*- */ -// $Id$ -// =========================================================== -// -// -// = LIBRARY -// ACE_wrappers/examples/DLL -// -// = FILENAME -// Magazine.h -// -// = DESCRIPTION -// Abstract class whose methods are implemented by the derived -// classes. -// -// = AUTHOR -// Kirthika Parameswaran <kirthika@cs.wustl.edu> -// -// =========================================================== +//============================================================================= +/** + * @file Magazine.h + * + * $Id$ + * + * Abstract class whose methods are implemented by the derived + * classes. + * + * + * @author Kirthika Parameswaran <kirthika@cs.wustl.edu> + */ +//============================================================================= + #ifndef MAGAZINE_H #define MAGAZINE_H +/** + * @class Magazine + * + * @brief This is an abstract class used in the DLL example. + * + * This class simply is an inetrface which the derived classes + * will exploit. + */ class Magazine { - // = TITLE - // This is an abstract class used in the DLL example. - // - // = DESCRIPTION - // This class simply is an inetrface which the derived classes - // will exploit. public: + /// No-op virtual destructor. virtual ~Magazine (void) {}; - // No-op virtual destructor. + /// This method gives the title of the magazine. virtual void title (void) = 0; - // This method gives the title of the magazine. }; #endif /* MAGAZINE_H */ diff --git a/ACE/examples/DLL/Newsweek.h b/ACE/examples/DLL/Newsweek.h index 79355e74cbd..a4c09786c5d 100644 --- a/ACE/examples/DLL/Newsweek.h +++ b/ACE/examples/DLL/Newsweek.h @@ -1,22 +1,19 @@ /* -*- C++ -*- */ -// $Id$ - -// =========================================================== -// -// = LIBRARY -// ACE_wrappers/examples/DLL -// -// = FILENAME -// Newsweek.h -// -// = DESCRIPTION -// This is a derived class from Magazine which is a magazine -// pertaining to news and information. -// -// = AUTHOR -// Kirthika Parameswaran <kirthika@cs.wustl.edu> -// -// =========================================================== + +//============================================================================= +/** + * @file Newsweek.h + * + * $Id$ + * + * This is a derived class from Magazine which is a magazine + * pertaining to news and information. + * + * + * @author Kirthika Parameswaran <kirthika@cs.wustl.edu> + */ +//============================================================================= + #ifndef NEWSWEEK_H #define NEWSWEEK_H @@ -29,14 +26,16 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +/** + * @class Newsweek + * + * @brief This is an derived class of Magazine. + * + * Polymoriphism is exploited and an object pointer + * of Magazine is bound to the Newsweek object at runtime. + */ class Newsweek : public Magazine { - //= TITLE - // This is an derived class of Magazine. - // - //= DESCRIPTION - // Polymoriphism is exploited and an object pointer - // of Magazine is bound to the Newsweek object at runtime. public: // This is the abstract class method which describes the magazine. diff --git a/ACE/examples/DLL/Today.h b/ACE/examples/DLL/Today.h index 00c2d4b9c04..91d4d5eb04e 100644 --- a/ACE/examples/DLL/Today.h +++ b/ACE/examples/DLL/Today.h @@ -1,22 +1,19 @@ /* -*- C++ -*- */ -// $Id$ - -// =========================================================== -// -// = LIBRARY -// ACE_wrappers/examples/DLL -// -// = FILENAME -// Today.h -// -// = DESCRIPTION -// This class denotes the Today magazine which is derived from -// Magazine. -// -// = AUTHOR -// Kirthika Parameswaran <kirthika@cs.wustl.edu> -// -// =========================================================== + +//============================================================================= +/** + * @file Today.h + * + * $Id$ + * + * This class denotes the Today magazine which is derived from + * Magazine. + * + * + * @author Kirthika Parameswaran <kirthika@cs.wustl.edu> + */ +//============================================================================= + #ifndef TODAY_H #define TODAY_H @@ -29,14 +26,16 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +/** + * @class Today + * + * @brief This is an derived class of Magazine. + * + * Polymoriphism is exploited and an object pointer of Magazine + * is bound to the Today object at runtime. + */ class Today : public Magazine { - // = TITLE - // This is an derived class of Magazine. - // - // = DESCRIPTION - // Polymoriphism is exploited and an object pointer of Magazine - // is bound to the Today object at runtime. public: // The virtual abstract class method which returns the title of the diff --git a/ACE/examples/IPC_SAP/UPIPE_SAP/ex1.cpp b/ACE/examples/IPC_SAP/UPIPE_SAP/ex1.cpp index 66ce3d62ded..41fd8935d42 100644 --- a/ACE/examples/IPC_SAP/UPIPE_SAP/ex1.cpp +++ b/ACE/examples/IPC_SAP/UPIPE_SAP/ex1.cpp @@ -1,21 +1,18 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// examples -// -// = FILENAME -// ex1.cpp -// -// = DESCRIPTION -// Example for using <ACE_UPIPE_SAP> and <ACE_Thread> for -// intra-process communication. -// -// = AUTHOR -// Gerhard Lenzer and Douglas C. Schmidt -// -// ============================================================================ + +//============================================================================= +/** + * @file ex1.cpp + * + * $Id$ + * + * Example for using <ACE_UPIPE_SAP> and <ACE_Thread> for + * intra-process communication. + * + * + * @author Gerhard Lenzer and Douglas C. Schmidt + */ +//============================================================================= + #include "ace/OS_main.h" #include "ace/OS_NS_string.h" diff --git a/ACE/examples/IPC_SAP/UPIPE_SAP/ex2.cpp b/ACE/examples/IPC_SAP/UPIPE_SAP/ex2.cpp index 3b9e8b35d9d..d1708caaf93 100644 --- a/ACE/examples/IPC_SAP/UPIPE_SAP/ex2.cpp +++ b/ACE/examples/IPC_SAP/UPIPE_SAP/ex2.cpp @@ -1,21 +1,18 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// examples -// -// = FILENAME -// ex2.cpp -// -// = DESCRIPTION -// Example for using <ACE_UPIPE_SAP> and <ACE_Thread> for -// intra-process communication. -// -// = AUTHOR -// Gerhard Lenzer and Douglas C. Schmidt -// -// ============================================================================ + +//============================================================================= +/** + * @file ex2.cpp + * + * $Id$ + * + * Example for using <ACE_UPIPE_SAP> and <ACE_Thread> for + * intra-process communication. + * + * + * @author Gerhard Lenzer and Douglas C. Schmidt + */ +//============================================================================= + #include "ace/OS_main.h" #include "ace/UPIPE_Connector.h" diff --git a/ACE/examples/IPC_SAP/UPIPE_SAP/ex3.cpp b/ACE/examples/IPC_SAP/UPIPE_SAP/ex3.cpp index 113c79ff839..c5d609d2c73 100644 --- a/ACE/examples/IPC_SAP/UPIPE_SAP/ex3.cpp +++ b/ACE/examples/IPC_SAP/UPIPE_SAP/ex3.cpp @@ -1,22 +1,19 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// examples -// -// = FILENAME -// ex3.cpp -// -// = DESCRIPTION -// Example for using <ACE_UPIPE_SAP> and <ACE_Thread> for intra-process -// communication. This example uses char buffers as input/output -// interface to the <ACE_UPIPE_Stream>. -// -// = AUTHOR -// Gerhard Lenzer and Prashant Jain. -// -// ============================================================================ + +//============================================================================= +/** + * @file ex3.cpp + * + * $Id$ + * + * Example for using <ACE_UPIPE_SAP> and <ACE_Thread> for intra-process + * communication. This example uses char buffers as input/output + * interface to the <ACE_UPIPE_Stream>. + * + * + * @author Gerhard Lenzer and Prashant Jain. + */ +//============================================================================= + #include "ace/OS_main.h" #include "ace/UPIPE_Connector.h" diff --git a/ACE/examples/Log_Msg/test_callback.cpp b/ACE/examples/Log_Msg/test_callback.cpp index ad776bbfe1e..a72ff2a2fa0 100644 --- a/ACE/examples/Log_Msg/test_callback.cpp +++ b/ACE/examples/Log_Msg/test_callback.cpp @@ -1,22 +1,19 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// examples/Log_Msg -// -// = FILENAME -// test_callback.cpp -// -// = DESCRIPTION -// This program tests the <ACE_Log_Msg> class wrt writing to user -// defined callback objects. In particular, it tests to make sure -// that nested callbacks don't deadlock. -// -// = AUTHOR -// Irfan Pyarali <irfan@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file test_callback.cpp + * + * $Id$ + * + * This program tests the <ACE_Log_Msg> class wrt writing to user + * defined callback objects. In particular, it tests to make sure + * that nested callbacks don't deadlock. + * + * + * @author Irfan Pyarali <irfan@cs.wustl.edu> + */ +//============================================================================= + #include "ace/OS_main.h" #include "ace/Log_Msg.h" @@ -26,26 +23,29 @@ +/** + * @class Logger + Subclassing from ACE_Log_Msg_Callback means that an instance of + * Logger can be a target of a callback. + */ class Logger : public ACE_Log_Msg_Callback -// Subclassing from ACE_Log_Msg_Callback means that an instance of -// Logger can be a target of a callback. { public: // Constructor sets whether we're testing "recursive" callback // logging! Logger (int be_recursive = 1); + /// Logging callback hook. virtual void log (ACE_Log_Record &log_record); - // Logging callback hook. void verbose (int be_verbose); private: + /// Flag for testing verbose logging. int verbose_logging_; - // Flag for testing verbose logging. + /// Flag for testing recursive callback logging. int recursive_; - // Flag for testing recursive callback logging. }; void diff --git a/ACE/examples/Log_Msg/test_log_msg.cpp b/ACE/examples/Log_Msg/test_log_msg.cpp index 59e61524700..f6c48cd3bbe 100644 --- a/ACE/examples/Log_Msg/test_log_msg.cpp +++ b/ACE/examples/Log_Msg/test_log_msg.cpp @@ -1,21 +1,18 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// examples/Log_Msg -// -// = FILENAME -// test_log_msg.cpp -// -// = DESCRIPTION -// This program tests the ACE_Log_Msg abstraction and demontrates -// several common use cases. -// -// = AUTHOR -// Douglas Schmidt <schmidt@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file test_log_msg.cpp + * + * $Id$ + * + * This program tests the ACE_Log_Msg abstraction and demontrates + * several common use cases. + * + * + * @author Douglas Schmidt <schmidt@cs.wustl.edu> + */ +//============================================================================= + #include "ace/OS_main.h" diff --git a/ACE/examples/Log_Msg/test_ostream.cpp b/ACE/examples/Log_Msg/test_ostream.cpp index 34881811ea5..bb860e68c15 100644 --- a/ACE/examples/Log_Msg/test_ostream.cpp +++ b/ACE/examples/Log_Msg/test_ostream.cpp @@ -1,21 +1,18 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// examples/Log_Msg -// -// = FILENAME -// test_ostream.cpp -// -// = DESCRIPTION -// This program tests the Log_Msg abstraction wrt writing to -// stderr and to a file. -// -// = AUTHOR -// Irfan Pyarali <irfan@cse.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file test_ostream.cpp + * + * $Id$ + * + * This program tests the Log_Msg abstraction wrt writing to + * stderr and to a file. + * + * + * @author Irfan Pyarali <irfan@cse.wustl.edu> + */ +//============================================================================= + #include "ace/OS_main.h" diff --git a/ACE/examples/Logger/simple-server/Logging_Acceptor.h b/ACE/examples/Logger/simple-server/Logging_Acceptor.h index 0424a7c3889..33fc2d3d00b 100644 --- a/ACE/examples/Logger/simple-server/Logging_Acceptor.h +++ b/ACE/examples/Logger/simple-server/Logging_Acceptor.h @@ -1,18 +1,15 @@ /* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// examples -// -// = FILENAME -// Logging_Acceptor.h -// -// = AUTHOR -// Doug Schmidt -// -// ============================================================================ + +//============================================================================= +/** + * @file Logging_Acceptor.h + * + * $Id$ + * + * @author Doug Schmidt + */ +//============================================================================= + #ifndef _CLIENT_ACCEPTOR_H #define _CLIENT_ACCEPTOR_H @@ -25,22 +22,24 @@ #include "ace/Event_Handler.h" +/** + * @class Logging_Acceptor + * + * @brief Handle connection requests from remote client clients. + * + * Accepts client connection requests, creates Logging_Handler's + * to process them, and registers these Handlers with the + * ACE_Reactor Singleton. + */ class Logging_Acceptor : public ACE_Event_Handler - // = TITLE - // Handle connection requests from remote client clients. - // - // = DESCRIPTION - // Accepts client connection requests, creates Logging_Handler's - // to process them, and registers these Handlers with the - // ACE_Reactor Singleton. { friend class Logging_Handler; public: + /// Constructor. Logging_Acceptor (void); - // Constructor. + /// Initialization. int open (const ACE_INET_Addr &a); - // Initialization. private: // = Demuxing hooks. @@ -48,12 +47,12 @@ private: virtual int handle_close (ACE_HANDLE, ACE_Reactor_Mask); virtual ACE_HANDLE get_handle (void) const; + /// By making this private we ensure that the <Logging_Acceptor> is + /// allocated dynamically. ~Logging_Acceptor (void); - // By making this private we ensure that the <Logging_Acceptor> is - // allocated dynamically. + /// Passive connection acceptor factory. ACE_SOCK_Acceptor peer_acceptor_; - // Passive connection acceptor factory. }; #endif /* _CLIENT_ACCEPTOR_H */ diff --git a/ACE/examples/Logger/simple-server/Logging_Handler.h b/ACE/examples/Logger/simple-server/Logging_Handler.h index 633e04a167c..4c211a3a04b 100644 --- a/ACE/examples/Logger/simple-server/Logging_Handler.h +++ b/ACE/examples/Logger/simple-server/Logging_Handler.h @@ -1,19 +1,16 @@ /* -*- C++ -*- */ -// $Id$ -// ============================================================================ -// -// = LIBRARY -// examples -// -// = FILENAME -// Logging_Handler.h -// -// = AUTHOR -// Doug Schmidt -// -// ============================================================================ +//============================================================================= +/** + * @file Logging_Handler.h + * + * $Id$ + * + * @author Doug Schmidt + */ +//============================================================================= + #ifndef _CLIENT_HANDLER_H #define _CLIENT_HANDLER_H @@ -28,15 +25,17 @@ #include "ace/SOCK_Stream.h" #include "ace/os_include/os_netdb.h" +/** + * @class Logging_Handler + * + * @brief Receive client message from the remote clients. + * + * This class demonstrates how to receive messages from remote + * clients using the notification mechanisms in the + * <ACE_Reactor>. In addition, it also illustrates how to + * utilize the <ACE_Reactor> timer mechanisms, as well. + */ class Logging_Handler : public ACE_Event_Handler - // = TITLE - // Receive client message from the remote clients. - // - // = DESCRIPTION - // This class demonstrates how to receive messages from remote - // clients using the notification mechanisms in the - // <ACE_Reactor>. In addition, it also illustrates how to - // utilize the <ACE_Reactor> timer mechanisms, as well. { public: Logging_Handler (void); @@ -45,8 +44,8 @@ public: virtual int open (void); virtual int close (void); + /// Conversion operators. ACE_SOCK_Stream &peer (void); - // Conversion operators. protected: // = Demultiplexing hooks. @@ -57,15 +56,15 @@ protected: virtual int handle_timeout (const ACE_Time_Value &tv, const void *arg); // = Really should be private... + /// Ensure dynamic allocation. virtual ~Logging_Handler (void); - // Ensure dynamic allocation. private: + /// Host we are connected to. char host_name_[MAXHOSTNAMELEN + 1]; - // Host we are connected to. + /// Connection with client ACE_SOCK_Stream cli_stream_; - // Connection with client }; #endif /* _CLIENT_HANDLER_H */ diff --git a/ACE/examples/Logger/simple-server/Reactor_Singleton.h b/ACE/examples/Logger/simple-server/Reactor_Singleton.h index ec0653125a9..2a70ae3f657 100644 --- a/ACE/examples/Logger/simple-server/Reactor_Singleton.h +++ b/ACE/examples/Logger/simple-server/Reactor_Singleton.h @@ -1,19 +1,16 @@ /* -*- C++ -*- */ -// $Id$ - - -// ============================================================================ -// -// = LIBRARY -// examples -// -// = FILENAME -// Reactor_Singleton.h -// -// = AUTHOR -// Doug Schmidt -// -// ============================================================================ + + +//============================================================================= +/** + * @file Reactor_Singleton.h + * + * $Id$ + * + * @author Doug Schmidt + */ +//============================================================================= + #ifndef _REACTOR_SINGLETON_H #define _REACTOR_SINGLETON_H diff --git a/ACE/examples/Misc/test_trace.cpp b/ACE/examples/Misc/test_trace.cpp index 8f684d237b7..862f638291a 100644 --- a/ACE/examples/Misc/test_trace.cpp +++ b/ACE/examples/Misc/test_trace.cpp @@ -1,40 +1,36 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// examples/Misc -// -// = FILENAME -// test_trace.cpp -// -// = DESCRIPTION -// This example illustrates how to use the ACE tracing feature and -// the ACE_TRACE macro. It also shows the use of the ACE_Task_Base -// class running as an "active object". -// -// When adding ACE tracing to an application one option is to add -// -// #define ACE_NTRACE 0 -// -// in the line above #include "ace/Log_Msg.h". That's the approach shown below. -// -// Another option is to add this line in $ACE_ROOT/ace/config.h. -// Note, however, that if you add the line in config.h, you need to -// add it *after* you've built ACE, i.e., don't build ACE with it -// set to 0 as then you will get all the internal ACE_TRACE calls -// showing up as well! In a nutshell, in this second option you -// do this: -// -// 1. Build ACE without tracing (i.e., don't #define ACE_NTRACE 0 in config.h) -// 2. Add #define ACE_NTRACE 0 in config.h -// 3. Build your app with tracing. -// -// = AUTHOR -// Douglas C. Schmidt <schmidt@cs.wustl.edu> and -// Irfan Pyarali <irfan@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file test_trace.cpp + * + * $Id$ + * + * This example illustrates how to use the ACE tracing feature and + * the ACE_TRACE macro. It also shows the use of the ACE_Task_Base + * class running as an "active object". + * + * When adding ACE tracing to an application one option is to add + * + * #define ACE_NTRACE 0 + * + * in the line above #include "ace/Log_Msg.h". That's the approach shown below. + * + * Another option is to add this line in $ACE_ROOT/ace/config.h. + * Note, however, that if you add the line in config.h, you need to + * add it *after* you've built ACE, i.e., don't build ACE with it + * set to 0 as then you will get all the internal ACE_TRACE calls + * showing up as well! In a nutshell, in this second option you + * do this: + * + * 1. Build ACE without tracing (i.e., don't #define ACE_NTRACE 0 in config.h) + * 2. Add #define ACE_NTRACE 0 in config.h + * 3. Build your app with tracing. + * + * + * @author Douglas C. Schmidt <schmidt@cs.wustl.edu> and Irfan Pyarali <irfan@cs.wustl.edu> + */ +//============================================================================= + // Enable tracing #define ACE_NTRACE 0 @@ -61,8 +57,8 @@ public: } private: + /// Depth of the recursion. size_t depth_; - // Depth of the recursion. }; int diff --git a/ACE/examples/NT_Service/main.cpp b/ACE/examples/NT_Service/main.cpp index 43f09fba0dd..785913e3613 100644 --- a/ACE/examples/NT_Service/main.cpp +++ b/ACE/examples/NT_Service/main.cpp @@ -1,23 +1,19 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// examples/NT_Service -// -// = FILENAME -// main.cpp -// -// = DESCRIPTION -// This is the main program - it just hands control off to the -// process instance to figure out what to do. This program only -// runs on Win32. -// -// = AUTHOR -// Gonzalo Diethelm <gonzo@cs.wustl.edu> -// and Steve Huston <shuston@riverace.com> -// -// ============================================================================ + +//============================================================================= +/** + * @file main.cpp + * + * $Id$ + * + * This is the main program - it just hands control off to the + * process instance to figure out what to do. This program only + * runs on Win32. + * + * + * @author Gonzalo Diethelm <gonzo@cs.wustl.edu> and Steve Huston <shuston@riverace.com> + */ +//============================================================================= + #include "ace/Get_Opt.h" #include "ntsvc.h" diff --git a/ACE/examples/NT_Service/ntsvc.cpp b/ACE/examples/NT_Service/ntsvc.cpp index 9b6742b46f3..9fd677630ac 100644 --- a/ACE/examples/NT_Service/ntsvc.cpp +++ b/ACE/examples/NT_Service/ntsvc.cpp @@ -1,22 +1,18 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// examples/NT_Service -// -// = FILENAME -// ntsvc.cpp -// -// = DESCRIPTION -// This is the implementation of the NT service. It beeps every 2 -// seconds until the service is stopped. -// -// = AUTHOR -// Gonzalo Diethelm <gonzo@cs.wustl.edu> -// and Steve Huston <shuston@riverace.com> -// -// ============================================================================ + +//============================================================================= +/** + * @file ntsvc.cpp + * + * $Id$ + * + * This is the implementation of the NT service. It beeps every 2 + * seconds until the service is stopped. + * + * + * @author Gonzalo Diethelm <gonzo@cs.wustl.edu> and Steve Huston <shuston@riverace.com> + */ +//============================================================================= + #include "ace/Reactor.h" #include "ntsvc.h" diff --git a/ACE/examples/NT_Service/ntsvc.h b/ACE/examples/NT_Service/ntsvc.h index 1444b5977d9..f824573cded 100644 --- a/ACE/examples/NT_Service/ntsvc.h +++ b/ACE/examples/NT_Service/ntsvc.h @@ -1,22 +1,19 @@ /* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// examples/NT_Service -// -// = FILENAME -// ntsvc.h -// -// = DESCRIPTION -// This is the definition of the sample NT Service class. This example -// only runs on Win32 platforms. -// -// = AUTHOR -// Gonzalo Diethelm and Steve Huston -// -// ============================================================================ + +//============================================================================= +/** + * @file ntsvc.h + * + * $Id$ + * + * This is the definition of the sample NT Service class. This example + * only runs on Win32 platforms. + * + * + * @author Gonzalo Diethelm and Steve Huston + */ +//============================================================================= + #ifndef NTSVC_H_ #define NTSVC_H_ @@ -37,20 +34,20 @@ public: ~Service (void); + /// We override <handle_control> because it handles stop requests + /// privately. virtual void handle_control (DWORD control_code); - // We override <handle_control> because it handles stop requests - // privately. + /// We override <handle_exception> so a 'stop' control code can pop + /// the reactor off of its wait. virtual int handle_exception (ACE_HANDLE h); - // We override <handle_exception> so a 'stop' control code can pop - // the reactor off of its wait. + /// This is a virtual method inherited from ACE_NT_Service. virtual int svc (void); - // This is a virtual method inherited from ACE_NT_Service. + /// Where the real work is done: virtual int handle_timeout (const ACE_Time_Value& tv, const void *arg = 0); - // Where the real work is done: private: typedef ACE_NT_Service inherited; diff --git a/ACE/examples/OS/Process/imore.cpp b/ACE/examples/OS/Process/imore.cpp index d35e8ddaecc..98bac0ba53a 100644 --- a/ACE/examples/OS/Process/imore.cpp +++ b/ACE/examples/OS/Process/imore.cpp @@ -1,26 +1,23 @@ -// ============================================================================ -// $Id$ -// -// = LIBRARY -// examples -// -// = FILENAME -// imore.cpp (imore stands for indirect more.) -// -// = DESCRIPTION -// This program demonstrates how to redirect stdout of a parent -// process to the stdin of its child process using either unnamed pipe -// or named pipes to relay data to subprocess which runs "more" to -// display data on the screen. Run imore to see how to use this -// program. -// -// Unfortunately, on Win32, this program doesn't use any pipe at all because -// using pipes confuses MORE.COM on Win32 and it just acts like "cat" on Unix. -// -// = AUTHOR -// Nanbor Wang <nanbor@cs.wustl.edu> -// -// ============================================================================ +//============================================================================= +/** + * @file imore.cpp (imore stands for indirect more.) + * + * $Id$ + * + * This program demonstrates how to redirect stdout of a parent + * process to the stdin of its child process using either unnamed pipe + * or named pipes to relay data to subprocess which runs "more" to + * display data on the screen. Run imore to see how to use this + * program. + * + * Unfortunately, on Win32, this program doesn't use any pipe at all because + * using pipes confuses MORE.COM on Win32 and it just acts like "cat" on Unix. + * + * + * @author Nanbor Wang <nanbor@cs.wustl.edu> + */ +//============================================================================= + #include "ace/OS_NS_stdio.h" #include "ace/OS_NS_errno.h" diff --git a/ACE/examples/OS/Process/process.cpp b/ACE/examples/OS/Process/process.cpp index 81e150402f4..c65a7451c4c 100644 --- a/ACE/examples/OS/Process/process.cpp +++ b/ACE/examples/OS/Process/process.cpp @@ -1,21 +1,18 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// examples -// -// = FILENAME -// process.cpp -// -// = DESCRIPTION -// This example tests the <ACE_Process>. For more info, check the -// README file in this directory. -// -// = AUTHOR -// Tim Harrison <harrison@cs.wustl.edu>. -// -// ============================================================================ + +//============================================================================= +/** + * @file process.cpp + * + * $Id$ + * + * This example tests the <ACE_Process>. For more info, check the + * README file in this directory. + * + * + * @author Tim Harrison <harrison@cs.wustl.edu>. + */ +//============================================================================= + #include "ace/OS_NS_errno.h" #include "ace/OS_NS_fcntl.h" diff --git a/ACE/examples/QOS/Change_Receiver_FlowSpec/Fill_ACE_QoS.h b/ACE/examples/QOS/Change_Receiver_FlowSpec/Fill_ACE_QoS.h index cdc06cea422..204baf53b27 100644 --- a/ACE/examples/QOS/Change_Receiver_FlowSpec/Fill_ACE_QoS.h +++ b/ACE/examples/QOS/Change_Receiver_FlowSpec/Fill_ACE_QoS.h @@ -1,18 +1,15 @@ /* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ACE_wrappers/examples/QOS -// -// = FILENAME -// Fill_ACE_QoS.h -// -// = AUTHOR -// Vishal Kachroo <vishal@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file Fill_ACE_QoS.h + * + * $Id$ + * + * @author Vishal Kachroo <vishal@cs.wustl.edu> + */ +//============================================================================= + #ifndef FILL_ACE_QOS_H #define FILL_ACE_QOS_H @@ -24,41 +21,44 @@ #include "ace/ACE.h" #include "ace/OS_QoS.h" +/** + * @class Fill_ACE_QoS + TITLE + * This class helps users to add new flow specs and provides + * utility functions for filling up the flow specs for simplex/duplex + * sessions. + */ class Fill_ACE_QoS { - // TITLE - // This class helps users to add new flow specs and provides - // utility functions for filling up the flow specs for simplex/duplex - // sessions. public: typedef ACE_Hash_Map_Manager <ACE_CString, ACE_Flow_Spec *, ACE_Null_Mutex> FLOW_SPEC_HASH_MAP; //Initialization and termination methods. + /// constructor. Fill_ACE_QoS (void); - // constructor. + /// destructor. ~Fill_ACE_QoS (void); - // destructor. + /// To be used by receivers. Fills the receiver qos and sets the + /// sender qos to NO_TRAFFIC. int fill_simplex_receiver_qos (ACE_QoS &ace_qos, const ACE_CString &recv_flow_name); - // To be used by receivers. Fills the receiver qos and sets the - // sender qos to NO_TRAFFIC. + /// To be used by senders. Fills the sender qos and sets the receiver + /// qos to NO_TRAFFIC. int fill_simplex_sender_qos (ACE_QoS &ace_qos, const ACE_CString &send_flow_name); - // To be used by senders. Fills the sender qos and sets the receiver - // qos to NO_TRAFFIC. + /// To be used by applications that wish to be both receivers and + /// senders. int fill_duplex_qos (ACE_QoS &ace_qos, const ACE_CString &recv_flow_name, const ACE_CString &send_flow_name); - // To be used by applications that wish to be both receivers and - // senders. + /// Returns the hash map of flowspecs indexed by flowspec name. FLOW_SPEC_HASH_MAP& map (void); - // Returns the hash map of flowspecs indexed by flowspec name. private: diff --git a/ACE/examples/QOS/Change_Receiver_FlowSpec/FlowSpec_Dbase.h b/ACE/examples/QOS/Change_Receiver_FlowSpec/FlowSpec_Dbase.h index fc382048c13..5e3637c8455 100644 --- a/ACE/examples/QOS/Change_Receiver_FlowSpec/FlowSpec_Dbase.h +++ b/ACE/examples/QOS/Change_Receiver_FlowSpec/FlowSpec_Dbase.h @@ -1,18 +1,15 @@ /* -*- C++ -*- */ -//$Id$ - -// ============================================================================ -// -// = LIBRARY -// ACE_wrappers/examples/QOS -// -// = FILENAME -// FlowSpec_Dbase.h -// -// = AUTHOR -// Vishal Kachroo <vishal@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file FlowSpec_Dbase.h + * + * $Id$ + * + * @author Vishal Kachroo <vishal@cs.wustl.edu> + */ +//============================================================================= + #ifndef FLOWSPEC_DBASE_H #define FLOWSPEC_DBASE_H diff --git a/ACE/examples/QOS/Change_Receiver_FlowSpec/QoS_Signal_Handler.h b/ACE/examples/QOS/Change_Receiver_FlowSpec/QoS_Signal_Handler.h index b2d4a0f40fa..3ded5c10ad3 100644 --- a/ACE/examples/QOS/Change_Receiver_FlowSpec/QoS_Signal_Handler.h +++ b/ACE/examples/QOS/Change_Receiver_FlowSpec/QoS_Signal_Handler.h @@ -1,18 +1,15 @@ /* -*- C++ -*- */ -// $Id$ - -// ===================================================================== -// -// = LIBRARY -// ACE_wrappers/examples/QOS -// -// = FILENAME -// QoS_Signal_Handler.h -// -// = AUTHOR -// Vishal Kachroo <vishal@cs.wustl.edu> -// -// ===================================================================== + +//============================================================================= +/** + * @file QoS_Signal_Handler.h + * + * $Id$ + * + * @author Vishal Kachroo <vishal@cs.wustl.edu> + */ +//============================================================================= + #ifndef QOS_SIGNAL_HANDLER_H #define QOS_SIGNAL_HANDLER_H @@ -20,24 +17,27 @@ #include "ace/Event_Handler.h" #include "ace/QoS/QoS_Session.h" +/** + * @class QoS_Signal_Handler + TITLE + * This class Handles the SIGINT signal through the Reactor. + * Useful to gracefully release QoS sessions. + */ class QoS_Signal_Handler : public ACE_Event_Handler { - // TITLE - // This class Handles the SIGINT signal through the Reactor. - // Useful to gracefully release QoS sessions. public: + /// constructor. QoS_Signal_Handler (ACE_QoS_Session *qos_session); - // constructor. + /// Override this method to implement graceful shutdown. int handle_signal(int signum, siginfo_t*,ucontext_t*); - // Override this method to implement graceful shutdown. private: + /// Session to be gracefully shutdown. ACE_QoS_Session *qos_session_; - // Session to be gracefully shutdown. }; diff --git a/ACE/examples/QOS/Change_Receiver_FlowSpec/QoS_Util.h b/ACE/examples/QOS/Change_Receiver_FlowSpec/QoS_Util.h index ae347de68f6..fbde23e3802 100644 --- a/ACE/examples/QOS/Change_Receiver_FlowSpec/QoS_Util.h +++ b/ACE/examples/QOS/Change_Receiver_FlowSpec/QoS_Util.h @@ -1,18 +1,15 @@ /* -*- C++ -*- */ -// $Id$ - -// ===================================================================== -// -// = LIBRARY -// ACE_wrappers/examples/QOS -// -// = FILENAME -// QoS_Util.h -// -// = AUTHOR -// Vishal Kachroo <vishal@cs.wustl.edu> -// -// ===================================================================== + +//============================================================================= +/** + * @file QoS_Util.h + * + * $Id$ + * + * @author Vishal Kachroo <vishal@cs.wustl.edu> + */ +//============================================================================= + #ifndef QOS_UTIL_H #define QOS_UTIL_H @@ -20,11 +17,14 @@ #include "ace/INET_Addr.h" #include "ace/QoS/QoS_Session.h" +/** + * @class QoS_Util + * + * @brief This class provides the utility functions like parse_args () + * required by a QoS enabled application. + */ class QoS_Util { - // = TITLE - // This class provides the utility functions like parse_args () - // required by a QoS enabled application. public: diff --git a/ACE/examples/QOS/Change_Receiver_FlowSpec/Receiver_QoS_Event_Handler.cpp b/ACE/examples/QOS/Change_Receiver_FlowSpec/Receiver_QoS_Event_Handler.cpp index 220cfb3e53c..747b723034d 100644 --- a/ACE/examples/QOS/Change_Receiver_FlowSpec/Receiver_QoS_Event_Handler.cpp +++ b/ACE/examples/QOS/Change_Receiver_FlowSpec/Receiver_QoS_Event_Handler.cpp @@ -1,18 +1,15 @@ /* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ACE_wrappers/examples/QOS -// -// = FILENAME -// Receiver_QoS_Event_Handler.cpp -// -// = AUTHOR -// Vishal Kachroo <vishal@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file Receiver_QoS_Event_Handler.cpp + * + * $Id$ + * + * @author Vishal Kachroo <vishal@cs.wustl.edu> + */ +//============================================================================= + #include "Receiver_QoS_Event_Handler.h" #include "ace/Log_Msg.h" diff --git a/ACE/examples/QOS/Change_Receiver_FlowSpec/Receiver_QoS_Event_Handler.h b/ACE/examples/QOS/Change_Receiver_FlowSpec/Receiver_QoS_Event_Handler.h index 900595a6778..35b6cd281ba 100644 --- a/ACE/examples/QOS/Change_Receiver_FlowSpec/Receiver_QoS_Event_Handler.h +++ b/ACE/examples/QOS/Change_Receiver_FlowSpec/Receiver_QoS_Event_Handler.h @@ -1,18 +1,15 @@ /* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ACE_wrappers/examples/QOS -// -// = FILENAME -// Receiver_QoS_Event_Handler.h -// -// = AUTHOR -// Vishal Kachroo <vishal@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file Receiver_QoS_Event_Handler.h + * + * $Id$ + * + * @author Vishal Kachroo <vishal@cs.wustl.edu> + */ +//============================================================================= + #ifndef RECEIVER_QOS_EVENT_HANDLER_H #define RECEIVER_QOS_EVENT_HANDLER_H @@ -27,25 +24,25 @@ class Receiver_QoS_Event_Handler : public ACE_Event_Handler { public: // = Initialization and Termination methods. + /// Constructor. Receiver_QoS_Event_Handler (void); - // Constructor. + /// Constructor. Receiver_QoS_Event_Handler (const ACE_SOCK_Dgram_Mcast_QoS &dgram_mcast_qos, ACE_QoS_Session *qos_session); - // Constructor. + /// Destructor. ~Receiver_QoS_Event_Handler (void); - // Destructor. + /// Override this to return the handle of the Dgram_Mcast + /// that we are using. virtual ACE_HANDLE get_handle (void) const; - // Override this to return the handle of the Dgram_Mcast - // that we are using. + /// Handles a READ event. virtual int handle_input (ACE_HANDLE fd); - // Handles a READ event. + /// Handles a QoS event. virtual int handle_qos (ACE_HANDLE fd); - // Handles a QoS event. private: ACE_SOCK_Dgram_Mcast_QoS dgram_mcast_qos_; diff --git a/ACE/examples/QOS/Change_Receiver_FlowSpec/Sender_QoS_Event_Handler.cpp b/ACE/examples/QOS/Change_Receiver_FlowSpec/Sender_QoS_Event_Handler.cpp index af3e7dbdafd..69439455bb6 100644 --- a/ACE/examples/QOS/Change_Receiver_FlowSpec/Sender_QoS_Event_Handler.cpp +++ b/ACE/examples/QOS/Change_Receiver_FlowSpec/Sender_QoS_Event_Handler.cpp @@ -1,18 +1,15 @@ /* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ACE_wrappers/examples/QOS -// -// = FILENAME -// Sender_QoS_Event_Handler.cpp -// -// = AUTHOR -// Vishal Kachroo <vishal@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file Sender_QoS_Event_Handler.cpp + * + * $Id$ + * + * @author Vishal Kachroo <vishal@cs.wustl.edu> + */ +//============================================================================= + #include "Sender_QoS_Event_Handler.h" #include "ace/Log_Msg.h" diff --git a/ACE/examples/QOS/Change_Receiver_FlowSpec/Sender_QoS_Event_Handler.h b/ACE/examples/QOS/Change_Receiver_FlowSpec/Sender_QoS_Event_Handler.h index e93ed52adae..55ff2415bf6 100644 --- a/ACE/examples/QOS/Change_Receiver_FlowSpec/Sender_QoS_Event_Handler.h +++ b/ACE/examples/QOS/Change_Receiver_FlowSpec/Sender_QoS_Event_Handler.h @@ -1,18 +1,15 @@ /* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ACE_wrappers/examples/QOS -// -// = FILENAME -// Sender_QoS_Event_Handler.h -// -// = AUTHOR -// Vishal Kachroo <vishal@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file Sender_QoS_Event_Handler.h + * + * $Id$ + * + * @author Vishal Kachroo <vishal@cs.wustl.edu> + */ +//============================================================================= + #ifndef SENDER_QOS_EVENT_HANDLER_H #define SENDER_QOS_EVENT_HANDLER_H @@ -30,23 +27,23 @@ class Sender_QoS_Event_Handler : public ACE_Event_Handler { public: // = Initialization and Termination methods. + /// Constructor. Sender_QoS_Event_Handler (void); - // Constructor. + /// Constructor. Sender_QoS_Event_Handler (const ACE_SOCK_Dgram_Mcast_QoS &dgram_mcast_qos, ACE_QoS_Session *qos_session); - // Constructor. + /// Destructor. ~Sender_QoS_Event_Handler (void); - // Destructor. + /// Override this to return the handle of the Dgram_Mcast + /// that we are using. virtual ACE_HANDLE get_handle (void) const; - // Override this to return the handle of the Dgram_Mcast - // that we are using. + /// Handles a QoS event. Right now, just + /// prints a message. virtual int handle_qos (ACE_HANDLE fd); - // Handles a QoS event. Right now, just - // prints a message. private: diff --git a/ACE/examples/QOS/Change_Receiver_FlowSpec/receiver.cpp b/ACE/examples/QOS/Change_Receiver_FlowSpec/receiver.cpp index 9ef416308b0..1fb8fd69f23 100644 --- a/ACE/examples/QOS/Change_Receiver_FlowSpec/receiver.cpp +++ b/ACE/examples/QOS/Change_Receiver_FlowSpec/receiver.cpp @@ -1,18 +1,15 @@ /* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ACE_wrappers/examples/QOS -// -// = FILENAME -// server.cpp -// -// = AUTHOR -// Vishal Kachroo <vishal@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file receiver.cpp + * + * $Id$ + * + * @author Vishal Kachroo <vishal@cs.wustl.edu> + */ +//============================================================================= + #define QOSEVENT_MAIN diff --git a/ACE/examples/QOS/Change_Receiver_FlowSpec/sender.cpp b/ACE/examples/QOS/Change_Receiver_FlowSpec/sender.cpp index 5aedacb3303..23121f4fe77 100644 --- a/ACE/examples/QOS/Change_Receiver_FlowSpec/sender.cpp +++ b/ACE/examples/QOS/Change_Receiver_FlowSpec/sender.cpp @@ -1,18 +1,15 @@ /* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ACE_wrappers/examples/QOS -// -// = FILENAME -// client.cpp -// -// = AUTHOR -// Vishal Kachroo <vishal@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file sender.cpp + * + * $Id$ + * + * @author Vishal Kachroo <vishal@cs.wustl.edu> + */ +//============================================================================= + #include "ace/QoS/QoS_Session.h" diff --git a/ACE/examples/QOS/Change_Sender_TSpec/Fill_ACE_QoS.h b/ACE/examples/QOS/Change_Sender_TSpec/Fill_ACE_QoS.h index 776d713e5e5..79568dafb78 100644 --- a/ACE/examples/QOS/Change_Sender_TSpec/Fill_ACE_QoS.h +++ b/ACE/examples/QOS/Change_Sender_TSpec/Fill_ACE_QoS.h @@ -1,18 +1,15 @@ /* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ACE_wrappers/examples/QOS -// -// = FILENAME -// Fill_ACE_QoS.h -// -// = AUTHOR -// Vishal Kachroo <vishal@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file Fill_ACE_QoS.h + * + * $Id$ + * + * @author Vishal Kachroo <vishal@cs.wustl.edu> + */ +//============================================================================= + #ifndef FILL_ACE_QOS_H #define FILL_ACE_QOS_H @@ -23,41 +20,44 @@ #include "ace/ACE.h" #include "ace/OS_QoS.h" +/** + * @class Fill_ACE_QoS + TITLE + * This class helps users to add new flow specs and provides + * utility functions for filling up the flow specs for simplex/duplex + * sessions. + */ class Fill_ACE_QoS { - // TITLE - // This class helps users to add new flow specs and provides - // utility functions for filling up the flow specs for simplex/duplex - // sessions. public: typedef ACE_Hash_Map_Manager <ACE_CString, ACE_Flow_Spec *, ACE_Null_Mutex> FLOW_SPEC_HASH_MAP; //Initialization and termination methods. + /// constructor. Fill_ACE_QoS (void); - // constructor. + /// destructor. ~Fill_ACE_QoS (void); - // destructor. + /// To be used by receivers. Fills the receiver qos and sets the + /// sender qos to NO_TRAFFIC. int fill_simplex_receiver_qos (ACE_QoS &ace_qos, const ACE_CString &recv_flow_name); - // To be used by receivers. Fills the receiver qos and sets the - // sender qos to NO_TRAFFIC. + /// To be used by senders. Fills the sender qos and sets the receiver + /// qos to NO_TRAFFIC. int fill_simplex_sender_qos (ACE_QoS &ace_qos, const ACE_CString &send_flow_name); - // To be used by senders. Fills the sender qos and sets the receiver - // qos to NO_TRAFFIC. + /// To be used by applications that wish to be both receivers and + /// senders. int fill_duplex_qos (ACE_QoS &ace_qos, const ACE_CString &recv_flow_name, const ACE_CString &send_flow_name); - // To be used by applications that wish to be both receivers and - // senders. + /// Returns the hash map of flowspecs indexed by flowspec name. FLOW_SPEC_HASH_MAP& map (void); - // Returns the hash map of flowspecs indexed by flowspec name. private: diff --git a/ACE/examples/QOS/Change_Sender_TSpec/FlowSpec_Dbase.h b/ACE/examples/QOS/Change_Sender_TSpec/FlowSpec_Dbase.h index fc382048c13..5e3637c8455 100644 --- a/ACE/examples/QOS/Change_Sender_TSpec/FlowSpec_Dbase.h +++ b/ACE/examples/QOS/Change_Sender_TSpec/FlowSpec_Dbase.h @@ -1,18 +1,15 @@ /* -*- C++ -*- */ -//$Id$ - -// ============================================================================ -// -// = LIBRARY -// ACE_wrappers/examples/QOS -// -// = FILENAME -// FlowSpec_Dbase.h -// -// = AUTHOR -// Vishal Kachroo <vishal@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file FlowSpec_Dbase.h + * + * $Id$ + * + * @author Vishal Kachroo <vishal@cs.wustl.edu> + */ +//============================================================================= + #ifndef FLOWSPEC_DBASE_H #define FLOWSPEC_DBASE_H diff --git a/ACE/examples/QOS/Change_Sender_TSpec/QoS_Signal_Handler.h b/ACE/examples/QOS/Change_Sender_TSpec/QoS_Signal_Handler.h index b2d4a0f40fa..3ded5c10ad3 100644 --- a/ACE/examples/QOS/Change_Sender_TSpec/QoS_Signal_Handler.h +++ b/ACE/examples/QOS/Change_Sender_TSpec/QoS_Signal_Handler.h @@ -1,18 +1,15 @@ /* -*- C++ -*- */ -// $Id$ - -// ===================================================================== -// -// = LIBRARY -// ACE_wrappers/examples/QOS -// -// = FILENAME -// QoS_Signal_Handler.h -// -// = AUTHOR -// Vishal Kachroo <vishal@cs.wustl.edu> -// -// ===================================================================== + +//============================================================================= +/** + * @file QoS_Signal_Handler.h + * + * $Id$ + * + * @author Vishal Kachroo <vishal@cs.wustl.edu> + */ +//============================================================================= + #ifndef QOS_SIGNAL_HANDLER_H #define QOS_SIGNAL_HANDLER_H @@ -20,24 +17,27 @@ #include "ace/Event_Handler.h" #include "ace/QoS/QoS_Session.h" +/** + * @class QoS_Signal_Handler + TITLE + * This class Handles the SIGINT signal through the Reactor. + * Useful to gracefully release QoS sessions. + */ class QoS_Signal_Handler : public ACE_Event_Handler { - // TITLE - // This class Handles the SIGINT signal through the Reactor. - // Useful to gracefully release QoS sessions. public: + /// constructor. QoS_Signal_Handler (ACE_QoS_Session *qos_session); - // constructor. + /// Override this method to implement graceful shutdown. int handle_signal(int signum, siginfo_t*,ucontext_t*); - // Override this method to implement graceful shutdown. private: + /// Session to be gracefully shutdown. ACE_QoS_Session *qos_session_; - // Session to be gracefully shutdown. }; diff --git a/ACE/examples/QOS/Change_Sender_TSpec/QoS_Util.h b/ACE/examples/QOS/Change_Sender_TSpec/QoS_Util.h index ae347de68f6..fbde23e3802 100644 --- a/ACE/examples/QOS/Change_Sender_TSpec/QoS_Util.h +++ b/ACE/examples/QOS/Change_Sender_TSpec/QoS_Util.h @@ -1,18 +1,15 @@ /* -*- C++ -*- */ -// $Id$ - -// ===================================================================== -// -// = LIBRARY -// ACE_wrappers/examples/QOS -// -// = FILENAME -// QoS_Util.h -// -// = AUTHOR -// Vishal Kachroo <vishal@cs.wustl.edu> -// -// ===================================================================== + +//============================================================================= +/** + * @file QoS_Util.h + * + * $Id$ + * + * @author Vishal Kachroo <vishal@cs.wustl.edu> + */ +//============================================================================= + #ifndef QOS_UTIL_H #define QOS_UTIL_H @@ -20,11 +17,14 @@ #include "ace/INET_Addr.h" #include "ace/QoS/QoS_Session.h" +/** + * @class QoS_Util + * + * @brief This class provides the utility functions like parse_args () + * required by a QoS enabled application. + */ class QoS_Util { - // = TITLE - // This class provides the utility functions like parse_args () - // required by a QoS enabled application. public: diff --git a/ACE/examples/QOS/Change_Sender_TSpec/Receiver_QoS_Event_Handler.cpp b/ACE/examples/QOS/Change_Sender_TSpec/Receiver_QoS_Event_Handler.cpp index bac4fc1f2a5..9b6011a6763 100644 --- a/ACE/examples/QOS/Change_Sender_TSpec/Receiver_QoS_Event_Handler.cpp +++ b/ACE/examples/QOS/Change_Sender_TSpec/Receiver_QoS_Event_Handler.cpp @@ -1,18 +1,15 @@ /* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ACE_wrappers/examples/QOS -// -// = FILENAME -// Receiver_QoS_Event_Handler.cpp -// -// = AUTHOR -// Vishal Kachroo <vishal@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file Receiver_QoS_Event_Handler.cpp + * + * $Id$ + * + * @author Vishal Kachroo <vishal@cs.wustl.edu> + */ +//============================================================================= + #include "Receiver_QoS_Event_Handler.h" #include "ace/Log_Msg.h" diff --git a/ACE/examples/QOS/Change_Sender_TSpec/Receiver_QoS_Event_Handler.h b/ACE/examples/QOS/Change_Sender_TSpec/Receiver_QoS_Event_Handler.h index 900595a6778..35b6cd281ba 100644 --- a/ACE/examples/QOS/Change_Sender_TSpec/Receiver_QoS_Event_Handler.h +++ b/ACE/examples/QOS/Change_Sender_TSpec/Receiver_QoS_Event_Handler.h @@ -1,18 +1,15 @@ /* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ACE_wrappers/examples/QOS -// -// = FILENAME -// Receiver_QoS_Event_Handler.h -// -// = AUTHOR -// Vishal Kachroo <vishal@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file Receiver_QoS_Event_Handler.h + * + * $Id$ + * + * @author Vishal Kachroo <vishal@cs.wustl.edu> + */ +//============================================================================= + #ifndef RECEIVER_QOS_EVENT_HANDLER_H #define RECEIVER_QOS_EVENT_HANDLER_H @@ -27,25 +24,25 @@ class Receiver_QoS_Event_Handler : public ACE_Event_Handler { public: // = Initialization and Termination methods. + /// Constructor. Receiver_QoS_Event_Handler (void); - // Constructor. + /// Constructor. Receiver_QoS_Event_Handler (const ACE_SOCK_Dgram_Mcast_QoS &dgram_mcast_qos, ACE_QoS_Session *qos_session); - // Constructor. + /// Destructor. ~Receiver_QoS_Event_Handler (void); - // Destructor. + /// Override this to return the handle of the Dgram_Mcast + /// that we are using. virtual ACE_HANDLE get_handle (void) const; - // Override this to return the handle of the Dgram_Mcast - // that we are using. + /// Handles a READ event. virtual int handle_input (ACE_HANDLE fd); - // Handles a READ event. + /// Handles a QoS event. virtual int handle_qos (ACE_HANDLE fd); - // Handles a QoS event. private: ACE_SOCK_Dgram_Mcast_QoS dgram_mcast_qos_; diff --git a/ACE/examples/QOS/Change_Sender_TSpec/Sender_QoS_Event_Handler.cpp b/ACE/examples/QOS/Change_Sender_TSpec/Sender_QoS_Event_Handler.cpp index c93d3f07904..7612a105051 100644 --- a/ACE/examples/QOS/Change_Sender_TSpec/Sender_QoS_Event_Handler.cpp +++ b/ACE/examples/QOS/Change_Sender_TSpec/Sender_QoS_Event_Handler.cpp @@ -1,18 +1,15 @@ /* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ACE_wrappers/examples/QOS -// -// = FILENAME -// Sender_QoS_Event_Handler.cpp -// -// = AUTHOR -// Vishal Kachroo <vishal@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file Sender_QoS_Event_Handler.cpp + * + * $Id$ + * + * @author Vishal Kachroo <vishal@cs.wustl.edu> + */ +//============================================================================= + #include "Sender_QoS_Event_Handler.h" #include "ace/Log_Msg.h" diff --git a/ACE/examples/QOS/Change_Sender_TSpec/Sender_QoS_Event_Handler.h b/ACE/examples/QOS/Change_Sender_TSpec/Sender_QoS_Event_Handler.h index e93ed52adae..55ff2415bf6 100644 --- a/ACE/examples/QOS/Change_Sender_TSpec/Sender_QoS_Event_Handler.h +++ b/ACE/examples/QOS/Change_Sender_TSpec/Sender_QoS_Event_Handler.h @@ -1,18 +1,15 @@ /* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ACE_wrappers/examples/QOS -// -// = FILENAME -// Sender_QoS_Event_Handler.h -// -// = AUTHOR -// Vishal Kachroo <vishal@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file Sender_QoS_Event_Handler.h + * + * $Id$ + * + * @author Vishal Kachroo <vishal@cs.wustl.edu> + */ +//============================================================================= + #ifndef SENDER_QOS_EVENT_HANDLER_H #define SENDER_QOS_EVENT_HANDLER_H @@ -30,23 +27,23 @@ class Sender_QoS_Event_Handler : public ACE_Event_Handler { public: // = Initialization and Termination methods. + /// Constructor. Sender_QoS_Event_Handler (void); - // Constructor. + /// Constructor. Sender_QoS_Event_Handler (const ACE_SOCK_Dgram_Mcast_QoS &dgram_mcast_qos, ACE_QoS_Session *qos_session); - // Constructor. + /// Destructor. ~Sender_QoS_Event_Handler (void); - // Destructor. + /// Override this to return the handle of the Dgram_Mcast + /// that we are using. virtual ACE_HANDLE get_handle (void) const; - // Override this to return the handle of the Dgram_Mcast - // that we are using. + /// Handles a QoS event. Right now, just + /// prints a message. virtual int handle_qos (ACE_HANDLE fd); - // Handles a QoS event. Right now, just - // prints a message. private: diff --git a/ACE/examples/QOS/Change_Sender_TSpec/receiver.cpp b/ACE/examples/QOS/Change_Sender_TSpec/receiver.cpp index f329560dece..1d62b1134dd 100644 --- a/ACE/examples/QOS/Change_Sender_TSpec/receiver.cpp +++ b/ACE/examples/QOS/Change_Sender_TSpec/receiver.cpp @@ -1,18 +1,15 @@ /* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ACE_wrappers/examples/QOS -// -// = FILENAME -// server.cpp -// -// = AUTHOR -// Vishal Kachroo <vishal@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file receiver.cpp + * + * $Id$ + * + * @author Vishal Kachroo <vishal@cs.wustl.edu> + */ +//============================================================================= + #define QOSEVENT_MAIN diff --git a/ACE/examples/QOS/Change_Sender_TSpec/sender.cpp b/ACE/examples/QOS/Change_Sender_TSpec/sender.cpp index 1af380f90b3..6da7690a3b4 100644 --- a/ACE/examples/QOS/Change_Sender_TSpec/sender.cpp +++ b/ACE/examples/QOS/Change_Sender_TSpec/sender.cpp @@ -1,18 +1,15 @@ /* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ACE_wrappers/examples/QOS -// -// = FILENAME -// client.cpp -// -// = AUTHOR -// Vishal Kachroo <vishal@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file sender.cpp + * + * $Id$ + * + * @author Vishal Kachroo <vishal@cs.wustl.edu> + */ +//============================================================================= + #include "ace/QoS/QoS_Session.h" diff --git a/ACE/examples/QOS/Simple/Fill_ACE_QoS.h b/ACE/examples/QOS/Simple/Fill_ACE_QoS.h index 281b9beb876..86b7aed36f7 100644 --- a/ACE/examples/QOS/Simple/Fill_ACE_QoS.h +++ b/ACE/examples/QOS/Simple/Fill_ACE_QoS.h @@ -1,18 +1,15 @@ /* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ACE_wrappers/examples/QOS -// -// = FILENAME -// Fill_ACE_QoS.h -// -// = AUTHOR -// Vishal Kachroo <vishal@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file Fill_ACE_QoS.h + * + * $Id$ + * + * @author Vishal Kachroo <vishal@cs.wustl.edu> + */ +//============================================================================= + #ifndef FILL_ACE_QOS_H #define FILL_ACE_QOS_H @@ -23,41 +20,44 @@ #include "ace/Null_Mutex.h" #include "ace/OS_QoS.h" +/** + * @class Fill_ACE_QoS + TITLE + * This class helps users to add new flow specs and provides + * utility functions for filling up the flow specs for simplex/duplex + * sessions. + */ class Fill_ACE_QoS { - // TITLE - // This class helps users to add new flow specs and provides - // utility functions for filling up the flow specs for simplex/duplex - // sessions. public: typedef ACE_Hash_Map_Manager <ACE_CString, ACE_Flow_Spec *, ACE_Null_Mutex> FLOW_SPEC_HASH_MAP; //Initialization and termination methods. + /// constructor. Fill_ACE_QoS (void); - // constructor. + /// destructor. ~Fill_ACE_QoS (void); - // destructor. + /// To be used by receivers. Fills the receiver qos and sets the + /// sender qos to NO_TRAFFIC. int fill_simplex_receiver_qos (ACE_QoS &ace_qos, const ACE_CString &recv_flow_name); - // To be used by receivers. Fills the receiver qos and sets the - // sender qos to NO_TRAFFIC. + /// To be used by senders. Fills the sender qos and sets the receiver + /// qos to NO_TRAFFIC. int fill_simplex_sender_qos (ACE_QoS &ace_qos, const ACE_CString &send_flow_name); - // To be used by senders. Fills the sender qos and sets the receiver - // qos to NO_TRAFFIC. + /// To be used by applications that wish to be both receivers and + /// senders. int fill_duplex_qos (ACE_QoS &ace_qos, const ACE_CString &recv_flow_name, const ACE_CString &send_flow_name); - // To be used by applications that wish to be both receivers and - // senders. + /// Returns the hash map of flowspecs indexed by flowspec name. FLOW_SPEC_HASH_MAP& map (void); - // Returns the hash map of flowspecs indexed by flowspec name. private: diff --git a/ACE/examples/QOS/Simple/FlowSpec_Dbase.h b/ACE/examples/QOS/Simple/FlowSpec_Dbase.h index fc382048c13..5e3637c8455 100644 --- a/ACE/examples/QOS/Simple/FlowSpec_Dbase.h +++ b/ACE/examples/QOS/Simple/FlowSpec_Dbase.h @@ -1,18 +1,15 @@ /* -*- C++ -*- */ -//$Id$ - -// ============================================================================ -// -// = LIBRARY -// ACE_wrappers/examples/QOS -// -// = FILENAME -// FlowSpec_Dbase.h -// -// = AUTHOR -// Vishal Kachroo <vishal@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file FlowSpec_Dbase.h + * + * $Id$ + * + * @author Vishal Kachroo <vishal@cs.wustl.edu> + */ +//============================================================================= + #ifndef FLOWSPEC_DBASE_H #define FLOWSPEC_DBASE_H diff --git a/ACE/examples/QOS/Simple/QoS_Signal_Handler.h b/ACE/examples/QOS/Simple/QoS_Signal_Handler.h index b2d4a0f40fa..3ded5c10ad3 100644 --- a/ACE/examples/QOS/Simple/QoS_Signal_Handler.h +++ b/ACE/examples/QOS/Simple/QoS_Signal_Handler.h @@ -1,18 +1,15 @@ /* -*- C++ -*- */ -// $Id$ - -// ===================================================================== -// -// = LIBRARY -// ACE_wrappers/examples/QOS -// -// = FILENAME -// QoS_Signal_Handler.h -// -// = AUTHOR -// Vishal Kachroo <vishal@cs.wustl.edu> -// -// ===================================================================== + +//============================================================================= +/** + * @file QoS_Signal_Handler.h + * + * $Id$ + * + * @author Vishal Kachroo <vishal@cs.wustl.edu> + */ +//============================================================================= + #ifndef QOS_SIGNAL_HANDLER_H #define QOS_SIGNAL_HANDLER_H @@ -20,24 +17,27 @@ #include "ace/Event_Handler.h" #include "ace/QoS/QoS_Session.h" +/** + * @class QoS_Signal_Handler + TITLE + * This class Handles the SIGINT signal through the Reactor. + * Useful to gracefully release QoS sessions. + */ class QoS_Signal_Handler : public ACE_Event_Handler { - // TITLE - // This class Handles the SIGINT signal through the Reactor. - // Useful to gracefully release QoS sessions. public: + /// constructor. QoS_Signal_Handler (ACE_QoS_Session *qos_session); - // constructor. + /// Override this method to implement graceful shutdown. int handle_signal(int signum, siginfo_t*,ucontext_t*); - // Override this method to implement graceful shutdown. private: + /// Session to be gracefully shutdown. ACE_QoS_Session *qos_session_; - // Session to be gracefully shutdown. }; diff --git a/ACE/examples/QOS/Simple/QoS_Util.h b/ACE/examples/QOS/Simple/QoS_Util.h index ae347de68f6..fbde23e3802 100644 --- a/ACE/examples/QOS/Simple/QoS_Util.h +++ b/ACE/examples/QOS/Simple/QoS_Util.h @@ -1,18 +1,15 @@ /* -*- C++ -*- */ -// $Id$ - -// ===================================================================== -// -// = LIBRARY -// ACE_wrappers/examples/QOS -// -// = FILENAME -// QoS_Util.h -// -// = AUTHOR -// Vishal Kachroo <vishal@cs.wustl.edu> -// -// ===================================================================== + +//============================================================================= +/** + * @file QoS_Util.h + * + * $Id$ + * + * @author Vishal Kachroo <vishal@cs.wustl.edu> + */ +//============================================================================= + #ifndef QOS_UTIL_H #define QOS_UTIL_H @@ -20,11 +17,14 @@ #include "ace/INET_Addr.h" #include "ace/QoS/QoS_Session.h" +/** + * @class QoS_Util + * + * @brief This class provides the utility functions like parse_args () + * required by a QoS enabled application. + */ class QoS_Util { - // = TITLE - // This class provides the utility functions like parse_args () - // required by a QoS enabled application. public: diff --git a/ACE/examples/QOS/Simple/Receiver_QoS_Event_Handler.cpp b/ACE/examples/QOS/Simple/Receiver_QoS_Event_Handler.cpp index 69258313420..04262b2fcb2 100644 --- a/ACE/examples/QOS/Simple/Receiver_QoS_Event_Handler.cpp +++ b/ACE/examples/QOS/Simple/Receiver_QoS_Event_Handler.cpp @@ -1,18 +1,15 @@ /* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ACE_wrappers/examples/QOS -// -// = FILENAME -// Receiver_QoS_Event_Handler.cpp -// -// = AUTHOR -// Vishal Kachroo <vishal@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file Receiver_QoS_Event_Handler.cpp + * + * $Id$ + * + * @author Vishal Kachroo <vishal@cs.wustl.edu> + */ +//============================================================================= + #include "Receiver_QoS_Event_Handler.h" #include "ace/Log_Msg.h" diff --git a/ACE/examples/QOS/Simple/Receiver_QoS_Event_Handler.h b/ACE/examples/QOS/Simple/Receiver_QoS_Event_Handler.h index 900595a6778..35b6cd281ba 100644 --- a/ACE/examples/QOS/Simple/Receiver_QoS_Event_Handler.h +++ b/ACE/examples/QOS/Simple/Receiver_QoS_Event_Handler.h @@ -1,18 +1,15 @@ /* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ACE_wrappers/examples/QOS -// -// = FILENAME -// Receiver_QoS_Event_Handler.h -// -// = AUTHOR -// Vishal Kachroo <vishal@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file Receiver_QoS_Event_Handler.h + * + * $Id$ + * + * @author Vishal Kachroo <vishal@cs.wustl.edu> + */ +//============================================================================= + #ifndef RECEIVER_QOS_EVENT_HANDLER_H #define RECEIVER_QOS_EVENT_HANDLER_H @@ -27,25 +24,25 @@ class Receiver_QoS_Event_Handler : public ACE_Event_Handler { public: // = Initialization and Termination methods. + /// Constructor. Receiver_QoS_Event_Handler (void); - // Constructor. + /// Constructor. Receiver_QoS_Event_Handler (const ACE_SOCK_Dgram_Mcast_QoS &dgram_mcast_qos, ACE_QoS_Session *qos_session); - // Constructor. + /// Destructor. ~Receiver_QoS_Event_Handler (void); - // Destructor. + /// Override this to return the handle of the Dgram_Mcast + /// that we are using. virtual ACE_HANDLE get_handle (void) const; - // Override this to return the handle of the Dgram_Mcast - // that we are using. + /// Handles a READ event. virtual int handle_input (ACE_HANDLE fd); - // Handles a READ event. + /// Handles a QoS event. virtual int handle_qos (ACE_HANDLE fd); - // Handles a QoS event. private: ACE_SOCK_Dgram_Mcast_QoS dgram_mcast_qos_; diff --git a/ACE/examples/QOS/Simple/Sender_QoS_Event_Handler.cpp b/ACE/examples/QOS/Simple/Sender_QoS_Event_Handler.cpp index a1a8f42bbd9..fa4e49f7e34 100644 --- a/ACE/examples/QOS/Simple/Sender_QoS_Event_Handler.cpp +++ b/ACE/examples/QOS/Simple/Sender_QoS_Event_Handler.cpp @@ -1,18 +1,15 @@ /* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ACE_wrappers/examples/QOS -// -// = FILENAME -// Sender_QoS_Event_Handler.cpp -// -// = AUTHOR -// Vishal Kachroo <vishal@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file Sender_QoS_Event_Handler.cpp + * + * $Id$ + * + * @author Vishal Kachroo <vishal@cs.wustl.edu> + */ +//============================================================================= + #include "Sender_QoS_Event_Handler.h" #include "ace/Log_Msg.h" diff --git a/ACE/examples/QOS/Simple/Sender_QoS_Event_Handler.h b/ACE/examples/QOS/Simple/Sender_QoS_Event_Handler.h index e93ed52adae..55ff2415bf6 100644 --- a/ACE/examples/QOS/Simple/Sender_QoS_Event_Handler.h +++ b/ACE/examples/QOS/Simple/Sender_QoS_Event_Handler.h @@ -1,18 +1,15 @@ /* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ACE_wrappers/examples/QOS -// -// = FILENAME -// Sender_QoS_Event_Handler.h -// -// = AUTHOR -// Vishal Kachroo <vishal@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file Sender_QoS_Event_Handler.h + * + * $Id$ + * + * @author Vishal Kachroo <vishal@cs.wustl.edu> + */ +//============================================================================= + #ifndef SENDER_QOS_EVENT_HANDLER_H #define SENDER_QOS_EVENT_HANDLER_H @@ -30,23 +27,23 @@ class Sender_QoS_Event_Handler : public ACE_Event_Handler { public: // = Initialization and Termination methods. + /// Constructor. Sender_QoS_Event_Handler (void); - // Constructor. + /// Constructor. Sender_QoS_Event_Handler (const ACE_SOCK_Dgram_Mcast_QoS &dgram_mcast_qos, ACE_QoS_Session *qos_session); - // Constructor. + /// Destructor. ~Sender_QoS_Event_Handler (void); - // Destructor. + /// Override this to return the handle of the Dgram_Mcast + /// that we are using. virtual ACE_HANDLE get_handle (void) const; - // Override this to return the handle of the Dgram_Mcast - // that we are using. + /// Handles a QoS event. Right now, just + /// prints a message. virtual int handle_qos (ACE_HANDLE fd); - // Handles a QoS event. Right now, just - // prints a message. private: diff --git a/ACE/examples/QOS/Simple/receiver.cpp b/ACE/examples/QOS/Simple/receiver.cpp index cba39f779e1..d9f89397866 100644 --- a/ACE/examples/QOS/Simple/receiver.cpp +++ b/ACE/examples/QOS/Simple/receiver.cpp @@ -1,18 +1,15 @@ /* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ACE_wrappers/examples/QOS -// -// = FILENAME -// server.cpp -// -// = AUTHOR -// Vishal Kachroo <vishal@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file receiver.cpp + * + * $Id$ + * + * @author Vishal Kachroo <vishal@cs.wustl.edu> + */ +//============================================================================= + #define QOSEVENT_MAIN diff --git a/ACE/examples/QOS/Simple/sender.cpp b/ACE/examples/QOS/Simple/sender.cpp index 43684703be5..c04508a5664 100644 --- a/ACE/examples/QOS/Simple/sender.cpp +++ b/ACE/examples/QOS/Simple/sender.cpp @@ -1,18 +1,15 @@ /* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ACE_wrappers/examples/QOS -// -// = FILENAME -// client.cpp -// -// = AUTHOR -// Vishal Kachroo <vishal@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file sender.cpp + * + * $Id$ + * + * @author Vishal Kachroo <vishal@cs.wustl.edu> + */ +//============================================================================= + #include "ace/QoS/QoS_Session.h" diff --git a/ACE/examples/Reactor/Misc/test_early_timeouts.cpp b/ACE/examples/Reactor/Misc/test_early_timeouts.cpp index 52666e63c82..f22ffbb70f4 100644 --- a/ACE/examples/Reactor/Misc/test_early_timeouts.cpp +++ b/ACE/examples/Reactor/Misc/test_early_timeouts.cpp @@ -1,22 +1,19 @@ -// $Id$ - -// ================================================================ -// -// = LIBRARY -// examples/Reactor/Misc/ -// -// = FILENAME -// test_early_timeouts.cpp -// -// = DESCRIPTION -// On some platforms, select() returns before the time value -// specified. This tests counts the number of times this happens -// and the max early timeout. -// -// = AUTHOR -// Irfan Pyarali <irfan@cs.wustl.edu> -// -// ================================================================ + +//============================================================================= +/** + * @file test_early_timeouts.cpp + * + * $Id$ + * + * On some platforms, select() returns before the time value + * specified. This tests counts the number of times this happens + * and the max early timeout. + * + * + * @author Irfan Pyarali <irfan@cs.wustl.edu> + */ +//============================================================================= + #include "ace/Handle_Set.h" #include "ace/Pipe.h" diff --git a/ACE/examples/Reactor/Proactor/Aio_Platform_Test_C.cpp b/ACE/examples/Reactor/Proactor/Aio_Platform_Test_C.cpp index 32776323b85..f8487046e8a 100644 --- a/ACE/examples/Reactor/Proactor/Aio_Platform_Test_C.cpp +++ b/ACE/examples/Reactor/Proactor/Aio_Platform_Test_C.cpp @@ -1,19 +1,17 @@ -// $Id$ -// ============================================================================ -// -// = FILENAME -// aio_platform_test_c.cpp -// -// = DESCRITPTION -// Testing the platform for POSIX Asynchronous I/O. This is the C -// version of the $ACE_ROOT/tests/Aio_Platform_Test.cpp. Useful -// to send bug reports. -// -// = AUTHOR -// Programming for the Real World. Bill O. GallMeister. -// Modified by Alexander Babu Arulanthu <alex@cs.wustl.edu> -// -// ===================================================================== +//============================================================================= +/** + * @file Aio_Platform_Test_C.cpp + * + * $Id$ + * + * Testing the platform for POSIX Asynchronous I/O. This is the C + * version of the $ACE_ROOT/tests/Aio_Platform_Test.cpp. Useful + * to send bug reports. + * + * @author Programming for the Real World. Bill O. GallMeister. Modified by Alexander Babu Arulanthu <alex@cs.wustl.edu> + */ +//============================================================================= + #include <unistd.h> diff --git a/ACE/examples/Reactor/Proactor/post_completions.cpp b/ACE/examples/Reactor/Proactor/post_completions.cpp index ce24d5f5ef1..a554e044929 100644 --- a/ACE/examples/Reactor/Proactor/post_completions.cpp +++ b/ACE/examples/Reactor/Proactor/post_completions.cpp @@ -1,35 +1,30 @@ -// $Id$ -// ============================================================================ -// -// = FILENAME -// post_completions.cpp -// -// = DESCRITPTION -// This program demonstrates how to post fake completions to The -// Proactor. It also shows the how to specify the particular -// real-time signals to post completions. The Real-time signal -// based completion strategy is implemented with -// ACE_POSIX_SIG_PROACTOR. -// (So, it can be used only if both ACE_HAS_AIO_CALLS and -// ACE_HAS_POSIX_REALTIME_SIGNALS are defined.) -// Since it is faking results, you have to pay by knowing and -// using platform-specific implementation objects for Asynchronous -// Result classes. -// This example shows using an arbitrary result class for faking -// completions. You can also use the predefined Result classes for -// faking. The factory methods in the Proactor class create the -// Result objects. -// -// = COMPILATION -// make -// -// = RUN -// ./post_completions -// -// = AUTHOR -// Alexander Babu Arulanthu <alex@cs.wustl.edu> -// -// ===================================================================== +//============================================================================= +/** + * @file post_completions.cpp + * + * $Id$ + * + * This program demonstrates how to post fake completions to The + * Proactor. It also shows the how to specify the particular + * real-time signals to post completions. The Real-time signal + * based completion strategy is implemented with + * ACE_POSIX_SIG_PROACTOR. + * (So, it can be used only if both ACE_HAS_AIO_CALLS and + * ACE_HAS_POSIX_REALTIME_SIGNALS are defined.) + * Since it is faking results, you have to pay by knowing and + * using platform-specific implementation objects for Asynchronous + * Result classes. + * This example shows using an arbitrary result class for faking + * completions. You can also use the predefined Result classes for + * faking. The factory methods in the Proactor class create the + * Result objects. + * make + * ./post_completions + * + * @author Alexander Babu Arulanthu <alex@cs.wustl.edu> + */ +//============================================================================= + #include "ace/OS_NS_unistd.h" #include "ace/OS_main.h" @@ -54,14 +49,14 @@ static ACE_Atomic_Op <ACE_SYNCH_MUTEX, size_t> Completions_To_Go; #define RESULT_CLASS ACE_WIN32_Asynch_Result #endif /* ACE_HAS_AIO_CALLS */ +/** + * @class My_Result + * + * @brief Result Object that we will post to the Proactor. + * + */ class My_Result : public RESULT_CLASS { - // = TITLE - // - // Result Object that we will post to the Proactor. - // - // = DESCRIPTION - // public: My_Result (ACE_Handler &handler, @@ -83,14 +78,16 @@ public: {} // Destructor. + /** + * This is the method that will be called by the Proactor for + * dispatching the completion. This method generally calls one of + * the call back hood methods defined in the ACE_Handler + * class. But, we will just handle the completions here. + */ void complete (size_t, int success, const void *completion_key, u_long error) - // This is the method that will be called by the Proactor for - // dispatching the completion. This method generally calls one of - // the call back hood methods defined in the ACE_Handler - // class. But, we will just handle the completions here. { this->success_ = success; this->completion_key_ = completion_key; @@ -112,40 +109,41 @@ public: } private: + /// Sequence number for the result object. size_t sequence_number_; - // Sequence number for the result object. }; +/** + * @class My_Handler + * + * @brief Handler class for faked completions. + * + */ class My_Handler : public ACE_Handler { - // = TITLE - // - // Handler class for faked completions. - // - // = DESCRIPTION - // public: + /// Constructor. My_Handler (void) {} - // Constructor. + /// Destructor. virtual ~My_Handler (void) {} - // Destructor. }; +/** + * @class My_Task: + * + * @brief Contains thread functions which execute event loops. Each + * thread waits for a different signal. + */ class My_Task: public ACE_Task <ACE_NULL_SYNCH> { - // = TITLE - // - // Contains thread functions which execute event loops. Each - // thread waits for a different signal. - // public: + /// Constructor. My_Task (void) {} - // Constructor. + /// Destructor. virtual ~My_Task (void) {} - // Destructor. //FUZZ: disable check_for_lack_ACE_OS int open (void *proactor) @@ -175,8 +173,8 @@ public: } private: + /// Proactor for this task. ACE_Proactor *proactor_; - // Proactor for this task. }; int diff --git a/ACE/examples/Reactor/Proactor/simple_test_proactor.cpp b/ACE/examples/Reactor/Proactor/simple_test_proactor.cpp index da9ea33625f..fcd5efc5e24 100644 --- a/ACE/examples/Reactor/Proactor/simple_test_proactor.cpp +++ b/ACE/examples/Reactor/Proactor/simple_test_proactor.cpp @@ -1,20 +1,17 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// examples -// -// = FILENAME -// simple_test_proactor.cpp -// -// = DESCRIPTION -// Very simple version of test_proactor.cpp. -// -// = AUTHOR -// Alexander Babu Arulanthu (alex@cs.wustl.edu) -// -// ============================================================================ + +//============================================================================= +/** + * @file simple_test_proactor.cpp + * + * $Id$ + * + * Very simple version of test_proactor.cpp. + * + * + * @author Alexander Babu Arulanthu (alex@cs.wustl.edu) + */ +//============================================================================= + #include "ace/Service_Config.h" #include "ace/Proactor.h" @@ -33,51 +30,51 @@ static ACE_TCHAR *file = ACE_TEXT("simple_test_proactor.cpp"); static ACE_TCHAR *dump_file = ACE_TEXT("simple_output"); +/** + * @class Simple_Tester + * + * @brief Simple_Tester + * + * The class will be created by main(). This class reads a block + * from the file and write that to the dump file. + */ class Simple_Tester : public ACE_Handler { - // = TITLE - // - // Simple_Tester - // - // = DESCRIPTION - // - // The class will be created by main(). This class reads a block - // from the file and write that to the dump file. public: + /// Constructor. Simple_Tester (void); - // Constructor. ~Simple_Tester (void); //FUZZ: disable check_for_lack_ACE_OS + /// Open the operations and initiate read from the file. + ///FUZZ: enble check_for_lack_ACE_OS int open (void); - // Open the operations and initiate read from the file. - //FUZZ: enble check_for_lack_ACE_OS protected: // = These methods are called by the freamwork. + /// This is called when asynchronous reads from the socket complete. virtual void handle_read_file (const ACE_Asynch_Read_File::Result &result); - // This is called when asynchronous reads from the socket complete. + /// This is called when asynchronous writes from the socket complete. virtual void handle_write_file (const ACE_Asynch_Write_File::Result &result); - // This is called when asynchronous writes from the socket complete. private: int initiate_read_file (void); + /// rf (read file): for writing from the file. ACE_Asynch_Read_File rf_; - // rf (read file): for writing from the file. + /// ws (write File): for writing to the file. ACE_Asynch_Write_File wf_; - // ws (write File): for writing to the file. + /// File to read from. ACE_HANDLE input_file_; - // File to read from. + /// File for dumping data. ACE_HANDLE dump_file_; - // File for dumping data. // u_long file_offset_; // Current file offset diff --git a/ACE/examples/Reactor/Proactor/test_aiocb.cpp b/ACE/examples/Reactor/Proactor/test_aiocb.cpp index a5d266e47b4..b4b783b7db8 100644 --- a/ACE/examples/Reactor/Proactor/test_aiocb.cpp +++ b/ACE/examples/Reactor/Proactor/test_aiocb.cpp @@ -1,25 +1,22 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// proactor -// -// = FILENAME -// test_aiocb.cpp -// -// = DESCRIPTION -// Checkout $ACE_ROOT/examples/Reactor/Proactor/test_aiocb_ace.cpp, -// which is the ACE'ified version of this program. -// -// = COMPILE and RUN -// % CC -g -o test_aiocb -lrt test_aiocb.cpp -// % ./test_aiocb -// -// = AUTHOR -// Alexander Babu Arulanthu <alex@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file test_aiocb.cpp + * + * $Id$ + * + * Checkout $ACE_ROOT/examples/Reactor/Proactor/test_aiocb_ace.cpp, + * which is the ACE'ified version of this program. + * + * = COMPILE and RUN + * % CC -g -o test_aiocb -lrt test_aiocb.cpp + * % ./test_aiocb + * + * + * @author Alexander Babu Arulanthu <alex@cs.wustl.edu> + */ +//============================================================================= + //FUZZ: disable check_for_lack_ACE_OS //FUZZ: disable check_for_improper_main_declaration @@ -39,32 +36,32 @@ class Test_Aio { public: + /// Default constructor. Test_Aio (void); - // Default constructor. + /// Initting the output file and the buffer. int init (void); - // Initting the output file and the buffer. + /// Doing the testing stuff. int do_aio (void); - // Doing the testing stuff. + /// Destructor. ~Test_Aio (void); - // Destructor. private: + /// Output file descriptor. int out_fd_; - // Output file descriptor. + /// For writing to the file. struct aiocb *aiocb_write_; - // For writing to the file. + /// Reading stuff from the file. struct aiocb *aiocb_read_; - // Reading stuff from the file. + /// The buffer to be written to the out_fd. char *buffer_write_; - // The buffer to be written to the out_fd. + /// The buffer to be read back from the file. char *buffer_read_; - // The buffer to be read back from the file. }; Test_Aio::Test_Aio (void) diff --git a/ACE/examples/Reactor/Proactor/test_aiocb_ace.cpp b/ACE/examples/Reactor/Proactor/test_aiocb_ace.cpp index fe3234c22d9..b24b7bdace4 100644 --- a/ACE/examples/Reactor/Proactor/test_aiocb_ace.cpp +++ b/ACE/examples/Reactor/Proactor/test_aiocb_ace.cpp @@ -1,36 +1,33 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// proactor -// -// = FILENAME -// test_aiocb_ace.cpp -// -// = DESCRIPTION -// This program helps you to test the <aio_*> calls on a -// platform. -// -// Before running this test, make sure the platform can -// support POSIX <aio_> calls, using -// ACE_ROOT/tests/Aio_Platform_Test. -// -// This program tests the AIOCB (AIO Control Blocks) based -// completion approach which uses <aio_suspend> for completion -// querying. -// -// If this test is successful, ACE_POSIX_AIOCB_PROACTOR -// can be used on this platform. -// -// = COMPILE and RUN -// % make -// % ./test_aiocb_ace -// -// = AUTHOR -// Alexander Babu Arulanthu <alex@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file test_aiocb_ace.cpp + * + * $Id$ + * + * This program helps you to test the <aio_*> calls on a + * platform. + * + * Before running this test, make sure the platform can + * support POSIX <aio_> calls, using + * ACE_ROOT/tests/Aio_Platform_Test. + * + * This program tests the AIOCB (AIO Control Blocks) based + * completion approach which uses <aio_suspend> for completion + * querying. + * + * If this test is successful, ACE_POSIX_AIOCB_PROACTOR + * can be used on this platform. + * + * = COMPILE and RUN + * % make + * % ./test_aiocb_ace + * + * + * @author Alexander Babu Arulanthu <alex@cs.wustl.edu> + */ +//============================================================================= + #include "ace/ACE.h" #include "ace/Log_Msg.h" @@ -40,32 +37,32 @@ class Test_Aio { public: + /// Default constructor. Test_Aio (void); - // Default constructor. + /// Initting the output file and the buffer. int init (void); - // Initting the output file and the buffer. + /// Doing the testing stuff. int do_aio (void); - // Doing the testing stuff. + /// Destructor. ~Test_Aio (void); - // Destructor. private: + /// Output file descriptor. int out_fd_; - // Output file descriptor. + /// For writing to the file. struct aiocb *aiocb_write_; - // For writing to the file. + /// Reading stuff from the file. struct aiocb *aiocb_read_; - // Reading stuff from the file. + /// The buffer to be written to the out_fd. char *buffer_write_; - // The buffer to be written to the out_fd. + /// The buffer to be read back from the file. char *buffer_read_; - // The buffer to be read back from the file. }; Test_Aio::Test_Aio (void) diff --git a/ACE/examples/Reactor/Proactor/test_aiosig.cpp b/ACE/examples/Reactor/Proactor/test_aiosig.cpp index 944719968f1..b51e92bac32 100644 --- a/ACE/examples/Reactor/Proactor/test_aiosig.cpp +++ b/ACE/examples/Reactor/Proactor/test_aiosig.cpp @@ -1,24 +1,18 @@ -// $Id$ -// ============================================================================ -// -// = FILENAME -// test_aiosig.cpp -// -// = DESCRITPTION -// Check out test_aiosig_ace.cpp, the ACE'ified version of this -// program. This program may not be uptodate. -// -// = COMPILATION -// CC -g -o test_aiosig -lrt test_aiosig.cpp -// -// = RUN -// ./test_aiosig -// -// = AUTHOR -// Programming for the Real World. Bill O. GallMeister. -// Modified by Alexander Babu Arulanthu <alex@cs.wustl.edu> -// -// ===================================================================== +//============================================================================= +/** + * @file test_aiosig.cpp + * + * $Id$ + * + * Check out test_aiosig_ace.cpp, the ACE'ified version of this + * program. This program may not be uptodate. + * CC -g -o test_aiosig -lrt test_aiosig.cpp + * ./test_aiosig + * + * @author Programming for the Real World. Bill O. GallMeister. Modified by Alexander Babu Arulanthu <alex@cs.wustl.edu> + */ +//============================================================================= + //FUZZ: disable check_for_lack_ACE_OS //FUZZ: disable check_for_improper_main_declaration diff --git a/ACE/examples/Reactor/Proactor/test_aiosig_ace.cpp b/ACE/examples/Reactor/Proactor/test_aiosig_ace.cpp index fab137a4c02..21386c89383 100644 --- a/ACE/examples/Reactor/Proactor/test_aiosig_ace.cpp +++ b/ACE/examples/Reactor/Proactor/test_aiosig_ace.cpp @@ -1,43 +1,33 @@ -// $Id$ - -// ============================================================================ -// -// = FILENAME -// test_aiosig_sig.cpp -// -// = DESCRITPTION -// This program helps you to test the <aio_*> calls on a -// platform. -// Before running this test, make sure the platform can -// support POSIX <aio_> calls, using ACE_ROOT/tests/Aio_Plaform_Test.cpp -// -// This program tests the Signal based completion approach which -// uses <sigtimedwait> for completion querying. -// If this test is successful, ACE_POSIX_SIG_PROACTOR -// can be used on this platform. -// -// This program is a ACE version of the -// $ACE_ROOT/examples/Reactor/Proactor/test_aiosig.cpp, with -// ACE_DEBUGs and Message_Blocks. -// -// This test does the following: -// Issue two <aio_read>s. -// Assign SIGRTMIN as the notification signal. -// Mask these signals from delivery. -// Receive this signal by doing <sigtimedwait>. -// Wait for two completions (two signals) -// -// = COMPILATION -// make -// -// = RUN -// ./test_aiosig_ace -// -// = AUTHOR -// Programming for the Real World. Bill O. GallMeister. -// Modified by Alexander Babu Arulanthu <alex@cs.wustl.edu> -// -// ===================================================================== + +//============================================================================= +/** + * @file test_aiosig_ace.cpp + * + * $Id$ + * + * This program helps you to test the <aio_*> calls on a + * platform. + * Before running this test, make sure the platform can + * support POSIX <aio_> calls, using ACE_ROOT/tests/Aio_Plaform_Test.cpp + * This program tests the Signal based completion approach which + * uses <sigtimedwait> for completion querying. + * If this test is successful, ACE_POSIX_SIG_PROACTOR + * can be used on this platform. + * This program is a ACE version of the + * $ACE_ROOT/examples/Reactor/Proactor/test_aiosig.cpp, with + * ACE_DEBUGs and Message_Blocks. + * This test does the following: + * Issue two <aio_read>s. + * Assign SIGRTMIN as the notification signal. + * Mask these signals from delivery. + * Receive this signal by doing <sigtimedwait>. + * Wait for two completions (two signals) + * make + * ./test_aiosig_ace + * @author Programming for the Real World. Bill O. GallMeister. Modified by Alexander Babu Arulanthu <alex@cs.wustl.edu> + */ +//============================================================================= + #include "ace/Message_Block.h" #include "ace/Log_Msg.h" diff --git a/ACE/examples/Reactor/Proactor/test_cancel.cpp b/ACE/examples/Reactor/Proactor/test_cancel.cpp index 1d22d322b0c..b4e551ae2b4 100644 --- a/ACE/examples/Reactor/Proactor/test_cancel.cpp +++ b/ACE/examples/Reactor/Proactor/test_cancel.cpp @@ -1,39 +1,36 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// examples -// -// = FILENAME -// test_cancel.cpp -// -// = DESCRIPTION -// This program tests cancelling an Asynchronous Operation in the -// Proactor framework. -// -// This tests accepts a connection and issues an Asynchronous Read -// Stream. It reads <read_size> (option -s) number of bytes and -// when this operation completes, it issues another Asynchronous -// Read Stream to <read_size> and immediately calls <cancel> to -// cancel the operation and so the program exits closing the -// connection. -// -// Works fine on NT. On Solaris platforms, the asynch read is -// pending, but the cancel returns with the value <AIO_ALLDONE> -// indicating all the operations in that handle are done. -// But, LynxOS has a good <aio_cancel> implementation. It works -// fine. -// -// = RUN -// ./test_cancel -p <port_number> -// Then telnet to this port and send <read_size> bytes and your -// connection should get closed down. -// -// = AUTHOR -// Irfan Pyarali (irfan@cs.wustl.edu) -// -// ============================================================================ + +//============================================================================= +/** + * @file test_cancel.cpp + * + * $Id$ + * + * This program tests cancelling an Asynchronous Operation in the + * Proactor framework. + * + * This tests accepts a connection and issues an Asynchronous Read + * Stream. It reads <read_size> (option -s) number of bytes and + * when this operation completes, it issues another Asynchronous + * Read Stream to <read_size> and immediately calls <cancel> to + * cancel the operation and so the program exits closing the + * connection. + * + * Works fine on NT. On Solaris platforms, the asynch read is + * pending, but the cancel returns with the value <AIO_ALLDONE> + * indicating all the operations in that handle are done. + * But, LynxOS has a good <aio_cancel> implementation. It works + * fine. + * + * = RUN + * ./test_cancel -p <port_number> + * Then telnet to this port and send <read_size> bytes and your + * connection should get closed down. + * + * + * @author Irfan Pyarali (irfan@cs.wustl.edu) + */ +//============================================================================= + #include "ace/OS_main.h" #include "ace/Service_Config.h" diff --git a/ACE/examples/Reactor/Proactor/test_end_event_loop.cpp b/ACE/examples/Reactor/Proactor/test_end_event_loop.cpp index 2a87b875afe..4b1dff2d027 100644 --- a/ACE/examples/Reactor/Proactor/test_end_event_loop.cpp +++ b/ACE/examples/Reactor/Proactor/test_end_event_loop.cpp @@ -1,28 +1,22 @@ -// $Id$ -// ============================================================================ -// -// = FILENAME -// test_end_event_loop.cpp -// -// = DESCRITPTION -// This program tests the event loop mechanism of the -// Proactor. To end the event loop, threads that are blocked in -// waiting for completions are woken up and the event loop comes -// to the end. This is tested in this program. -// -// Threads are doing <run_event_loop> with/without time_out -// values and the main thread calls <end_event_loop>. -// -// = COMPILATION -// make -// -// = RUN -// ./test_end_event_loop -// -// = AUTHOR -// Alexander Babu Arulanthu <alex@cs.wustl.edu> -// -// ===================================================================== +//============================================================================= +/** + * @file test_end_event_loop.cpp + * + * $Id$ + * + * This program tests the event loop mechanism of the + * Proactor. To end the event loop, threads that are blocked in + * waiting for completions are woken up and the event loop comes + * to the end. This is tested in this program. + * Threads are doing <run_event_loop> with/without time_out + * values and the main thread calls <end_event_loop>. + * make + * ./test_end_event_loop + * + * @author Alexander Babu Arulanthu <alex@cs.wustl.edu> + */ +//============================================================================= + #include "ace/OS_NS_unistd.h" #include "ace/Proactor.h" @@ -35,21 +29,22 @@ // This only works on Win32 platforms and on Unix platforms supporting // POSIX aio calls. +/** + * @class My_Task: + * + * @brief Contains thread functions which execute event loops. Each + * thread waits for a different signal. + */ class My_Task: public ACE_Task <ACE_NULL_SYNCH> { - // = TITLE - // - // Contains thread functions which execute event loops. Each - // thread waits for a different signal. - // public: // Constructor. My_Task (void) : time_flag_ (0) {} + /// Destructor. virtual ~My_Task (void) {} - // Destructor. //FUZZ: disable check_for_lack_ACE_OS // If time_flag is zero do the eventloop indefinitely, otherwise do @@ -106,8 +101,8 @@ public: }; private: + /// If zero, indefinite event loop, otherwise timed event loop. int time_flag_; - // If zero, indefinite event loop, otherwise timed event loop. }; int diff --git a/ACE/examples/Reactor/Proactor/test_multiple_loops.cpp b/ACE/examples/Reactor/Proactor/test_multiple_loops.cpp index 22ed834d8e8..77d8cc13225 100644 --- a/ACE/examples/Reactor/Proactor/test_multiple_loops.cpp +++ b/ACE/examples/Reactor/Proactor/test_multiple_loops.cpp @@ -1,23 +1,20 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// examples -// -// = FILENAME -// test_multiple_loops.cpp -// -// = DESCRIPTION -// -// This example application shows how to write programs that -// combine the Proactor and Reactor event loops. This is possible -// only on WIN32 platform. -// -// = AUTHOR -// Irfan Pyarali -// -// ============================================================================ + +//============================================================================= +/** + * @file test_multiple_loops.cpp + * + * $Id$ + * + * + * This example application shows how to write programs that + * combine the Proactor and Reactor event loops. This is possible + * only on WIN32 platform. + * + * + * @author Irfan Pyarali + */ +//============================================================================= + #include "ace/Task.h" #include "ace/Proactor.h" @@ -29,10 +26,13 @@ #if defined (ACE_HAS_WIN32_OVERLAPPED_IO) +/** + * @class Timeout_Handler + * + * @brief Generic timeout handler. + */ class Timeout_Handler : public ACE_Handler, public ACE_Event_Handler { - // = TITLE - // Generic timeout handler. public: Timeout_Handler (void) diff --git a/ACE/examples/Reactor/Proactor/test_proactor.cpp b/ACE/examples/Reactor/Proactor/test_proactor.cpp index 3fdfe61f6c2..ea659f5720e 100644 --- a/ACE/examples/Reactor/Proactor/test_proactor.cpp +++ b/ACE/examples/Reactor/Proactor/test_proactor.cpp @@ -1,22 +1,19 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// examples -// -// = FILENAME -// test_proactor.cpp -// -// = DESCRIPTION -// This program illustrates how the <ACE_Proactor> can be used to -// implement an application that does various asynchronous -// operations. -// -// = AUTHOR -// Irfan Pyarali <irfan@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file test_proactor.cpp + * + * $Id$ + * + * This program illustrates how the <ACE_Proactor> can be used to + * implement an application that does various asynchronous + * operations. + * + * + * @author Irfan Pyarali <irfan@cs.wustl.edu> + */ +//============================================================================= + #include "ace/OS_NS_string.h" #include "ace/OS_main.h" @@ -272,20 +269,23 @@ Receiver::handle_write_file (const ACE_Asynch_Write_File::Result &result) ACE_ASSERT (result.bytes_to_write () == result.bytes_transferred ()); } +/** + * @class Sender + * + * @brief The class will be created by <main>. After connecting to the + * host, this class will then read data from a file and send it + * to the network connection. + */ class Sender : public ACE_Handler { - // = TITLE - // The class will be created by <main>. After connecting to the - // host, this class will then read data from a file and send it - // to the network connection. public: Sender (void); ~Sender (void); //FUZZ: disable check_for_lack_ACE_OS + ///FUZZ: enable check_for_lack_ACE_OS int open (const ACE_TCHAR *host, u_short port); - //FUZZ: enable check_for_lack_ACE_OS ACE_HANDLE handle (void) const; void handle (ACE_HANDLE); @@ -293,50 +293,52 @@ public: protected: // These methods are called by the freamwork + /** + * This is called when asynchronous transmit files complete + * This is called when asynchronous writes from the socket complete + * This is called when asynchronous reads from the socket complete + */ virtual void handle_transmit_file (const ACE_Asynch_Transmit_File::Result &result); - // This is called when asynchronous transmit files complete virtual void handle_write_stream (const ACE_Asynch_Write_Stream::Result &result); - // This is called when asynchronous writes from the socket complete virtual void handle_read_file (const ACE_Asynch_Read_File::Result &result); - // This is called when asynchronous reads from the socket complete private: + /// Transmit the entire file in one fell swoop. int transmit_file (void); - // Transmit the entire file in one fell swoop. + /// Initiate an asynchronous file read. int initiate_read_file (void); - // Initiate an asynchronous file read. + /// Network I/O handle ACE_SOCK_Stream stream_; - // Network I/O handle + /// ws (write stream): for writing to the socket ACE_Asynch_Write_Stream ws_; - // ws (write stream): for writing to the socket + /// rf (read file): for writing from the file ACE_Asynch_Read_File rf_; - // rf (read file): for writing from the file + /// Transmit file. ACE_Asynch_Transmit_File tf_; - // Transmit file. + /// File to read from ACE_HANDLE input_file_; - // File to read from + /// Current file offset u_long file_offset_; - // Current file offset + /// File size u_long file_size_; - // File size + /// Welcome message ACE_Message_Block welcome_message_; - // Welcome message + /// Header and trailer which goes with transmit_file ACE_Asynch_Transmit_File::Header_And_Trailer header_and_trailer_; - // Header and trailer which goes with transmit_file + /// These flags help to determine when to close down the event loop int stream_write_done_; int transmit_file_done_; - // These flags help to determine when to close down the event loop }; Sender::Sender (void) diff --git a/ACE/examples/Reactor/Proactor/test_proactor2.cpp b/ACE/examples/Reactor/Proactor/test_proactor2.cpp index 9c7a12bf3ba..7ba9657b951 100644 --- a/ACE/examples/Reactor/Proactor/test_proactor2.cpp +++ b/ACE/examples/Reactor/Proactor/test_proactor2.cpp @@ -1,24 +1,21 @@ -// $Id$ -// ============================================================================ -// -// = LIBRARY -// examples -// -// = FILENAME -// test_proactor2.cpp -// -// = DESCRIPTION -// Alexander Libman <Alibman@baltimore.com> modified -// <test_proactor> and made this test. Instead of writing received -// data to the file, the receiver sends them back to the -// sender,i.e. ACE_Asynch_Write_File wf_ has been changed to -// ACE_Asynch_Write_Stream wf_. -// -// = AUTHOR -// Irfan Pyarali <irfan@cs.wustl.edu> and Alexander Libman -// <Alibman@baltimore.com>. -// ============================================================================ +//============================================================================= +/** + * @file test_proactor2.cpp + * + * $Id$ + * + * Alexander Libman <Alibman@baltimore.com> modified + * <test_proactor> and made this test. Instead of writing received + * data to the file, the receiver sends them back to the + * sender,i.e. ACE_Asynch_Write_File wf_ has been changed to + * ACE_Asynch_Write_Stream wf_. + * + * + * @author Irfan Pyarali <irfan@cs.wustl.edu> and Alexander Libman <Alibman@baltimore.com>. + */ +//============================================================================= + #include "ace/Signal.h" @@ -119,23 +116,23 @@ public: ~Receiver (void); //FUZZ: disable check_for_lack_ACE_OS + /// This is called after the new connection has been accepted. + ///FUZZ: enable check_for_lack_ACE_OS virtual void open (ACE_HANDLE handle, ACE_Message_Block &message_block); - // This is called after the new connection has been accepted. - //FUZZ: enable check_for_lack_ACE_OS protected: // These methods are called by the framework + /// This is called when asynchronous <read> operation from the socket + /// complete. virtual void handle_read_stream (const ACE_Asynch_Read_Stream::Result &result); - // This is called when asynchronous <read> operation from the socket - // complete. + /// This is called when an asynchronous <write> to the file + /// completes. virtual void handle_write_stream (const ACE_Asynch_Write_Stream::Result &result); - // This is called when an asynchronous <write> to the file - // completes. private: int initiate_read_stream (void); @@ -374,9 +371,9 @@ public: ~Sender (void); //FUZZ: disable check_for_lack_ACE_OS + ///FUZZ: enable check_for_lack_ACE_OS int open (const ACE_TCHAR *host, u_short port); void close (); - //FUZZ: enable check_for_lack_ACE_OS ACE_HANDLE handle (void) const; void handle (ACE_HANDLE); @@ -384,30 +381,30 @@ public: protected: // These methods are called by the freamwork +/// This is called when asynchronous reads from the socket complete virtual void handle_read_stream (const ACE_Asynch_Read_Stream::Result &result); -// This is called when asynchronous reads from the socket complete +/// This is called when asynchronous writes from the socket complete virtual void handle_write_stream (const ACE_Asynch_Write_Stream::Result &result); -// This is called when asynchronous writes from the socket complete private: int initiate_read_stream (void); int initiate_write_stream (void); +/// Network I/O handle ACE_SOCK_Stream stream_; -// Network I/O handle +/// ws (write stream): for writing to the socket ACE_Asynch_Write_Stream ws_; -// ws (write stream): for writing to the socket +/// rs (read file): for reading from the socket ACE_Asynch_Read_Stream rs_; -// rs (read file): for reading from the socket +/// Welcome message ACE_Message_Block welcome_message_; -// Welcome message MyMutex m_Mtx ; long nIOCount ; diff --git a/ACE/examples/Reactor/Proactor/test_proactor3.cpp b/ACE/examples/Reactor/Proactor/test_proactor3.cpp index 45b8b92fef0..1d041e3ea6a 100644 --- a/ACE/examples/Reactor/Proactor/test_proactor3.cpp +++ b/ACE/examples/Reactor/Proactor/test_proactor3.cpp @@ -1,23 +1,19 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// examples -// -// = FILENAME -// test_proactor3.cpp -// -// = DESCRIPTION -// This program illustrates how the <ACE_Proactor> can be used to -// implement an application that does various asynchronous -// operations. -// -// = AUTHOR -// Irfan Pyarali <irfan@cs.wustl.edu> -// modified by Alexander Libman <alibman@baltimore.com> -// from original test_proactor.cpp -// ============================================================================ + +//============================================================================= +/** + * @file test_proactor3.cpp + * + * $Id$ + * + * This program illustrates how the <ACE_Proactor> can be used to + * implement an application that does various asynchronous + * operations. + * + * + * @author Irfan Pyarali <irfan@cs.wustl.edu> modified by Alexander Libman <alibman@baltimore.com> from original test_proactor.cpp + */ +//============================================================================= + #include "ace/Signal.h" @@ -88,10 +84,13 @@ static int threads = 1; // Port that we're receiving connections on. static u_short port = ACE_DEFAULT_SERVER_PORT; +/** + * @class MyTask: + * + * @brief MyTask plays role for Proactor threads pool + */ class MyTask: public ACE_Task<ACE_MT_SYNCH> { - // = TITLE - // MyTask plays role for Proactor threads pool public: MyTask (void) : threads_ (0), proactor_ (0) {} @@ -193,23 +192,23 @@ public: ~Receiver (void); //FUZZ: disable check_for_lack_ACE_OS + /// This is called after the new connection has been accepted. + ///FUZZ: enable check_for_lack_ACE_OS virtual void open (ACE_HANDLE handle, ACE_Message_Block &message_block); - // This is called after the new connection has been accepted. - //FUZZ: enable check_for_lack_ACE_OS static long get_number_sessions (void) { return sessions_; } protected: // These methods are called by the framework + /// This is called when asynchronous <read> operation from the socket + /// complete. virtual void handle_read_stream (const ACE_Asynch_Read_Stream::Result &result); - // This is called when asynchronous <read> operation from the socket - // complete. + /// This is called when an asynchronous <write> to the file + /// completes. virtual void handle_write_stream (const ACE_Asynch_Write_Stream::Result &result); - // This is called when an asynchronous <write> to the file - // completes. private: int initiate_read_stream (void); @@ -418,18 +417,21 @@ Receiver::handle_write_stream (const ACE_Asynch_Write_Stream::Result &result) check_destroy (); } +/** + * @class Sender + * + * @brief Sends welcome messages receives them back. + */ class Sender : public ACE_Handler { - // = TITLE - // Sends welcome messages receives them back. public: Sender (void); ~Sender (void); //FUZZ: disable check_for_lack_ACE_OS + ///FUZZ: enable check_for_lack_ACE_OS int open (const ACE_TCHAR *host, u_short port); void close (void); - //FUZZ: enable check_for_lack_ACE_OS ACE_HANDLE handle (void) const; virtual void handle (ACE_HANDLE); @@ -437,28 +439,28 @@ public: protected: // These methods are called by the freamwork + /// This is called when asynchronous reads from the socket complete virtual void handle_read_stream (const ACE_Asynch_Read_Stream::Result &result); - // This is called when asynchronous reads from the socket complete + /// This is called when asynchronous writes from the socket complete virtual void handle_write_stream (const ACE_Asynch_Write_Stream::Result &result); - // This is called when asynchronous writes from the socket complete private: int initiate_read_stream (void); int initiate_write_stream (void); + /// Network I/O handle ACE_SOCK_Stream stream_; - // Network I/O handle + /// ws (write stream): for writing to the socket ACE_Asynch_Write_Stream ws_; - // ws (write stream): for writing to the socket + /// rs (read file): for reading from the socket ACE_Asynch_Read_Stream rs_; - // rs (read file): for reading from the socket + /// Welcome message ACE_Message_Block welcome_message_; - // Welcome message ACE_Recursive_Thread_Mutex mutex_; long io_count_; diff --git a/ACE/examples/Reactor/Proactor/test_timeout.cpp b/ACE/examples/Reactor/Proactor/test_timeout.cpp index c70b043d076..9f37ee4670f 100644 --- a/ACE/examples/Reactor/Proactor/test_timeout.cpp +++ b/ACE/examples/Reactor/Proactor/test_timeout.cpp @@ -1,25 +1,22 @@ -// $Id: test_timeout.cpp - -// ============================================================================ -// -// = LIBRARY -// examples -// -// = FILENAME -// test_timeout.cpp -// -// = DESCRIPTION -// -// This example application shows how to write event loops that -// handle events for some fixed amount of time. Note that any -// thread in the Proactor thread pool can call back the handler. On -// POSIX4 systems, this test works only with POSIX_SIG_Proactor, -// which can work with multiple threads. -// -// = AUTHOR -// Irfan Pyarali and Alexander Babu Arulanthu -// -// ============================================================================ + +//============================================================================= +/** + * @file test_timeout.cpp + * + * $Id: test_timeout.cpp + * + * + * This example application shows how to write event loops that + * handle events for some fixed amount of time. Note that any + * thread in the Proactor thread pool can call back the handler. On + * POSIX4 systems, this test works only with POSIX_SIG_Proactor, + * which can work with multiple threads. + * + * + * @author Irfan Pyarali and Alexander Babu Arulanthu + */ +//============================================================================= + #include "ace/Proactor.h" #include "ace/Task.h" @@ -34,10 +31,13 @@ // This only works on Win32 platforms and on Unix platforms supporting // POSIX aio calls. +/** + * @class Timeout_Handler + * + * @brief Generic timeout handler. + */ class Timeout_Handler : public ACE_Handler { - // = TITLE - // Generic timeout handler. public: Timeout_Handler (void) : start_time_ (ACE_OS::gettimeofday ()) @@ -58,11 +58,11 @@ public: } private: + /// Number of the timer event. ACE_Atomic_Op <ACE_SYNCH_MUTEX, int> count_; - // Number of the timer event. + /// Starting time of the test. ACE_Time_Value start_time_; - // Starting time of the test. }; class Worker : public ACE_Task <ACE_NULL_SYNCH> diff --git a/ACE/examples/Reactor/Proactor/test_timeout_st.cpp b/ACE/examples/Reactor/Proactor/test_timeout_st.cpp index 1660a711ce2..aafabeb36f3 100644 --- a/ACE/examples/Reactor/Proactor/test_timeout_st.cpp +++ b/ACE/examples/Reactor/Proactor/test_timeout_st.cpp @@ -1,23 +1,20 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// examples -// -// = FILENAME -// test_timeout_st.cpp -// -// = DESCRIPTION -// -// This example application shows how to write event loops that -// handle events for some fixed amount of time. This is the single -// threaded version of the test_timeout.cpp application. -// -// = AUTHOR -// Irfan Pyarali and Alexander Babu Arulanthu -// -// ============================================================================ + +//============================================================================= +/** + * @file test_timeout_st.cpp + * + * $Id$ + * + * + * This example application shows how to write event loops that + * handle events for some fixed amount of time. This is the single + * threaded version of the test_timeout.cpp application. + * + * + * @author Irfan Pyarali and Alexander Babu Arulanthu + */ +//============================================================================= + #include "ace/Proactor.h" #include "ace/OS_main.h" @@ -28,10 +25,13 @@ // This only works on Win32 platforms and on Unix platforms supporting // POSIX aio calls. +/** + * @class Timeout_Handler + * + * @brief Generic timeout handler. + */ class Timeout_Handler : public ACE_Handler { - // = TITLE - // Generic timeout handler. public: Timeout_Handler (void) @@ -51,11 +51,11 @@ public: } private: + /// Sequence number for the timeouts. int count_; - // Sequence number for the timeouts. + /// Starting time of the test. ACE_Time_Value start_time_; - // Starting time of the test. }; diff --git a/ACE/examples/Reactor/Proactor/test_udp_proactor.cpp b/ACE/examples/Reactor/Proactor/test_udp_proactor.cpp index c0d4a7a6171..d802ef412ce 100644 --- a/ACE/examples/Reactor/Proactor/test_udp_proactor.cpp +++ b/ACE/examples/Reactor/Proactor/test_udp_proactor.cpp @@ -1,23 +1,19 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// examples -// -// = FILENAME -// test_udp_proactor.cpp -// -// = DESCRIPTION -// This program illustrates how the <ACE_Proactor> can be used to -// implement an application that does asynchronous operations using -// datagrams. -// -// = AUTHOR -// Irfan Pyarali <irfan@cs.wustl.edu> and -// Roger Tragin <r.tragin@computer.org> -// -// ============================================================================ + +//============================================================================= +/** + * @file test_udp_proactor.cpp + * + * $Id$ + * + * This program illustrates how the <ACE_Proactor> can be used to + * implement an application that does asynchronous operations using + * datagrams. + * + * + * @author Irfan Pyarali <irfan@cs.wustl.edu> and Roger Tragin <r.tragin@computer.org> + */ +//============================================================================= + #include "ace/OS_NS_string.h" #include "ace/OS_main.h" @@ -43,11 +39,14 @@ static u_short port = ACE_DEFAULT_SERVER_PORT; // Keep track of when we're done. static int done = 0; +/** + * @class Receiver + * + * @brief This class will receive data from + * the network connection and dump it to a file. + */ class Receiver : public ACE_Service_Handler { - // = TITLE - // This class will receive data from - // the network connection and dump it to a file. public: // = Initialization and termination. Receiver (void); @@ -65,8 +64,8 @@ protected: private: ACE_SOCK_Dgram sock_dgram_; + /// rd (read dgram): for reading from a UDP socket. ACE_Asynch_Read_Dgram rd_; - // rd (read dgram): for reading from a UDP socket. const char* completion_key_; const char* act_; }; @@ -216,32 +215,35 @@ Receiver::handle_read_dgram (const ACE_Asynch_Read_Dgram::Result &result) done++; } +/** + * @class Sender + * + * @brief The class will be created by <main>. + */ class Sender : public ACE_Handler { - // = TITLE - // The class will be created by <main>. public: Sender (void); ~Sender (void); //FUZZ: disable check_for_lack_ACE_OS + ///FUZZ: enable check_for_lack_ACE_OS int open (const ACE_TCHAR *host, u_short port); - //FUZZ: enable check_for_lack_ACE_OS protected: // These methods are called by the freamwork + /// This is called when asynchronous writes from the dgram socket + /// complete virtual void handle_write_dgram (const ACE_Asynch_Write_Dgram::Result &result); - // This is called when asynchronous writes from the dgram socket - // complete private: + /// Network I/O handle ACE_SOCK_Dgram sock_dgram_; - // Network I/O handle + /// wd (write dgram): for writing to the socket ACE_Asynch_Write_Dgram wd_; - // wd (write dgram): for writing to the socket const char* completion_key_; const char* act_; diff --git a/ACE/examples/Reactor/WFMO_Reactor/APC.cpp b/ACE/examples/Reactor/WFMO_Reactor/APC.cpp index 68addd47a51..b45c4036267 100644 --- a/ACE/examples/Reactor/WFMO_Reactor/APC.cpp +++ b/ACE/examples/Reactor/WFMO_Reactor/APC.cpp @@ -1,23 +1,19 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// examples -// -// = FILENAME -// APC.cpp -// -// = DESCRIPTION -// -// Tests the WFMO_Reactor's ability to handle regular APC -// notifications. -// -// = AUTHOR -// -// Irfan Pyarali <irfan@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file APC.cpp + * + * $Id$ + * + * + * Tests the WFMO_Reactor's ability to handle regular APC + * notifications. + * + * + * @author Irfan Pyarali <irfan@cs.wustl.edu> + */ +//============================================================================= + #include "ace/OS_main.h" diff --git a/ACE/examples/Reactor/WFMO_Reactor/Abandoned.cpp b/ACE/examples/Reactor/WFMO_Reactor/Abandoned.cpp index c03110098a2..4edef8dfc78 100644 --- a/ACE/examples/Reactor/WFMO_Reactor/Abandoned.cpp +++ b/ACE/examples/Reactor/WFMO_Reactor/Abandoned.cpp @@ -1,22 +1,18 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// examples -// -// = FILENAME -// Abandoned.cpp -// -// = DESCRIPTION -// -// Tests the WFMO_Reactor's ability to handle abandoned mutexes. -// -// = AUTHOR -// -// Irfan Pyarali <irfan@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file Abandoned.cpp + * + * $Id$ + * + * + * Tests the WFMO_Reactor's ability to handle abandoned mutexes. + * + * + * @author Irfan Pyarali <irfan@cs.wustl.edu> + */ +//============================================================================= + #include "ace/OS_main.h" diff --git a/ACE/examples/Reactor/WFMO_Reactor/Console_Input.cpp b/ACE/examples/Reactor/WFMO_Reactor/Console_Input.cpp index 4d903f1a983..4d1c9d96c40 100644 --- a/ACE/examples/Reactor/WFMO_Reactor/Console_Input.cpp +++ b/ACE/examples/Reactor/WFMO_Reactor/Console_Input.cpp @@ -1,22 +1,19 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// examples -// -// = FILENAME -// Console_Input.cpp -// -// = DESCRIPTION -// -// This application tests the working of WFMO_Reactor when users -// are interested in console input. -// -// = AUTHOR -// Irfan Pyarali <irfan@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file Console_Input.cpp + * + * $Id$ + * + * + * This application tests the working of WFMO_Reactor when users + * are interested in console input. + * + * + * @author Irfan Pyarali <irfan@cs.wustl.edu> + */ +//============================================================================= + #include "ace/Reactor.h" #include "ace/OS_NS_unistd.h" diff --git a/ACE/examples/Reactor/WFMO_Reactor/Directory_Changes.cpp b/ACE/examples/Reactor/WFMO_Reactor/Directory_Changes.cpp index 620de253b3d..467029cabe7 100644 --- a/ACE/examples/Reactor/WFMO_Reactor/Directory_Changes.cpp +++ b/ACE/examples/Reactor/WFMO_Reactor/Directory_Changes.cpp @@ -1,22 +1,18 @@ -// $Id$ -// -// ============================================================================ -// -// = LIBRARY -// examples -// -// = FILENAME -// Directory_Changes.cpp -// -// = DESCRIPTION -// -// This application tests the working of WFMO_Reactor when users -// are interested in monitoring changes in the filesystem. -// -// = AUTHOR -// Irfan Pyarali -// -// ============================================================================ +//============================================================================= +/** + * @file Directory_Changes.cpp + * + * $Id$ + * + * + * This application tests the working of WFMO_Reactor when users + * are interested in monitoring changes in the filesystem. + * + * + * @author Irfan Pyarali + */ +//============================================================================= + #include "ace/OS_main.h" diff --git a/ACE/examples/Reactor/WFMO_Reactor/Exceptions.cpp b/ACE/examples/Reactor/WFMO_Reactor/Exceptions.cpp index f859362f2a8..b52807a931d 100644 --- a/ACE/examples/Reactor/WFMO_Reactor/Exceptions.cpp +++ b/ACE/examples/Reactor/WFMO_Reactor/Exceptions.cpp @@ -1,27 +1,23 @@ -// $Id$ -// -// ============================================================================ -// -// = LIBRARY -// examples -// -// = FILENAME -// Exceptions.cpp -// -// = DESCRIPTION -// -// This test application tests the state of WFMO_Reactor when -// exceptions occurs when executing user callbacks. -// -// The thread count in WFMO_Reactor is used to ensure that state of -// WFMO_Reactor is not fouled up when exceptions occur in user code. -// This example also shows how to write event loops that survive -// user exceptions -// -// = AUTHOR -// Irfan Pyarali -// -// ============================================================================ +//============================================================================= +/** + * @file Exceptions.cpp + * + * $Id$ + * + * + * This test application tests the state of WFMO_Reactor when + * exceptions occurs when executing user callbacks. + * + * The thread count in WFMO_Reactor is used to ensure that state of + * WFMO_Reactor is not fouled up when exceptions occur in user code. + * This example also shows how to write event loops that survive + * user exceptions + * + * + * @author Irfan Pyarali + */ +//============================================================================= + #include "ace/OS_main.h" diff --git a/ACE/examples/Reactor/WFMO_Reactor/Handle_Close.cpp b/ACE/examples/Reactor/WFMO_Reactor/Handle_Close.cpp index e11605d303b..2d0fd1077fb 100644 --- a/ACE/examples/Reactor/WFMO_Reactor/Handle_Close.cpp +++ b/ACE/examples/Reactor/WFMO_Reactor/Handle_Close.cpp @@ -1,24 +1,20 @@ -// $Id$ -// -// ============================================================================ -// -// = LIBRARY -// examples -// -// = FILENAME -// Handle_Close.cpp -// -// = DESCRIPTION -// -// This application tests whether handle_close gets called and if -// the correct masks are passed along. The handler should get -// handle_close called for all three masks (READ, WRITE, and -// EXCEPT). -// -// = AUTHOR -// Irfan Pyarali -// -// ============================================================================ +//============================================================================= +/** + * @file Handle_Close.cpp + * + * $Id$ + * + * + * This application tests whether handle_close gets called and if + * the correct masks are passed along. The handler should get + * handle_close called for all three masks (READ, WRITE, and + * EXCEPT). + * + * + * @author Irfan Pyarali + */ +//============================================================================= + #include "ace/Get_Opt.h" #include "ace/Reactor.h" diff --git a/ACE/examples/Reactor/WFMO_Reactor/Multithreading.cpp b/ACE/examples/Reactor/WFMO_Reactor/Multithreading.cpp index ad939e0261c..0212776b0ff 100644 --- a/ACE/examples/Reactor/WFMO_Reactor/Multithreading.cpp +++ b/ACE/examples/Reactor/WFMO_Reactor/Multithreading.cpp @@ -1,26 +1,22 @@ -// $Id$ -// -// ============================================================================ -// -// = LIBRARY -// examples -// -// = FILENAME -// Multithreading.cpp -// -// = DESCRIPTION -// -// This application tests multiple threads simultaneously calling -// Reactor::handle_events(). It also shows how different threads -// can update the state of Reactor by registering and removing -// Event_Handlers. -// -// Note that this test will only work with WFMO_Reactor -// -// = AUTHOR -// Irfan Pyarali -// -// ============================================================================ +//============================================================================= +/** + * @file Multithreading.cpp + * + * $Id$ + * + * + * This application tests multiple threads simultaneously calling + * Reactor::handle_events(). It also shows how different threads + * can update the state of Reactor by registering and removing + * Event_Handlers. + * + * Note that this test will only work with WFMO_Reactor + * + * + * @author Irfan Pyarali + */ +//============================================================================= + #include "ace/OS_main.h" @@ -88,31 +84,31 @@ parse_args (int argc, ACE_TCHAR **argv) class Task_Handler : public ACE_Task<ACE_NULL_SYNCH> { public: + /// Constructor. Task_Handler (size_t number_of_handles, size_t concurrent_threads); - // Constructor. + /// Destructor. ~Task_Handler (void); - // Destructor. + /// Called when object is removed from the ACE_Reactor virtual int handle_close (ACE_HANDLE handle, ACE_Reactor_Mask close_mask); - // Called when object is removed from the ACE_Reactor + /// Handle events being signaled by the main thread. int handle_signal (int signum, siginfo_t * = 0, ucontext_t * = 0); - // Handle events being signaled by the main thread. + /// Called when timer expires. virtual int handle_timeout (const ACE_Time_Value &tv, const void *arg = 0); - // Called when timer expires. + /// Task event loop. int svc (void); - // Task event loop. //FUZZ: disable check_for_lack_ACE_OS + /// Signal an event. + ///FUZZ: enable check_for_lack_ACE_OS int signal (size_t index); - // Signal an event. - //FUZZ: enable check_for_lack_ACE_OS private: ACE_Auto_Event *events_; diff --git a/ACE/examples/Reactor/WFMO_Reactor/Network_Events.cpp b/ACE/examples/Reactor/WFMO_Reactor/Network_Events.cpp index eca99573870..db7e279178d 100644 --- a/ACE/examples/Reactor/WFMO_Reactor/Network_Events.cpp +++ b/ACE/examples/Reactor/WFMO_Reactor/Network_Events.cpp @@ -1,35 +1,31 @@ -// $Id$ -// -// ============================================================================ -// -// = LIBRARY -// examples -// -// = FILENAME -// Network_Events.cpp -// -// = DESCRIPTION -// -// This application tests Reactor to make sure that it responds -// correctly to different kinds of network events. -// -// The test starts off by creating a Network_Listener, that listens -// for connections at ACE_DEFAULT_SERVER_PORT. When a client -// connects, a Network_Handler is created. Network_Handler reads -// messages off the socket and prints them out. This is done until -// the remote side shuts down. Multiple clients can connect at the -// same time. -// -// Events tested in this example includes ACCEPT, READ, and CLOSE masks. -// -// To run this example, start an instance of this example and -// connect to it using telnet (to port -// ACE_DEFAULT_SERVER_PORT(20002)). -// -// = AUTHOR -// Irfan Pyarali -// -// ============================================================================ +//============================================================================= +/** + * @file Network_Events.cpp + * + * $Id$ + * + * + * This application tests Reactor to make sure that it responds + * correctly to different kinds of network events. + * + * The test starts off by creating a Network_Listener, that listens + * for connections at ACE_DEFAULT_SERVER_PORT. When a client + * connects, a Network_Handler is created. Network_Handler reads + * messages off the socket and prints them out. This is done until + * the remote side shuts down. Multiple clients can connect at the + * same time. + * + * Events tested in this example includes ACCEPT, READ, and CLOSE masks. + * + * To run this example, start an instance of this example and + * connect to it using telnet (to port + * ACE_DEFAULT_SERVER_PORT(20002)). + * + * + * @author Irfan Pyarali + */ +//============================================================================= + #include "ace/Reactor.h" #include "ace/WFMO_Reactor.h" @@ -43,8 +39,8 @@ class Network_Handler : public ACE_Event_Handler { public: + /// Default constructor Network_Handler (ACE_SOCK_Stream &s); - // Default constructor virtual int handle_input (ACE_HANDLE handle); virtual int handle_close (ACE_HANDLE handle, @@ -119,10 +115,10 @@ Network_Handler::handle_close (ACE_HANDLE handle, class Network_Listener : public ACE_Event_Handler { public: + /// Default constructor + /// Default constructor Network_Listener (void); - // Default constructor ~Network_Listener (void); - // Default constructor virtual int handle_input (ACE_HANDLE handle); virtual int handle_close (ACE_HANDLE handle, diff --git a/ACE/examples/Reactor/WFMO_Reactor/Prerun_State_Changes.cpp b/ACE/examples/Reactor/WFMO_Reactor/Prerun_State_Changes.cpp index 90d382c6349..828620d89f8 100644 --- a/ACE/examples/Reactor/WFMO_Reactor/Prerun_State_Changes.cpp +++ b/ACE/examples/Reactor/WFMO_Reactor/Prerun_State_Changes.cpp @@ -1,23 +1,18 @@ -// $Id$ -// -// ============================================================================ -// -// = LIBRARY -// examples -// -// = FILENAME -// Prerun_State_Changes.cpp -// -// = DESCRIPTION -// -// Tests the Reactor's ability to handle state changes before -// getting a chance to run. -// -// = AUTHOR -// -// Irfan Pyarali -// -// ============================================================================ +//============================================================================= +/** + * @file Prerun_State_Changes.cpp + * + * $Id$ + * + * + * Tests the Reactor's ability to handle state changes before + * getting a chance to run. + * + * + * @author Irfan Pyarali + */ +//============================================================================= + #include "ace/Reactor.h" #include "ace/OS_main.h" @@ -26,10 +21,12 @@ +/** + * @class Event_Handler + * + * @brief Generic Event Handler. + */ class Event_Handler : public ACE_Event_Handler -// = TITLE -// Generic Event Handler. -// { public: virtual int handle_close (ACE_HANDLE handle, ACE_Reactor_Mask mask) diff --git a/ACE/examples/Reactor/WFMO_Reactor/Registration.cpp b/ACE/examples/Reactor/WFMO_Reactor/Registration.cpp index e36da0713ca..6bdcb740d1f 100644 --- a/ACE/examples/Reactor/WFMO_Reactor/Registration.cpp +++ b/ACE/examples/Reactor/WFMO_Reactor/Registration.cpp @@ -1,37 +1,33 @@ -// $Id$ -// -// ============================================================================ -// -// = LIBRARY -// examples -// -// = FILENAME -// Registration.cpp -// -// = DESCRIPTION -// -// This test application tests a wide range of registration, -// suspension, resumption, and removal of events from Reactor. -// -// The application initially registers two events with Reactor. A -// auxiliary thread is created to do the signaling on the -// events. When the first event is signaled, the event is suspended -// from Reactor. The event is then signaled again, but is "lost" -// since the handler has been suspended. When the second event is -// signal, the first event is resumed and the second is -// suspended. When the first event is signaled again, both events -// are removed from Reactor. -// -// This test shows off the following features of Reactor: -// - Registration -// - Suspension -// - Resumption -// - Removal (while active and while suspended) -// -// = AUTHOR -// Irfan Pyarali -// -// ============================================================================ +//============================================================================= +/** + * @file Registration.cpp + * + * $Id$ + * + * + * This test application tests a wide range of registration, + * suspension, resumption, and removal of events from Reactor. + * + * The application initially registers two events with Reactor. A + * auxiliary thread is created to do the signaling on the + * events. When the first event is signaled, the event is suspended + * from Reactor. The event is then signaled again, but is "lost" + * since the handler has been suspended. When the second event is + * signal, the first event is resumed and the second is + * suspended. When the first event is signaled again, both events + * are removed from Reactor. + * + * This test shows off the following features of Reactor: + * - Registration + * - Suspension + * - Resumption + * - Removal (while active and while suspended) + * + * + * @author Irfan Pyarali + */ +//============================================================================= + #include "ace/OS_main.h" @@ -52,8 +48,8 @@ ACE_Reactor reactor; class Simple_Handler : public ACE_Event_Handler { public: + /// Default constructor Simple_Handler (void); - // Default constructor virtual int handle_signal (int signum, siginfo_t * = 0, ucontext_t * = 0); virtual int handle_close (ACE_HANDLE handle, diff --git a/ACE/examples/Reactor/WFMO_Reactor/Registry_Changes.cpp b/ACE/examples/Reactor/WFMO_Reactor/Registry_Changes.cpp index d5f4c9357d7..ad762a46a3e 100644 --- a/ACE/examples/Reactor/WFMO_Reactor/Registry_Changes.cpp +++ b/ACE/examples/Reactor/WFMO_Reactor/Registry_Changes.cpp @@ -1,22 +1,18 @@ -// $Id$ -// -// ============================================================================ -// -// = LIBRARY -// examples -// -// = FILENAME -// Registry_Changes.cpp -// -// = DESCRIPTION -// -// This application tests the working of Reactor when users are -// interested in monitoring changes in the registry. -// -// = AUTHOR -// Irfan Pyarali -// -// ============================================================================ +//============================================================================= +/** + * @file Registry_Changes.cpp + * + * $Id$ + * + * + * This application tests the working of Reactor when users are + * interested in monitoring changes in the registry. + * + * + * @author Irfan Pyarali + */ +//============================================================================= + #include "ace/OS_main.h" diff --git a/ACE/examples/Reactor/WFMO_Reactor/Removals.cpp b/ACE/examples/Reactor/WFMO_Reactor/Removals.cpp index 8f2e38c6cab..59b857f3615 100644 --- a/ACE/examples/Reactor/WFMO_Reactor/Removals.cpp +++ b/ACE/examples/Reactor/WFMO_Reactor/Removals.cpp @@ -1,24 +1,19 @@ -// $Id$ -// -// ============================================================================ -// -// = LIBRARY -// examples -// -// = FILENAME -// Removals.cpp -// -// = DESCRIPTION -// -// Tests the Reactor's ability to handle simultaneous events. If -// you pass anything on the command-line, then each handler -// requests to be removed from the Reactor after each event. -// -// = AUTHOR -// Tim Harrison -// Irfan Pyarali -// -// ============================================================================ +//============================================================================= +/** + * @file Removals.cpp + * + * $Id$ + * + * + * Tests the Reactor's ability to handle simultaneous events. If + * you pass anything on the command-line, then each handler + * requests to be removed from the Reactor after each event. + * + * + * @author Tim Harrison Irfan Pyarali + */ +//============================================================================= + #include "ace/OS_main.h" @@ -30,14 +25,15 @@ +/** + * @class Event_Handler + * + * @brief Generic Event Handler. + * + * Creates event. Registers with Reactor. Signals event. If + * created with -close_down- it returns -1 from handle signal. + */ class Event_Handler : public ACE_Event_Handler -// = TITLE -// Generic Event Handler. -// -// = DESCRIPTION -// -// Creates event. Registers with Reactor. Signals event. If -// created with -close_down- it returns -1 from handle signal. { public: Event_Handler (int event_number, @@ -72,14 +68,14 @@ public: } private: + /// Our event number. int event_number_; - // Our event number. + /// Shall we close down or not. int close_down_; - // Shall we close down or not. + /// Signaled to shut down the handler. ACE_Event event_; - // Signaled to shut down the handler. }; int diff --git a/ACE/examples/Reactor/WFMO_Reactor/Suspended_Removals.cpp b/ACE/examples/Reactor/WFMO_Reactor/Suspended_Removals.cpp index 3988369f5fc..25dd7187dd8 100644 --- a/ACE/examples/Reactor/WFMO_Reactor/Suspended_Removals.cpp +++ b/ACE/examples/Reactor/WFMO_Reactor/Suspended_Removals.cpp @@ -1,22 +1,18 @@ -// $Id$ -// -// ============================================================================ -// -// = LIBRARY -// examples -// -// = FILENAME -// Suspended_Removals.cpp -// -// = DESCRIPTION -// -// Tests the Reactor's ability to handle removal of suspended -// handles. -// -// = AUTHOR -// Irfan Pyarali -// -// ============================================================================ +//============================================================================= +/** + * @file Suspended_Removals.cpp + * + * $Id$ + * + * + * Tests the Reactor's ability to handle removal of suspended + * handles. + * + * + * @author Irfan Pyarali + */ +//============================================================================= + #include "ace/OS_main.h" diff --git a/ACE/examples/Reactor/WFMO_Reactor/Talker.cpp b/ACE/examples/Reactor/WFMO_Reactor/Talker.cpp index d62dda16f51..09d863b7fc8 100644 --- a/ACE/examples/Reactor/WFMO_Reactor/Talker.cpp +++ b/ACE/examples/Reactor/WFMO_Reactor/Talker.cpp @@ -1,136 +1,132 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// examples -// -// = FILENAME -// Talker.cpp -// -// = DESCRIPTION -// -// This test application tests a wide range of events that can be -// demultiplexed using various ACE utilities. Events used include -// ^C events, reading from STDIN, vanilla Win32 events, thread -// exits, Reactor notifications, proactive reads, and proactive -// writes. -// -// The proactive I/O events are demultiplexed by the ACE_Proactor. -// The thread exits, notications, and vanilla Win32 events are -// demultiplexed by the ACE_Reactor. To enable a single thread -// to run all these events, the Proactor is integrated with the -// Reactor. -// -// The test application prototypes a simple talk program. Two -// instances of the application connect. Input from either console -// is displayed on the others console also. Because of the evils -// of Win32 STDIN, a separate thread is used to read from STDIN. -// To test the Proactor and Reactor, I/O between the remote -// processes is performed proactively and interactions between the -// STDIN thread and the main thread are performed reactively. -// -// The following description of the test application is in two -// parts. The participants section explains the main components -// involved in the application. The collaboration section -// describes how the partipants interact in response to the -// multiple event types which occur. -// -// The Reactor test application has the following participants: -// -// . Reactor -- The Reactor demultiplexes Win32 "waitable" -// events using WaitForMultipleObjects. -// -// . Proactor -- The proactor initiates and demultiplexes -// overlapped I/O operations. The Proactor registers with the -// Reactor so that a single-thread can demultiplex all -// application events. -// -// . STDIN_Handler -- STDIN_Handler is an Active Object which reads -// from STDIN and forwards the input to the Peer_Handler. This -// runs in a separate thread to make the test more interesting. -// However, STDIN is "waitable", so in general it can be waited on -// by the ACE Reactor, thanks MicroSlush! -// -// . Peer_Handler -- The Peer_Handler connects to another instance -// of test_reactor. It Proactively reads and writes data to the -// peer. When the STDIN_Handler gives it messages, it fowards them -// to the remote peer. When it receives messages from the remote -// peer, it prints the output to the console. -// -// The collaborations of the participants are as follows: -// -// . Initialization -// -// Peer_Handler -- connects to the remote peer. It then begins -// proactively reading from the remote connection. Note that it -// will be notified by the Proactor when a read completes. It -// also registers a notification strategy with message queue so -// that it is notified when the STDIN_Handler posts a message -// onto the queue. -// -// STDIN_Handler -- STDIN_Handler registers a signal handler for -// SIGINT. This just captures the exception so that the kernel -// doesn't kill our process; We want to exit gracefully. It also -// creates an Exit_Hook object which registers the -// STDIN_Handler's thread handle with the Reactor. The -// Exit_Hook will get called back when the STDIN_Handler thread -// exits. After registering these, it blocks reading from STDIN. -// -// Proactor -- is registered with the Reactor. -// -// The main thread of control waits in the Reactor. -// -// . STDIN events -- When the STDIN_Handler thread reads from -// STDIN, it puts the message on Peer_Handler's message queue. It -// then returns to reading from STDIN. -// -// . Message enqueue -- The Reactor thread wakes up and calls -// Peer_Handler::handle_output. The Peer_Handler then tries to -// dequeue a message from its message queue. If it can, the -// message is Proactively sent to the remote peer. Note that the -// Peer_Handler will be notified with this operation is complete. -// The Peer_Handler then falls back into the Reactor event loop. -// -// . Send complete event -- When a proactive send is complete, the -// Proactor is notified by the Reactor. The Proactor, in turn, -// notifies the Peer_Handler. The Peer_Handler then checks for -// more messages from the message queue. If there are any, it -// tries to send them. If there are not, it returns to the -// Reactor event loop. -// -// . Read complete event -- When a proactive read is complete (the -// Peer_Handler initiated a proactive read when it connected to the -// remote peer), the Proactor is notified by the Reactor. The -// Proactor, in turn notifies the Peer_Handler. If the read was -// successful the Peer_Handler just displays the received msg to -// the console and reinvokes a proactive read from the network -// connection. If the read failed (i.e. the remote peer exited), -// the Peer_Handler sets a flag to end the event loop and returns. -// This will cause the application to exit. -// -// . ^C events -- When the user types ^C at the console, the -// STDIN_Handler's signal handler will be called. It does nothing, -// but as a result of the signal, the STDIN_Handler thread will -// exit. -// -// . STDIN_Handler thread exits -- The Exit_Hook will get called -// back from the Reactor. Exit_Hook::handle_signal sets a flag -// to end the event loop and returns. This will cause the -// application to exit. -// -// -// To run example, start an instance of the test with an optional -// local port argument (as the acceptor). Start the other instance -// with -h <hostname> and -p <server port>. Type in either the -// client or server windows and your message should show up in the -// other window. Control C to exit. -// -// = AUTHOR -// Tim Harrison -// Irfan Pyarali -// -// ============================================================================ + +//============================================================================= +/** + * @file Talker.cpp + * + * $Id$ + * + * + * This test application tests a wide range of events that can be + * demultiplexed using various ACE utilities. Events used include + * ^C events, reading from STDIN, vanilla Win32 events, thread + * exits, Reactor notifications, proactive reads, and proactive + * writes. + * + * The proactive I/O events are demultiplexed by the ACE_Proactor. + * The thread exits, notications, and vanilla Win32 events are + * demultiplexed by the ACE_Reactor. To enable a single thread + * to run all these events, the Proactor is integrated with the + * Reactor. + * + * The test application prototypes a simple talk program. Two + * instances of the application connect. Input from either console + * is displayed on the others console also. Because of the evils + * of Win32 STDIN, a separate thread is used to read from STDIN. + * To test the Proactor and Reactor, I/O between the remote + * processes is performed proactively and interactions between the + * STDIN thread and the main thread are performed reactively. + * + * The following description of the test application is in two + * parts. The participants section explains the main components + * involved in the application. The collaboration section + * describes how the partipants interact in response to the + * multiple event types which occur. + * + * The Reactor test application has the following participants: + * + * . Reactor -- The Reactor demultiplexes Win32 "waitable" + * events using WaitForMultipleObjects. + * + * . Proactor -- The proactor initiates and demultiplexes + * overlapped I/O operations. The Proactor registers with the + * Reactor so that a single-thread can demultiplex all + * application events. + * + * . STDIN_Handler -- STDIN_Handler is an Active Object which reads + * from STDIN and forwards the input to the Peer_Handler. This + * runs in a separate thread to make the test more interesting. + * However, STDIN is "waitable", so in general it can be waited on + * by the ACE Reactor, thanks MicroSlush! + * + * . Peer_Handler -- The Peer_Handler connects to another instance + * of test_reactor. It Proactively reads and writes data to the + * peer. When the STDIN_Handler gives it messages, it fowards them + * to the remote peer. When it receives messages from the remote + * peer, it prints the output to the console. + * + * The collaborations of the participants are as follows: + * + * . Initialization + * + * Peer_Handler -- connects to the remote peer. It then begins + * proactively reading from the remote connection. Note that it + * will be notified by the Proactor when a read completes. It + * also registers a notification strategy with message queue so + * that it is notified when the STDIN_Handler posts a message + * onto the queue. + * + * STDIN_Handler -- STDIN_Handler registers a signal handler for + * SIGINT. This just captures the exception so that the kernel + * doesn't kill our process; We want to exit gracefully. It also + * creates an Exit_Hook object which registers the + * STDIN_Handler's thread handle with the Reactor. The + * Exit_Hook will get called back when the STDIN_Handler thread + * exits. After registering these, it blocks reading from STDIN. + * + * Proactor -- is registered with the Reactor. + * + * The main thread of control waits in the Reactor. + * + * . STDIN events -- When the STDIN_Handler thread reads from + * STDIN, it puts the message on Peer_Handler's message queue. It + * then returns to reading from STDIN. + * + * . Message enqueue -- The Reactor thread wakes up and calls + * Peer_Handler::handle_output. The Peer_Handler then tries to + * dequeue a message from its message queue. If it can, the + * message is Proactively sent to the remote peer. Note that the + * Peer_Handler will be notified with this operation is complete. + * The Peer_Handler then falls back into the Reactor event loop. + * + * . Send complete event -- When a proactive send is complete, the + * Proactor is notified by the Reactor. The Proactor, in turn, + * notifies the Peer_Handler. The Peer_Handler then checks for + * more messages from the message queue. If there are any, it + * tries to send them. If there are not, it returns to the + * Reactor event loop. + * + * . Read complete event -- When a proactive read is complete (the + * Peer_Handler initiated a proactive read when it connected to the + * remote peer), the Proactor is notified by the Reactor. The + * Proactor, in turn notifies the Peer_Handler. If the read was + * successful the Peer_Handler just displays the received msg to + * the console and reinvokes a proactive read from the network + * connection. If the read failed (i.e. the remote peer exited), + * the Peer_Handler sets a flag to end the event loop and returns. + * This will cause the application to exit. + * + * . ^C events -- When the user types ^C at the console, the + * STDIN_Handler's signal handler will be called. It does nothing, + * but as a result of the signal, the STDIN_Handler thread will + * exit. + * + * . STDIN_Handler thread exits -- The Exit_Hook will get called + * back from the Reactor. Exit_Hook::handle_signal sets a flag + * to end the event loop and returns. This will cause the + * application to exit. + * + * + * To run example, start an instance of the test with an optional + * local port argument (as the acceptor). Start the other instance + * with -h <hostname> and -p <server port>. Type in either the + * client or server windows and your message should show up in the + * other window. Control C to exit. + * + * + * @author Tim Harrison Irfan Pyarali + */ +//============================================================================= + #include "ace/OS_main.h" @@ -151,10 +147,13 @@ typedef ACE_Task<ACE_MT_SYNCH> MT_TASK; +/** + * @class Peer_Handler + * + * @brief Connect to a server. Receive messages from STDIN_Handler + * and forward them to the server using proactive I/O. + */ class Peer_Handler : public MT_TASK, public ACE_Handler -// = TITLE -// Connect to a server. Receive messages from STDIN_Handler -// and forward them to the server using proactive I/O. { public: // = Initialization methods. @@ -162,104 +161,117 @@ public: ~Peer_Handler (void); //FUZZ: disable check_for_lack_ACE_OS + /** + * This method creates the network connection to the remote peer. + * It does blocking connects and accepts depending on whether a + * hostname was specified from the command line. + *FUZZ: enable check_for_lack_ACE_OS + */ int open (void * =0); - // This method creates the network connection to the remote peer. - // It does blocking connects and accepts depending on whether a - // hostname was specified from the command line. - //FUZZ: enable check_for_lack_ACE_OS + /** + * This method will be called when an asynchronous read completes on a stream. + * The remote peer has sent us something. If it succeeded, print + * out the message and reinitiate a read. Otherwise, fail. In both + * cases, delete the message sent. + */ virtual void handle_read_stream (const ACE_Asynch_Read_Stream::Result &result); - // This method will be called when an asynchronous read completes on a stream. - // The remote peer has sent us something. If it succeeded, print - // out the message and reinitiate a read. Otherwise, fail. In both - // cases, delete the message sent. + /** + * This method will be called when an asynchronous write completes on a strea_m. + * One of our asynchronous writes to the remote peer has completed. + * Make sure it succeeded and then delete the message. + */ virtual void handle_write_stream (const ACE_Asynch_Write_Stream::Result &result); - // This method will be called when an asynchronous write completes on a strea_m. - // One of our asynchronous writes to the remote peer has completed. - // Make sure it succeeded and then delete the message. + /** + * Get the I/O handle used by this <handler>. This method will be + * called by the ACE_Asynch_* classes when an ACE_INVALID_HANDLE is + * passed to <open>. + */ virtual ACE_HANDLE handle (void) const; - // Get the I/O handle used by this <handler>. This method will be - // called by the ACE_Asynch_* classes when an ACE_INVALID_HANDLE is - // passed to <open>. + /// Set the ACE_HANDLE value for this Handler. void handle (ACE_HANDLE); - // Set the ACE_HANDLE value for this Handler. + /// We've been removed from the Reactor. virtual int handle_close (ACE_HANDLE, ACE_Reactor_Mask); - // We've been removed from the Reactor. + /** + * Called when output events should start. Note that this is + * automatically invoked by the + * <ACE_Reactor_Notificiation_Strategy>. + */ virtual int handle_output (ACE_HANDLE fd); - // Called when output events should start. Note that this is - // automatically invoked by the - // <ACE_Reactor_Notificiation_Strategy>. private: + /// Socket that we have connected to the server. ACE_SOCK_Stream stream_; - // Socket that we have connected to the server. + /// The strategy object that the reactor uses to notify us when + /// something is added to the queue. ACE_Reactor_Notification_Strategy strategy_; - // The strategy object that the reactor uses to notify us when - // something is added to the queue. // = Remote peer info. + /// Name of remote host. ACE_TCHAR *host_; - // Name of remote host. + /// Port number for remote host. u_short port_; - // Port number for remote host. + /// Read stream ACE_Asynch_Read_Stream rd_stream_; - // Read stream + /// Write stream ACE_Asynch_Write_Stream wr_stream_; - // Write stream + /// Message Block for reading from the network ACE_Message_Block mb_; - // Message Block for reading from the network }; +/** + * @class STDIN_Handler + * + * @brief Active Object. Reads from STDIN and passes message blocks to + * the peer handler. + */ class STDIN_Handler : public ACE_Task<ACE_NULL_SYNCH> -// = TITLE -// Active Object. Reads from STDIN and passes message blocks to -// the peer handler. { public: + /// Initialization. STDIN_Handler (MT_TASK &ph); - // Initialization. //FUZZ: disable check_for_lack_ACE_OS + /// Activate object. virtual int open (void * = 0); - // Activate object. + /// Shut down. + ///FUZZ: enable check_for_lack_ACE_OS virtual int close (u_long = 0); - // Shut down. - //FUZZ: enable check_for_lack_ACE_OS + /// Thread runs here as an active object. int svc (void); - // Thread runs here as an active object. int handle_close (ACE_HANDLE, ACE_Reactor_Mask); private: + /// Handle a ^C. (Do nothing, this just illustrates how we can catch + /// signals along with the other things). static void handler (int signum); - // Handle a ^C. (Do nothing, this just illustrates how we can catch - // signals along with the other things). + /// Helper function to register with the Reactor for thread exit. void register_thread_exit_hook (void); - // Helper function to register with the Reactor for thread exit. + /// The STDIN thread has exited. This means the user hit ^C. We can + /// end the event loop. virtual int handle_signal (int index, siginfo_t *, ucontext_t *); - // The STDIN thread has exited. This means the user hit ^C. We can - // end the event loop. + /// Send all input to ph_. MT_TASK &ph_; - // Send all input to ph_. + /// Handle of our thread. ACE_HANDLE thr_handle_; - // Handle of our thread. }; Peer_Handler::Peer_Handler (int argc, ACE_TCHAR *argv[]) diff --git a/ACE/examples/Reactor/WFMO_Reactor/Timeouts.cpp b/ACE/examples/Reactor/WFMO_Reactor/Timeouts.cpp index 5c6e7eaee60..7855e43b692 100644 --- a/ACE/examples/Reactor/WFMO_Reactor/Timeouts.cpp +++ b/ACE/examples/Reactor/WFMO_Reactor/Timeouts.cpp @@ -1,28 +1,23 @@ -// $Id$ -// -// ============================================================================ -// -// = LIBRARY -// examples -// -// = FILENAME -// Timeouts.cpp -// -// = DESCRIPTION -// -// This example application shows how to write Reactor event -// loops that handle events for some fixed amount of time. -// -// Run this example (without arguments) to see the timers -// expire. The order should be: -// -// foo, bar, foo, bar, foo, foo, bar, foo, bar, foo -// -// = AUTHOR -// Tim Harrison -// Irfan Pyarali -// -// ============================================================================ +//============================================================================= +/** + * @file Timeouts.cpp + * + * $Id$ + * + * + * This example application shows how to write Reactor event + * loops that handle events for some fixed amount of time. + * + * Run this example (without arguments) to see the timers + * expire. The order should be: + * + * foo, bar, foo, bar, foo, foo, bar, foo, bar, foo + * + * + * @author Tim Harrison Irfan Pyarali + */ +//============================================================================= + #include "ace/Reactor.h" #include "ace/Service_Config.h" @@ -30,17 +25,20 @@ +/** + * @class Timeout_Handler + * + * @brief Generic timeout handler. + */ class Timeout_Handler : public ACE_Event_Handler -// = TITLE -// Generic timeout handler. { public: Timeout_Handler (void) : count_ (0) {} + /// Print out when timeouts occur. virtual int handle_timeout (const ACE_Time_Value &tv, const void *arg) - // Print out when timeouts occur. { ACE_UNUSED_ARG(tv); ACE_DEBUG ((LM_DEBUG, diff --git a/ACE/examples/Reactor/WFMO_Reactor/Window_Messages.cpp b/ACE/examples/Reactor/WFMO_Reactor/Window_Messages.cpp index 07982353a1d..d1e46c04307 100644 --- a/ACE/examples/Reactor/WFMO_Reactor/Window_Messages.cpp +++ b/ACE/examples/Reactor/WFMO_Reactor/Window_Messages.cpp @@ -1,23 +1,19 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// examples -// -// = FILENAME -// Window_Messages.cpp -// -// = DESCRIPTION -// -// Tests the Msg_WFMO_Reactor's ability to handle regular events -// and window messages. -// -// = AUTHOR -// -// Irfan Pyarali <irfan@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file Window_Messages.cpp + * + * $Id$ + * + * + * Tests the Msg_WFMO_Reactor's ability to handle regular events + * and window messages. + * + * + * @author Irfan Pyarali <irfan@cs.wustl.edu> + */ +//============================================================================= + #include "ace/OS_main.h" diff --git a/ACE/examples/Service_Configurator/Misc/main.cpp b/ACE/examples/Service_Configurator/Misc/main.cpp index f93c7c1b4c2..08a19b2b8db 100644 --- a/ACE/examples/Service_Configurator/Misc/main.cpp +++ b/ACE/examples/Service_Configurator/Misc/main.cpp @@ -1,22 +1,19 @@ -// $Id$ -// ============================================================================ -// -// = LIBRARY -// examples/Service_Configurator/Misc -// -// = FILENAME -// main.cpp -// -// = DESCRIPTION -// This directory contains an example that illustrates how the ACE -// Service Configurator can configure static and dynamic services, -// both from the command-line and from a svc.config file. -// -// = AUTHOR -// Doug Schmidt <schmidt@cs.wustl.edu> -// -// ============================================================================ +//============================================================================= +/** + * @file main.cpp + * + * $Id$ + * + * This directory contains an example that illustrates how the ACE + * Service Configurator can configure static and dynamic services, + * both from the command-line and from a svc.config file. + * + * + * @author Doug Schmidt <schmidt@cs.wustl.edu> + */ +//============================================================================= + #include "ace/OS_main.h" #include "ace/Service_Config.h" diff --git a/ACE/examples/Threads/TSS_Data.h b/ACE/examples/Threads/TSS_Data.h index 3c9dfcfe28c..9a837793d65 100644 --- a/ACE/examples/Threads/TSS_Data.h +++ b/ACE/examples/Threads/TSS_Data.h @@ -1,17 +1,14 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// examples -// -// = FILENAME -// TSS_Data.cpp -// -// = AUTHOR -// Prashant Jain and Doug Schmidt -// -// ============================================================================ + +//============================================================================= +/** + * @file TSS_Data.h + * + * $Id$ + * + * @author Prashant Jain and Doug Schmidt + */ +//============================================================================= + #include "ace/Singleton.h" @@ -21,9 +18,12 @@ #include "ace/Synch_Traits.h" +/** + * @class TSS_Data + * + * @brief Data that is stored in thread-specific storage. + */ class TSS_Data - // = TITLE - // Data that is stored in thread-specific storage. { public: void *data (void) { return this->data_; } diff --git a/ACE/examples/Threads/TSS_Obj.h b/ACE/examples/Threads/TSS_Obj.h index 7dc4e469851..7e430ca09af 100644 --- a/ACE/examples/Threads/TSS_Obj.h +++ b/ACE/examples/Threads/TSS_Obj.h @@ -1,21 +1,18 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// tests -// -// = FILENAME -// TSS_Test.cpp -// -// = DESCRIPTION -// This program tests various features of ACE_Thread and the -// thread-specific storage variant of <ACE_SingletonEx>. -// -// = AUTHOR -// Prashant Jain and Doug Schmidt -// -// ============================================================================ + +//============================================================================= +/** + * @file TSS_Obj.h + * + * $Id$ + * + * This program tests various features of ACE_Thread and the + * thread-specific storage variant of <ACE_SingletonEx>. + * + * + * @author Prashant Jain and Doug Schmidt + */ +//============================================================================= + #include "ace/Atomic_Op.h" #include "ace/Synch_Traits.h" @@ -24,9 +21,12 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +/** + * @class TSS_Obj + * + * @brief This object is stored in thread-specific storage. + */ class TSS_Obj - // = TITLE - // This object is stored in thread-specific storage. { public: TSS_Obj (void); diff --git a/ACE/examples/Threads/TSS_Task.h b/ACE/examples/Threads/TSS_Task.h index 0612f0c46a9..289ef6db82f 100644 --- a/ACE/examples/Threads/TSS_Task.h +++ b/ACE/examples/Threads/TSS_Task.h @@ -1,19 +1,16 @@ /* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// tests -// -// = FILENAME -// TSS_Task.h -// -// = AUTHOR -// Prashant Jain and Doug Schmidt -// -// ============================================================================ + +//============================================================================= +/** + * @file TSS_Task.h + * + * $Id$ + * + * @author Prashant Jain and Doug Schmidt + */ +//============================================================================= + #include "ace/config-all.h" diff --git a/ACE/examples/Threads/future1.cpp b/ACE/examples/Threads/future1.cpp index 1891cd5fa70..008c57a5b8c 100644 --- a/ACE/examples/Threads/future1.cpp +++ b/ACE/examples/Threads/future1.cpp @@ -1,21 +1,17 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// tests -// -// = FILENAME -// Test_Future.cpp -// -// = DESCRIPTION -// This example tests the ACE Future. -// -// = AUTHOR -// Andres Kruse <Andres.Kruse@cern.ch> and Douglas C. Schmidt -// <schmidt@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file future1.cpp + * + * $Id$ + * + * This example tests the ACE Future. + * + * + * @author Andres Kruse <Andres.Kruse@cern.ch> and Douglas C. Schmidt <schmidt@cs.wustl.edu> + */ +//============================================================================= + #include "ace/OS_NS_string.h" #include "ace/OS_NS_unistd.h" @@ -51,9 +47,12 @@ static ATOMIC_INT capsule_no (0); static ATOMIC_INT methodobject_count (0); static ATOMIC_INT methodobject_no (0); +/** + * @class Scheduler + * + * @brief Active Object Scheduler. + */ class Scheduler : public ACE_Task_Base - // = TITLE - // Active Object Scheduler. { friend class Method_RequestWork; public: @@ -61,9 +60,9 @@ public: virtual ~Scheduler (void); //FUZZ: disable check_for_lack_ACE_OS + ///FUZZ: enable check_for_lack_ACE_OS virtual int open (void *args = 0); virtual int close (u_long flags = 0); - //FUZZ: enable check_for_lack_ACE_OS virtual int svc (void); @@ -80,9 +79,12 @@ private: Scheduler *scheduler_; }; +/** + * @class Method_Request_work + * + * @brief Reification of the <work> method. + */ class Method_Request_work : public ACE_Method_Request - // = TITLE - // Reification of the <work> method. { public: Method_Request_work (Scheduler *, u_long, int, ACE_Future<u_long> &); @@ -121,9 +123,12 @@ Method_Request_work::call (void) return this->future_result_.set (this->scheduler_->work_i (this->param_, this->count_)); } +/** + * @class Method_Request_name + * + * @brief Reification of the <name> method. + */ class Method_Request_name : public ACE_Method_Request - // = TITLE - // Reification of the <name> method. { public: Method_Request_name (Scheduler *, ACE_Future<const char*> &); @@ -156,9 +161,12 @@ Method_Request_name::call (void) return future_result_.set (scheduler_->name_i ()); } +/** + * @class Method_Request_end + * + * @brief Reification of the <end> method. + */ class Method_Request_end : public ACE_Method_Request - // = TITLE - // Reification of the <end> method. { public: Method_Request_end (Scheduler *new_scheduler): scheduler_ (new_scheduler) {} @@ -166,8 +174,8 @@ public: virtual int call (void) { return -1; } private: + /// Keep track of our scheduler. Scheduler *scheduler_; - // Keep track of our scheduler. }; // Constructor. diff --git a/ACE/examples/Threads/future2.cpp b/ACE/examples/Threads/future2.cpp index 847dd820e1a..df1eb8cc297 100644 --- a/ACE/examples/Threads/future2.cpp +++ b/ACE/examples/Threads/future2.cpp @@ -1,29 +1,17 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// tests -// -// = FILENAME -// Test_Future.cpp -// -// = DESCRIPTION -// This example tests the ACE Future. -// -// = AUTHOR -// Andres Kruse <Andres.Kruse@cern.ch> and Douglas C. Schmidt -// <schmidt@cs.wustl.edu> -// -// Modification History -// Aug. 96; A.Kruse; dev. -// Aug. 96; D.Schmidt; complete workover -// 08/27/96; A.Kruse; - the friends of Scheduler are "Method_Request_name" -// and "Method_Request_work". -// - make the methods "work_i" and "name_i" private -// 09/2/96; D.Schmidt; Integrate with new ACE_Future API and rearrange -// the tests so they are more modular. -// ============================================================================ + +//============================================================================= +/** + * @file future2.cpp + * + * $Id$ + * + * This example tests the ACE Future. + * + * + * @author Andres Kruse <Andres.Kruse@cern.ch> and Douglas C. Schmidt <schmidt@cs.wustl.edu> and "Method_Request_work". - make the methods "work_i" and "name_i" private the tests so they are more modular. + */ +//============================================================================= + #include "ace/OS_NS_string.h" #include "ace/OS_NS_sys_time.h" @@ -49,9 +37,12 @@ static ATOMIC_INT scheduler_open_count (0); class Method_Request_work; class Method_Request_name; +/** + * @class Scheduler + * + * @brief Active Object Scheduler. + */ class Scheduler : public ACE_Task_Base - // = TITLE - // Active Object Scheduler. { // Every method object has to be able to access the private methods. @@ -64,9 +55,9 @@ public: virtual ~Scheduler (void); //FUZZ: disable check_for_lack_ACE_OS + /// The method that is used to start the active object. + ///FUZZ: enable check_for_lack_ACE_OS virtual int open (void *args = 0); - // The method that is used to start the active object. - //FUZZ: enable check_for_lack_ACE_OS // = Here are the methods exported by the class. They return an // <ACE_Future>. @@ -76,12 +67,12 @@ public: private: //FUZZ: disable check_for_lack_ACE_OS + /// Should not be accessible from outside... (use end () instead). + ///FUZZ: enable check_for_lack_ACE_OS virtual int close (u_long flags = 0); - // Should not be accessible from outside... (use end () instead). - //FUZZ: enable check_for_lack_ACE_OS + /// Here the actual servicing of all requests is happening.. virtual int svc (void); - // Here the actual servicing of all requests is happening.. // = Implementation methods. u_long work_i (u_long, int); @@ -92,9 +83,12 @@ private: Scheduler *scheduler_; }; +/** + * @class Method_Request_work + * + * @brief Reification of the <work> method. + */ class Method_Request_work : public ACE_Method_Request - // = TITLE - // Reification of the <work> method. { public: Method_Request_work (Scheduler *, u_long, int, ACE_Future<u_long> &); @@ -129,9 +123,12 @@ Method_Request_work::call (void) return this->future_result_.set (this->scheduler_->work_i (this->param_, this->count_)); } +/** + * @class Method_Request_name + * + * @brief Reification of the <name> method. + */ class Method_Request_name : public ACE_Method_Request - // = TITLE - // Reification of the <name> method. { public: Method_Request_name (Scheduler *, ACE_Future<char*> &); @@ -165,9 +162,12 @@ Method_Request_name::call (void) return future_result_.set (scheduler_->name_i ()); } +/** + * @class Method_Request_end + * + * @brief Reification of the <end> method. + */ class Method_Request_end : public ACE_Method_Request - // = TITLE - // Reification of the <end> method. { public: Method_Request_end (Scheduler *new_Scheduler): scheduler_ (new_Scheduler) {} @@ -175,8 +175,8 @@ public: virtual int call (void) { return -1; } private: + /// Keep track of our scheduler. Scheduler *scheduler_; - // Keep track of our scheduler. }; // constructor diff --git a/ACE/examples/Threads/process_manager.cpp b/ACE/examples/Threads/process_manager.cpp index 72e355bbb26..6a690650533 100644 --- a/ACE/examples/Threads/process_manager.cpp +++ b/ACE/examples/Threads/process_manager.cpp @@ -1,30 +1,26 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// examples/Threads/ -// -// = FILENAME -// process_manager.cpp -// -// = DESCRIPTION -// Test out the mechanisms provided by the ACE_Process_Manager. -// Using the global ACE_Process_Manager::instance(), we first spawn -// some processes (re-invoke this program, and plain-old-fork on -// systems that support it), and try the wait() functions. -// -// Then, we register the Process_Manager with -// ACE_Reactor::instance() and spawn more processes, counting on the -// autoreap to clean up. -// -// Specific-pid and generic exit-handler functions are also tested. -// -// = AUTHOR -// Douglas C. Schmidt <schmidt@cs.wustl.edu> and -// Dave Madden <dhm@mersenne.com> -// -// ============================================================================ + +//============================================================================= +/** + * @file process_manager.cpp + * + * $Id$ + * + * Test out the mechanisms provided by the ACE_Process_Manager. + * Using the global ACE_Process_Manager::instance(), we first spawn + * some processes (re-invoke this program, and plain-old-fork on + * systems that support it), and try the wait() functions. + * + * Then, we register the Process_Manager with + * ACE_Reactor::instance() and spawn more processes, counting on the + * autoreap to clean up. + * + * Specific-pid and generic exit-handler functions are also tested. + * + * + * @author Douglas C. Schmidt <schmidt@cs.wustl.edu> and Dave Madden <dhm@mersenne.com> + */ +//============================================================================= + #include "ace/OS_NS_unistd.h" #include "ace/OS_main.h" @@ -38,13 +34,13 @@ class ExitHandler : public ACE_Event_Handler public: ExitHandler (const char *name); + /// Called when object is removed from the <ACE_Reactor>. virtual ~ExitHandler (void); virtual int handle_exit (ACE_Process *proc); virtual int handle_timeout (const ACE_Time_Value &tv, const void *arg = 0); virtual int handle_close (ACE_HANDLE handle, ACE_Reactor_Mask close_mask); - // Called when object is removed from the <ACE_Reactor>. private: const char *name_; }; diff --git a/ACE/examples/Threads/task_five.cpp b/ACE/examples/Threads/task_five.cpp index d3d5a8c9085..d31547c3fc0 100644 --- a/ACE/examples/Threads/task_five.cpp +++ b/ACE/examples/Threads/task_five.cpp @@ -1,21 +1,18 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// examples/Threads/ -// -// = FILENAME -// task_five.cpp -// -// = DESCRIPTION -// Stress testing thread creation and thread cancellation using -// ACE_Task. -// -// = AUTHOR -// Author: Detlef Becker <Detlef.Becker@med.siemens.de> -// -// ============================================================================ + +//============================================================================= +/** + * @file task_five.cpp + * + * $Id$ + * + * Stress testing thread creation and thread cancellation using + * ACE_Task. + * + * + * @author Author: Detlef Becker <Detlef.Becker@med.siemens.de> + */ +//============================================================================= + #include "ace/OS_main.h" @@ -47,8 +44,8 @@ public: int svc (void); int close (u_long); + ///FUZZ: enable check_for_lack_ACE_OS int shutdown (void); - //FUZZ: enable check_for_lack_ACE_OS int synch (void); }; diff --git a/ACE/examples/Threads/tss1.cpp b/ACE/examples/Threads/tss1.cpp index 799e7b240eb..5a29db15411 100644 --- a/ACE/examples/Threads/tss1.cpp +++ b/ACE/examples/Threads/tss1.cpp @@ -1,25 +1,22 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// tests -// -// = FILENAME -// TSS_Test.cpp -// -// = DESCRIPTION -// This program tests thread specific storage of data. The ACE_TSS -// wrapper transparently ensures that the objects of this class -// will be placed in thread-specific storage. All calls on -// ACE_TSS::operator->() are delegated to the appropriate method -// in the Errno class. Note that each thread of control has its -// own unique TSS object. -// -// = AUTHOR -// Detlef Becker <Detlef.Becker@med.siemens.de> -// -// ============================================================================ + +//============================================================================= +/** + * @file tss1.cpp + * + * $Id$ + * + * This program tests thread specific storage of data. The ACE_TSS + * wrapper transparently ensures that the objects of this class + * will be placed in thread-specific storage. All calls on + * ACE_TSS::operator->() are delegated to the appropriate method + * in the Errno class. Note that each thread of control has its + * own unique TSS object. + * + * + * @author Detlef Becker <Detlef.Becker@med.siemens.de> + */ +//============================================================================= + #include "ace/OS_main.h" #include "ace/Service_Config.h" @@ -56,11 +53,11 @@ public: virtual int svc (void); //FUZZ: disable check_for_lack_ACE_OS + /// Activate the thread. virtual int open (void *args = 0); - // Activate the thread. + ///FUZZ: enable check_for_lack_ACE_OS virtual int close (u_long args = 0); - //FUZZ: enable check_for_lack_ACE_OS }; template <ACE_SYNCH_DECL> int diff --git a/ACE/examples/Threads/tss2.cpp b/ACE/examples/Threads/tss2.cpp index e9110a643a1..eec0a2a32d5 100644 --- a/ACE/examples/Threads/tss2.cpp +++ b/ACE/examples/Threads/tss2.cpp @@ -1,21 +1,18 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// tests -// -// = FILENAME -// TSS_Test.cpp -// -// = DESCRIPTION -// This program tests various features of ACE_Thread and the -// thread-specific storage variant of <ACE_Singleton>. -// -// = AUTHOR -// Prashant Jain and Doug Schmidt -// -// ============================================================================ + +//============================================================================= +/** + * @file tss2.cpp + * + * $Id$ + * + * This program tests various features of ACE_Thread and the + * thread-specific storage variant of <ACE_Singleton>. + * + * + * @author Prashant Jain and Doug Schmidt + */ +//============================================================================= + #include "ace/OS_main.h" #include "ace/Thread.h" diff --git a/ACE/examples/Timer_Queue/Custom_Handler.cpp b/ACE/examples/Timer_Queue/Custom_Handler.cpp index 7fede7130c1..1136e897672 100644 --- a/ACE/examples/Timer_Queue/Custom_Handler.cpp +++ b/ACE/examples/Timer_Queue/Custom_Handler.cpp @@ -1,19 +1,17 @@ -// $Id$ -// ============================================================================ -// = LIBRARY -// examples -// -// = FILENAME -// Custom_Handler.cpp -// -// = DESCRIPTION -// This is a custom event handler to be used with the thread timer queue -// adapter, and its appropriate upcall. -// -// = AUTHOR -// Alon Diamant <diamant.alon@gmail.com -// -// ============================================================================ +//============================================================================= +/** + * @file Custom_Handler.cpp + * + * $Id$ + * + * This is a custom event handler to be used with the thread timer queue + * adapter, and its appropriate upcall. + * + * + * @author Alon Diamant <diamant.alon@gmail.com + */ +//============================================================================= + #include "Custom_Handler.h" #include "ace/OS_NS_stdio.h" diff --git a/ACE/examples/Timer_Queue/Custom_Handler.h b/ACE/examples/Timer_Queue/Custom_Handler.h index 3fc60db3115..d8d9a951fb8 100644 --- a/ACE/examples/Timer_Queue/Custom_Handler.h +++ b/ACE/examples/Timer_Queue/Custom_Handler.h @@ -1,36 +1,35 @@ /* -*- C++ -*- */ -// $Id$ -// ============================================================================ -// -// = LIBRARY -// examples -// -// = FILENAME -// Custom_Handler.h -// -// = DESCRIPTION -// This is a custom event handler to be used with the thread timer queue -// adapter, and its appropriate upcall. -// -// = AUTHORS -// Alon Diamant <diamant.alon@gmail.com> -// -// ============================================================================ +//============================================================================= +/** + * @file Custom_Handler.h + * + * $Id$ + * + * This is a custom event handler to be used with the thread timer queue + * adapter, and its appropriate upcall. + * + * + * @author Alon Diamant <diamant.alon@gmail.com> + */ +//============================================================================= + #ifndef _CUSTOM_HANDLER_H_ #define _CUSTOM_HANDLER_H_ #include "ace/Timer_Queue.h" +/** + * @class Custom_Handler + * + * @brief Custom event handler for the timer queue timeout events. + * + * The <on_timeout> hook method prints out the current time, + * prints the time when this timer expired and deletes "this". + */ class Custom_Handler { - // = TITLE - // Custom event handler for the timer queue timeout events. - // - // = DESCRIPTION - // The <on_timeout> hook method prints out the current time, - // prints the time when this timer expired and deletes "this". public: diff --git a/ACE/examples/Timer_Queue/Thread_Timer_Queue_Custom_Handler_Test.cpp b/ACE/examples/Timer_Queue/Thread_Timer_Queue_Custom_Handler_Test.cpp index aad16e40d3e..866164f74fe 100644 --- a/ACE/examples/Timer_Queue/Thread_Timer_Queue_Custom_Handler_Test.cpp +++ b/ACE/examples/Timer_Queue/Thread_Timer_Queue_Custom_Handler_Test.cpp @@ -1,23 +1,18 @@ -// $Id$ -// ============================================================================ -// -// = LIBRARY -// examples -// -// = FILENAME -// Thread_Timer_Queue_Custom_Handler_Test.cpp -// -// = DESCRIPTION -// This test exercises the <ACE_Thread_Timer_Queue_Adapter> -// using an <ACE_Timer_Heap>. It also demonstrates using a custom handler for -// timer events. -// -// = AUTHORS -// Carlos O'Ryan <coryan@cs.wustl.edu> and -// Douglas C. Schmidt <schmidt@cs.wustl.edu> and -// Alon Diamant <diamant.alon@gmail.com> -// -// ============================================================================ +//============================================================================= +/** + * @file Thread_Timer_Queue_Custom_Handler_Test.cpp + * + * $Id$ + * + * This test exercises the <ACE_Thread_Timer_Queue_Adapter> + * using an <ACE_Timer_Heap>. It also demonstrates using a custom handler for + * timer events. + * + * + * @author Carlos O'Ryan <coryan@cs.wustl.edu> and Douglas C. Schmidt <schmidt@cs.wustl.edu> and Alon Diamant <diamant.alon@gmail.com> + */ +//============================================================================= + #include "ace/OS_NS_stdio.h" #include "ace/OS_NS_sys_time.h" diff --git a/ACE/examples/Timer_Queue/Thread_Timer_Queue_Custom_Handler_Test.h b/ACE/examples/Timer_Queue/Thread_Timer_Queue_Custom_Handler_Test.h index 33e7c180a7b..ad333763100 100644 --- a/ACE/examples/Timer_Queue/Thread_Timer_Queue_Custom_Handler_Test.h +++ b/ACE/examples/Timer_Queue/Thread_Timer_Queue_Custom_Handler_Test.h @@ -1,25 +1,20 @@ /* -*- C++ -*- */ -// $Id$ -// ============================================================================ -// -// = LIBRARY -// examples -// -// = FILENAME -// Thread_Timer_Queue_Custom_Handler_Test.h -// -// = DESCRIPTION -// This code exercises the <ACE_Thread_Timer_Queue_Adapter> using -// an <ACE_Timer_Heap_T>. It also demonstrates using a custom handler for -// timer events. -// -// = AUTHORS -// Carlos O'Ryan <coryan@cs.wustl.edu> and -// Sergio Flores-Gaitan <sergio@cs.wustl.edu> and -// Alon Diamant <diamant.alon@gmail.com> -// -// ============================================================================ +//============================================================================= +/** + * @file Thread_Timer_Queue_Custom_Handler_Test.h + * + * $Id$ + * + * This code exercises the <ACE_Thread_Timer_Queue_Adapter> using + * an <ACE_Timer_Heap_T>. It also demonstrates using a custom handler for + * timer events. + * + * + * @author Carlos O'Ryan <coryan@cs.wustl.edu> and Sergio Flores-Gaitan <sergio@cs.wustl.edu> and Alon Diamant <diamant.alon@gmail.com> + */ +//============================================================================= + #ifndef _THREAD_TIMER_QUEUE_TEST_H_ #define _THREAD_TIMER_QUEUE_TEST_H_ @@ -54,63 +49,67 @@ typedef ACE_Thread_Timer_Queue_Adapter<Timer_Heap, Custom_Handler*> // Forward declaration. class Thread_Timer_Queue_Custom_Handler_Test; +/** + * @class Custom_Handler_Input_Task + * + * @brief Read user actions on the Timer_Queue from stdin. + * + * This class reads user input from stdin; those commands permit + * the control of a Timer_Queue, which is dispatched by another + * thread. + */ class Custom_Handler_Input_Task : public ACE_Task_Base { - // = TITLE - // Read user actions on the Timer_Queue from stdin. - // - // = DESCRIPTION - // This class reads user input from stdin; those commands permit - // the control of a Timer_Queue, which is dispatched by another - // thread. public: typedef int (Custom_Handler_Input_Task::*ACTION) (void *); Custom_Handler_Input_Task (Thread_Timer_Queue *queue, Thread_Timer_Queue_Custom_Handler_Test &timer_queue_driver); + /// This method runs the event loop in the new thread. virtual int svc (void); - // This method runs the event loop in the new thread. // = Some helper methods. + /// Add a new timer to expire in <seconds> more. int add_timer (void *); - // Add a new timer to expire in <seconds> more. + /// Cancel timer <id>. int cancel_timer (void *); - // Cancel timer <id>. + /// List the current scheduled timers. int list_timer (void *); - // List the current scheduled timers. + /// Shutdown task. int shutdown_timer (void *); - // Shutdown task. + /// Dump the state of the timer queue. void dump (void); - // Dump the state of the timer queue. private: + /// The timer queue implementation. Thread_Timer_Queue *queue_; - // The timer queue implementation. + /// How many micro seconds are in a second. const int usecs_; - // How many micro seconds are in a second. + /// The thread timer queue test driver. Thread_Timer_Queue_Custom_Handler_Test &driver_; - // The thread timer queue test driver. }; +/** + * @class Thread_Timer_Queue_Custom_Handler_Test + * + * @brief Implements an example application that exercises + * <Thread_Timer_Queue> timer queue. + * + * This class implements a simple test driver for the + * <Thread_Timer_Queue>. The <display_menu> hook method is + * called from the base class to print a menu specific to the + * thread implementation of the timer queue. + */ class ACE_Svc_Export Thread_Timer_Queue_Custom_Handler_Test : public Timer_Queue_Test_Driver <Thread_Timer_Queue, Custom_Handler_Input_Task, Custom_Handler_Input_Task::ACTION> { - // = TITLE - // Implements an example application that exercises - // <Thread_Timer_Queue> timer queue. - // - // = DESCRIPTION - // This class implements a simple test driver for the - // <Thread_Timer_Queue>. The <display_menu> hook method is - // called from the base class to print a menu specific to the - // thread implementation of the timer queue. public: Thread_Timer_Queue_Custom_Handler_Test (void); ~Thread_Timer_Queue_Custom_Handler_Test (void); @@ -120,8 +119,8 @@ public: virtual int run_test (void); private: + /// Subclassed from ACE_Task. Custom_Handler_Input_Task input_task_; - // Subclassed from ACE_Task. }; #endif /* _THREAD_TIMER_QUEUE_TEST_H_ */ diff --git a/ACE/examples/Timer_Queue/main_thread_custom_handler.cpp b/ACE/examples/Timer_Queue/main_thread_custom_handler.cpp index afb8978cf81..cb4221ac394 100644 --- a/ACE/examples/Timer_Queue/main_thread_custom_handler.cpp +++ b/ACE/examples/Timer_Queue/main_thread_custom_handler.cpp @@ -1,24 +1,19 @@ -// $Id$ -// ============================================================================ -// -// = LIBRARY -// examples -// -// = FILENAME -// main_thread_custom_handler.cpp -// -// = DESCRIPTION -// Implements a threaded timer queue. -// This code exercises the Timer_Queue_Test_Driver class using -// threads. -// It also uses custom event handlers for timer events. -// -// = AUTHORS -// Douglas Schmidt <schmidt@cs.wustl.edu> && -// Sergio Flores-Gaitan <sergio@cs.wustl.edu> && -// Alon Diamant <diamant.alon@gmail.com> -// -// ============================================================================ +//============================================================================= +/** + * @file main_thread_custom_handler.cpp + * + * $Id$ + * + * Implements a threaded timer queue. + * This code exercises the Timer_Queue_Test_Driver class using + * threads. + * It also uses custom event handlers for timer events. + * + * + * @author Douglas Schmidt <schmidt@cs.wustl.edu> && Sergio Flores-Gaitan <sergio@cs.wustl.edu> && Alon Diamant <diamant.alon@gmail.com> + */ +//============================================================================= + #include "ace/OS_main.h" #include "ace/Auto_Ptr.h" diff --git a/ACE/examples/Web_Crawler/Command_Processor.h b/ACE/examples/Web_Crawler/Command_Processor.h index b778380fa22..43b2118329f 100644 --- a/ACE/examples/Web_Crawler/Command_Processor.h +++ b/ACE/examples/Web_Crawler/Command_Processor.h @@ -1,18 +1,15 @@ /* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// examples/Web_Crawler -// -// = FILENAME -// Command_Processor.h -// -// = AUTHOR -// Douglas C. Schmidt <schmidt@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file Command_Processor.h + * + * $Id$ + * + * @author Douglas C. Schmidt <schmidt@cs.wustl.edu> + */ +//============================================================================= + #ifndef _COMMAND_PROCESSOR_H #define _COMMAND_PROCESSOR_H @@ -27,65 +24,71 @@ // Forward decl. class URL; +/** + * @class Command + * + * @brief Abstract base class for a command. + * + * Each command is executed by a <Command_Processor>. + */ class Command { - // = TITLE - // Abstract base class for a command. - // - // = DESCRIPTION - // Each command is executed by a <Command_Processor>. public: + /// Virtual destructor. virtual ~Command (void); - // Virtual destructor. + /// This is the entry point to execute the command. virtual int execute (void) = 0; - // This is the entry point to execute the command. virtual int destroy (void) = 0; }; +/** + * @class URL_Command + * + * @brief Defines an API for executing a command on a URL. + * + * Each command is executed by a <Command_Processor>. + */ class URL_Command : public Command { - // = TITLE - // Defines an API for executing a command on a URL. - // - // = DESCRIPTION - // Each command is executed by a <Command_Processor>. public: + /// Constructor. URL_Command (URL *); - // Constructor. + /// Execute the URL command. virtual int execute (void); - // Execute the URL command. + /// Commit suicide. int destroy (void); - // Commit suicide. private: + /// Pointer to the URL. URL *url_; - // Pointer to the URL. }; +/** + * @class Command_Processor + * + * @brief Execute commands that are passed to it. + * + * This class implements the Command Processor pattern. + */ class Command_Processor { - // = TITLE - // Execute commands that are passed to it. - // - // = DESCRIPTION - // This class implements the Command Processor pattern. public: Command_Processor (void); + /// Insert a new <Command> into the <Command_Processor>'s queue. int insert (Command *); - // Insert a new <Command> into the <Command_Processor>'s queue. + /// Execute all the <Commands> in the queue. int execute (void); - // Execute all the <Commands> in the queue. + /// Destroy the <Command_Processor>. int destroy (void); - // Destroy the <Command_Processor>. protected: + /// Ensure dynamic allocation. ~Command_Processor (void); - // Ensure dynamic allocation. private: // @@ You fill in here... diff --git a/ACE/examples/Web_Crawler/HTTP_URL.h b/ACE/examples/Web_Crawler/HTTP_URL.h index 17e81863805..667dd1bb725 100644 --- a/ACE/examples/Web_Crawler/HTTP_URL.h +++ b/ACE/examples/Web_Crawler/HTTP_URL.h @@ -1,18 +1,15 @@ /* -*- C++ -*- */ -// $Id$ -// ============================================================================ -// -// = LIBRARY -// examples/Web_Crawler -// -// = FILENAME -// HTTP_URL.h -// -// = AUTHOR -// Douglas C. Schmidt <schmidt@cs.wustl.edu> -// -// ============================================================================ +//============================================================================= +/** + * @file HTTP_URL.h + * + * $Id$ + * + * @author Douglas C. Schmidt <schmidt@cs.wustl.edu> + */ +//============================================================================= + #ifndef _HTTP_URL_H #define _HTTP_URL_H @@ -25,40 +22,46 @@ #pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +/** + * @class HTTP_URL + * + * @brief An ADT for an HTTP URL. + * + * This class plays the "element" role in the Visitor pattern. + */ class HTTP_URL : public URL { - // = TITLE - // An ADT for an HTTP URL. - // - // = DESCRIPTION - // This class plays the "element" role in the Visitor pattern. public: + /** + * The <url_addr> is the URL that we're going to be visiting. We + * also keep track of the containing page, if any, which is used to + * print out more meaningful messages. + */ HTTP_URL (const ACE_URL_Addr &url_addr, HTTP_URL *containing_page = 0); - // The <url_addr> is the URL that we're going to be visiting. We - // also keep track of the containing page, if any, which is used to - // print out more meaningful messages. + /** + * Accept the visitor, which will then perform a particular + * visitation strategy on the URL. This method is part of the + * Visitor pattern. + */ virtual int accept (URL_Visitor *visitor); - // Accept the visitor, which will then perform a particular - // visitation strategy on the URL. This method is part of the - // Visitor pattern. + /// Send a <GET> command to fetch the contents in the URI from the + /// server. virtual ssize_t send_request (void); - // Send a <GET> command to fetch the contents in the URI from the - // server. + /// Returns the URL that we represent. virtual const ACE_URL_Addr &url_addr (void) const; - // Returns the URL that we represent. + /// Commit suicide int destroy (void); - // Commit suicide private: + /// Address of the URL we're connected to. ACE_URL_Addr url_addr_; - // Address of the URL we're connected to. + /// Page that contained us. HTTP_URL *containing_page_; - // Page that contained us. }; #endif /* _HTTP_URL_H */ diff --git a/ACE/examples/Web_Crawler/Iterators.h b/ACE/examples/Web_Crawler/Iterators.h index 5f174281fa0..27b7ae46052 100644 --- a/ACE/examples/Web_Crawler/Iterators.h +++ b/ACE/examples/Web_Crawler/Iterators.h @@ -1,18 +1,15 @@ /* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// examples/Web_Crawler -// -// = FILENAME -// Iterators.h -// -// = AUTHOR -// Douglas C. Schmidt <schmidt@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file Iterators.h + * + * $Id$ + * + * @author Douglas C. Schmidt <schmidt@cs.wustl.edu> + */ +//============================================================================= + #ifndef _ITERATORS_H #define _ITERATORS_H @@ -23,95 +20,112 @@ #pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +/** + * @class URL_Iterator + * + * @brief An abstract base class that defines an iterator. + * + * Subclasses of this base class can define what strings + * to return from <next>. This class decouples higher-level + * software from the details of whatever type of URL header or + * body we're iterating over. + */ class URL_Iterator { - // = TITLE - // An abstract base class that defines an iterator. - // - // = DESCRIPTION - // Subclasses of this base class can define what strings - // to return from <next>. This class decouples higher-level - // software from the details of whatever type of URL header or - // body we're iterating over. public: // = Initialization and termination methods. + /// "virtual" destructor. virtual int destroy (void); - // "virtual" destructor. // = Iterator methods. + /// Pass back the next <string> that hasn't been seen yet. Returns 0 + /// when all items have been seen, else 1. virtual int next (ACE_CString &string) = 0; - // Pass back the next <string> that hasn't been seen yet. Returns 0 - // when all items have been seen, else 1. protected: + /// C++ destructor. virtual ~URL_Iterator (void); - // C++ destructor. }; +/** + * @class HTML_Body_Iterator + * + * @brief An iterator that returns URLs embedded in HTML files. + */ class HTML_Body_Iterator : public URL_Iterator { - // = TITLE - // An iterator that returns URLs embedded in HTML files. public: // = Initialization and termination methods. + /// Constructor. HTML_Body_Iterator (URL &url); - // Constructor. // = Iterator methods. + /** + * Pass back the next <url> that hasn't been seen in the + * memory-mapped file. Returns 0 when all items have been seen, + * else 1. + */ virtual int next (ACE_CString &url); - // Pass back the next <url> that hasn't been seen in the - // memory-mapped file. Returns 0 when all items have been seen, - // else 1. private: + /// HTTP URL that we're iterating over. URL &url_; - // HTTP URL that we're iterating over. }; +/** + * @class HTTP_Header_Iterator + * + * @brief An iterator that iterates over the HTTP header. + */ class HTTP_Header_Iterator : public URL_Iterator { - // = TITLE - // An iterator that iterates over the HTTP header. public: // = Initialization and termination methods. + /// Constructor. HTTP_Header_Iterator (URL &url); - // Constructor. // = Iterator methods. + /** + * Pass back the next <line> that hasn't been seen in the + * memory-mapped file header. Returns 0 when we've reached the end + * of the header. seen, else 1. + */ virtual int next (ACE_CString &line); - // Pass back the next <line> that hasn't been seen in the - // memory-mapped file header. Returns 0 when we've reached the end - // of the header. seen, else 1. private: + /// HTTP URL that we're iterating over. URL &url_; - // HTTP URL that we're iterating over. + /// We've found the end of the header, which means this iterator is + /// finished. int end_of_header_; - // We've found the end of the header, which means this iterator is - // finished. }; +/** + * @class URL_Download_Iterator + * + * @brief An iterator that iterates over the contents of an entire URL, + * i.e., both header and body, and returns it in <BUFSIZ> + * <buffer>s. + */ class URL_Download_Iterator : public URL_Iterator { - // = TITLE - // An iterator that iterates over the contents of an entire URL, - // i.e., both header and body, and returns it in <BUFSIZ> - // <buffer>s. public: // = Initialization and termination methods. + /// Constructor. URL_Download_Iterator (URL &url); - // Constructor. // = Iterator methods. + /** + * Pass back the next <buffer> data from the stream, where + * <buffer.size> <= <BUFSIZ> . Returns 0 when we've reached the end + * of the header, else 1. + */ virtual int next (ACE_CString &buffer); - // Pass back the next <buffer> data from the stream, where - // <buffer.size> <= <BUFSIZ> . Returns 0 when we've reached the end - // of the header, else 1. private: + /// HTTP URL that we're iterating over. URL &url_; - // HTTP URL that we're iterating over. }; #endif /* _ITERATORS_H */ diff --git a/ACE/examples/Web_Crawler/Mem_Map_Stream.h b/ACE/examples/Web_Crawler/Mem_Map_Stream.h index b7aa58c85f0..da3e1c45b47 100644 --- a/ACE/examples/Web_Crawler/Mem_Map_Stream.h +++ b/ACE/examples/Web_Crawler/Mem_Map_Stream.h @@ -1,18 +1,15 @@ /* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// examples/Web_Crawler -// -// = FILENAME -// Mem_Map_Stream.h -// -// = AUTHOR -// Douglas C. Schmidt <schmidt@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file Mem_Map_Stream.h + * + * $Id$ + * + * @author Douglas C. Schmidt <schmidt@cs.wustl.edu> + */ +//============================================================================= + #ifndef _MEM_MAP_STREAM_H #define _MEM_MAP_STREAM_H @@ -31,31 +28,30 @@ #include "ace/Svc_Handler.h" #include "ace/Strategies_T.h" +/** + * @class Mem_Map_Stream + * + * @brief Provides a memory-mapped stream abstraction to simplify parsing + * of tokens. + * + * This class makes it possible to treat an connection as a stream + * of bytes, similar to the C library stdio streams. The contents + * of the connection are buffered incrementally in a memory-mapped + * file. This class maintains pointers to two positions in the + * stream: + * 1. The <recv> position, which keeps track of the beginning of a + * token that is in the stream. + * 2. The <get> position, which moves along character-by-character + * until the end of the token is reached. + * Once a token has been located, it can be extracted from the + * stream by calling the <recv>. The length of the token, i.e., + * the <recv_len>, is the length in bytes between the <get> + * position and the <recv> position. Once the token has been + * extracted, the <recv> and <get> positions can be updated by the + * <seek> method. + */ class Mem_Map_Stream { - // = TITLE - // Provides a memory-mapped stream abstraction to simplify parsing - // of tokens. - // - // = DESCRIPTION - // This class makes it possible to treat an connection as a stream - // of bytes, similar to the C library stdio streams. The contents - // of the connection are buffered incrementally in a memory-mapped - // file. This class maintains pointers to two positions in the - // stream: - // - // 1. The <recv> position, which keeps track of the beginning of a - // token that is in the stream. - // - // 2. The <get> position, which moves along character-by-character - // until the end of the token is reached. - // - // Once a token has been located, it can be extracted from the - // stream by calling the <recv>. The length of the token, i.e., - // the <recv_len>, is the length in bytes between the <get> - // position and the <recv> position. Once the token has been - // extracted, the <recv> and <get> positions can be updated by the - // <seek> method. public: typedef ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH> Svc_Handler; @@ -66,77 +62,89 @@ public: // Mem_Map_Stream (void); // constructor added:KIRTHIKA + /// Initialize this object. virtual int open (STRAT_CONNECTOR *connector, const ACE_INET_Addr &); - // Initialize this object. + /// Destructor. virtual ~Mem_Map_Stream (void); - // Destructor. // = Accessor. + /// Returns the underlying <ACE_SOCK_Stream>. ACE_SOCK_Stream &stream (void); - // Returns the underlying <ACE_SOCK_Stream>. // = I/O methods. + /// Send <size> bytes in <buf> to the connected peer. This is a + /// completely unbuffered call. virtual ssize_t send_n (const void *buf, size_t size, ACE_Time_Value *tv = 0); - // Send <size> bytes in <buf> to the connected peer. This is a - // completely unbuffered call. + /** + * Return the next character in the stream and advance the <get> + * position. Returns EOF when the <get> position reaches the end of + * the HTTP stream. + */ virtual int get_char (void); - // Return the next character in the stream and advance the <get> - // position. Returns EOF when the <get> position reaches the end of - // the HTTP stream. + /** + * Returns a pointer to array of at most <len> characters starting + * at the <recv> position. If the <recv> position + <len> extends + * past the EOF then <len> is set to the number of characters + * between the <recv> position and the EOF and both the <get> and + * <recv> positions are advanced by <len>. Returns 0 if the <recv> + * position is at the EOF. + */ virtual const char *recv (size_t &len); - // Returns a pointer to array of at most <len> characters starting - // at the <recv> position. If the <recv> position + <len> extends - // past the EOF then <len> is set to the number of characters - // between the <recv> position and the EOF and both the <get> and - // <recv> positions are advanced by <len>. Returns 0 if the <recv> - // position is at the EOF. + /// Returns a pointer to array of characters starting at the <recv> + /// position. virtual const char *recv (void) const; - // Returns a pointer to array of characters starting at the <recv> - // position. + /// Returns the length in bytes between the <get> position and the + /// <recv> position. virtual size_t recv_len (void) const; - // Returns the length in bytes between the <get> position and the - // <recv> position. + /** + * Resets the <get> and <recv> positions to the beginning of the + * stream. This works since all the data has been cached in the + * memory-mapped backing store. + */ virtual int rewind (void); - // Resets the <get> and <recv> positions to the beginning of the - // stream. This works since all the data has been cached in the - // memory-mapped backing store. + /** + * Returns the nth character <offset> from the <get> position in the + * stream without advancing the <get> position. Automatically + * extends the backing store if necessary. Returns EOF if <offset> + * is past the end of the stream. + */ virtual int peek_char (size_t offset); - // Returns the nth character <offset> from the <get> position in the - // stream without advancing the <get> position. Automatically - // extends the backing store if necessary. Returns EOF if <offset> - // is past the end of the stream. + /** + * Return a pointer to an array of <size> characters starting at + * <offset> characters from the <get> position in the stream without + * advancing the <get> position. Automatically extends the backing + * store if necessary. Returns 0 if <offset> or <offset + size> is + * past the end of the stream. + */ virtual const char *peek_str (size_t offset, size_t size); - // Return a pointer to an array of <size> characters starting at - // <offset> characters from the <get> position in the stream without - // advancing the <get> position. Automatically extends the backing - // store if necessary. Returns 0 if <offset> or <offset + size> is - // past the end of the stream. + /** + * Sets the <get> and <recv> positions as follows: + * o If <whence> is <SEEK_SET>, the positions are set to <offset> + * bytes from the start of the stream. + * + * o If <whence> is <SEEK_CUR>, the positions are set to the + * current <get> position plus <offset>. + * + * o If <whence> is <SEEK_END>, the positions are set to the size + * of the stream plus <offset>. + */ virtual ACE_OFF_T seek (ACE_OFF_T offset, int whence = SEEK_CUR); - // Sets the <get> and <recv> positions as follows: - // o If <whence> is <SEEK_SET>, the positions are set to <offset> - // bytes from the start of the stream. - // - // o If <whence> is <SEEK_CUR>, the positions are set to the - // current <get> position plus <offset>. - // - // o If <whence> is <SEEK_END>, the positions are set to the size - // of the stream plus <offset>. + /// Returns 1 if we're at the end of the HTTP stream, else 0. virtual int eof (void) const; - // Returns 1 if we're at the end of the HTTP stream, else 0. /* @@ -152,37 +160,41 @@ public: Svc_Handler *svc_handler (void); private: + /** + * Grow the file by reading another chunk from the HTTP socket and + * extend the mapping to cover this chunk. Returns -1 on failure or + * EOF, else 0. + */ int grow_file_and_remap (void); - // Grow the file by reading another chunk from the HTTP socket and - // extend the mapping to cover this chunk. Returns -1 on failure or - // EOF, else 0. //ACE_SOCK_Stream stream_; + /** + * Connection to peer. The granularity is at the Svc_Handler level. + * The Svc_Handler has an SOCK_Stream. + * Configure the Strategy Connector with a strategy that caches + * connection. + */ Svc_Handler *svc_handler_; - // Connection to peer. The granularity is at the Svc_Handler level. - // The Svc_Handler has an SOCK_Stream. /* NULL_CREATION_STRATEGY creation_strategy_; NULL_ACTIVATION_STRATEGY activation_strategy_; - // Configure the Strategy Connector with a strategy that caches - // connection. CACHED_CONNECT_STRATEGY caching_connect_strategy_; STRAT_CONNECTOR *strat_connector_; */ + /// Memory-mapped file that we're iterating over. ACE_Mem_Map mem_map_; - // Memory-mapped file that we're iterating over. + /// Pointer to the address where the next <recv> method will start. char *recv_pos_; - // Pointer to the address where the next <recv> method will start. + /// Pointer to the address where the next <get_char> method will + /// start. char *get_pos_; - // Pointer to the address where the next <get_char> method will - // start. + /// Address at the end of the file mapping. char *end_of_mapping_plus1_; - // Address at the end of the file mapping. }; diff --git a/ACE/examples/Web_Crawler/Options.h b/ACE/examples/Web_Crawler/Options.h index 0c9768822f5..73f24f8d810 100644 --- a/ACE/examples/Web_Crawler/Options.h +++ b/ACE/examples/Web_Crawler/Options.h @@ -1,18 +1,15 @@ /* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// examples/Web_Crawler -// -// = FILENAME -// Options.h -// -// = AUTHOR -// Douglas C. Schmidt <schmidt@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file Options.h + * + * $Id$ + * + * @author Douglas C. Schmidt <schmidt@cs.wustl.edu> + */ +//============================================================================= + #ifndef _OPTIONS_H #define _OPTIONS_H @@ -29,46 +26,48 @@ class Command_Processor; class URL_Visitor; +/** + * @class Options + * + * @brief Maintains the global options. + * + * This class is converted into a Singleton by the + * <ACE_Singleton> template. + */ class Options { - // = TITLE - // Maintains the global options. - // - // = DESCRIPTION - // This class is converted into a Singleton by the - // <ACE_Singleton> template. public: + /// Parse the command-line arguments and initialize the options. int parse_args (int argc, ACE_TCHAR *argv[]); - // Parse the command-line arguments and initialize the options. + /// If non-0 and the link is an HTML file then recursively check all + /// links that are embedded in the body of file. int recurse (void) const; - // If non-0 and the link is an HTML file then recursively check all - // links that are embedded in the body of file. + /// Return the hostname of the initial Web server. const ACE_TCHAR *hostname (void) const; - // Return the hostname of the initial Web server. + /// Return the initial URI. const ACE_TCHAR *path_name (void) const; - // Return the initial URI. + /// String used to filter out which URLs to validate. const ACE_TCHAR *url_filter (void) const; - // String used to filter out which URLs to validate. + /// Are we debugging? int debug (void) const; - // Are we debugging? + /// Are we being verbose? int verbose (void) const; - // Are we being verbose? + /// Which order? LIFO|FIFO?? const ACE_TCHAR *order (void) const; - // Which order? LIFO|FIFO?? + /// Port # int port_no (void) const; - // Port # + /// Return the timeout used to prevent hanging on <recv> and + /// <connect> calls to broken servers. const ACE_Time_Value *timeout (void) const; - // Return the timeout used to prevent hanging on <recv> and - // <connect> calls to broken servers. // = Get/set the <Command_Processor>. Command_Processor *command_processor (void) const; @@ -81,41 +80,41 @@ public: // Get the handle_limit. int handle_limit (void); private: + /// Are we recursving. int recurse_; - // Are we recursving. + /// Initial Web server name. const ACE_TCHAR *hostname_; - // Initial Web server name. + /// Initial URI name. const ACE_TCHAR *uri_; - // Initial URI name. + /// Are we debugging? int debug_; - // Are we debugging? + /// Are we being verbose? int verbose_; - // Are we being verbose? + /// Whether the URLs are traversed in FIFO or LIFO order. const ACE_TCHAR *order_; - // Whether the URLs are traversed in FIFO or LIFO order. + /// Timeout on <recv> and <connect> to broken Web servers. ACE_Time_Value timeout_; - // Timeout on <recv> and <connect> to broken Web servers. + /// String used to filter out which URLs to validate. const ACE_TCHAR *url_filter_; - // String used to filter out which URLs to validate. + /// Pointer to the Command_Processor. Command_Processor *command_processor_; - // Pointer to the Command_Processor. + /// Pointer to the <URL_Visitor>. URL_Visitor *visitor_; - // Pointer to the <URL_Visitor>. + /// Port no. int port_no_; - // Port no. + /// The limit of the number of descriptors to be given for this process. int handle_limit_; - // The limit of the number of descriptors to be given for this process. }; // Typedef an Options Singleton. diff --git a/ACE/examples/Web_Crawler/URL.h b/ACE/examples/Web_Crawler/URL.h index 68c41f018ad..9dd37dbcd96 100644 --- a/ACE/examples/Web_Crawler/URL.h +++ b/ACE/examples/Web_Crawler/URL.h @@ -1,18 +1,15 @@ /* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// examples/Web_Crawler -// -// = FILENAME -// URL.h -// -// = AUTHOR -// Douglas C. Schmidt <schmidt@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file URL.h + * + * $Id$ + * + * @author Douglas C. Schmidt <schmidt@cs.wustl.edu> + */ +//============================================================================= + #ifndef _URL_H #define _URL_H @@ -32,31 +29,35 @@ // Forward declaration. class URL_Visitor; +/** + * @class URL + * + * @brief Base class for a URL. + * + * This class plays a role in the Visitor pattern. + */ class URL { - // = TITLE - // Base class for a URL. - // - // = DESCRIPTION - // This class plays a role in the Visitor pattern. public: + /// Destructor. virtual ~URL (void); - // Destructor. + /** + * Accept the visitor, which will then perform a particular + * visitation strategy on the URL. This method is part of the + * Visitor pattern. + */ virtual int accept (URL_Visitor *visitor) = 0; - // Accept the visitor, which will then perform a particular - // visitation strategy on the URL. This method is part of the - // Visitor pattern. + /// Send a <GET> command to fetch the contents in the URI from the + /// server. virtual ssize_t send_request (void) = 0; - // Send a <GET> command to fetch the contents in the URI from the - // server. + /// Returns the URL that we represent. virtual const ACE_URL_Addr &url_addr (void) const = 0; - // Returns the URL that we represent. + /// Returns the <Mem_Map_Stream>. virtual Mem_Map_Stream &stream (void); - // Returns the <Mem_Map_Stream>. // = Get/set the reply status. virtual const URL_Status &reply_status (void); @@ -69,14 +70,14 @@ public: private: + /// Reply status of the URL. URL_Status reply_status_; - // Reply status of the URL. + /// Content-type of the URL. ACE_CString content_type_; - // Content-type of the URL. + /// Contents of the stream. Mem_Map_Stream stream_; - // Contents of the stream. }; #endif /* _URL_H */ diff --git a/ACE/examples/Web_Crawler/URL_Addr.h b/ACE/examples/Web_Crawler/URL_Addr.h index 8c7c79a5542..b864ae26a81 100644 --- a/ACE/examples/Web_Crawler/URL_Addr.h +++ b/ACE/examples/Web_Crawler/URL_Addr.h @@ -1,19 +1,16 @@ // -*- C++ -*- -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// examples/Web_Crawler -// -// = FILENAME -// URL_Addr.h -// -// = AUTHOR -// Douglas C. Schmidt <schmidt@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file URL_Addr.h + * + * $Id$ + * + * @author Douglas C. Schmidt <schmidt@cs.wustl.edu> + */ +//============================================================================= + #ifndef ACE_URL_ADDR_H #define ACE_URL_ADDR_H @@ -26,87 +23,98 @@ #include "ace/ACE.h" +/** + * @class ACE_URL_Addr + * + * @brief Defines a URL address family address format. + */ class ACE_URL_Addr : public ACE_INET_Addr { - // = TITLE - // Defines a URL address family address format. public: // = Initialization and termination methods. + /// Constructor. ACE_URL_Addr (void); - // Constructor. ACE_URL_Addr (const ACE_TCHAR *host_name, const ACE_TCHAR *path_name, u_short port = ACE_DEFAULT_HTTP_PORT); + /// Copy constructor. ACE_URL_Addr (const ACE_URL_Addr &addr); - // Copy constructor. + /// Essentially the copy constructor. int set (const ACE_URL_Addr &addr); - // Essentially the copy constructor. + /** + * Initializes an <ACE_URL_Addr> from the <address>, which can be + * "ip-number:port-number/path-name" (e.g., + * "www.cs.wustl.edu:1234/~schmidt/" "ip-number:port-number/path-name" + * (e.g., "128.252.166.57:1234/~schmidt"). If there is no ':' in + * the <address> it is assumed to be an ip-number or ip-address + * number, with the port number <ACE_DEFAULT_HTTP_PORT>. + */ virtual int string_to_addr (const ACE_TCHAR *address, int address_family = AF_UNSPEC); - // Initializes an <ACE_URL_Addr> from the <address>, which can be - // "ip-number:port-number/path-name" (e.g., - // "www.cs.wustl.edu:1234/~schmidt/" "ip-number:port-number/path-name" - // (e.g., "128.252.166.57:1234/~schmidt"). If there is no ':' in - // the <address> it is assumed to be an ip-number or ip-address - // number, with the port number <ACE_DEFAULT_HTTP_PORT>. + /** + * Transform the current <ACE_INET_Addr> address into string format. + * If <ipaddr_format> is non-0 this produces + * "ip-number:port-number/path-name" (e.g., + * "128.252.166.57:80/~schmidt/"), whereas if <ipaddr_format> is 0 + * this produces "ip-name:port-number" (e.g., + * "www.cs.wustl.edu:80/~schmidt/"). Returns -1 if the <size> of + * the <buffer> is too small, else 0. + */ virtual int addr_to_string (ACE_TCHAR *s, size_t size, int ipaddr_format = 1) const; - // Transform the current <ACE_INET_Addr> address into string format. - // If <ipaddr_format> is non-0 this produces - // "ip-number:port-number/path-name" (e.g., - // "128.252.166.57:80/~schmidt/"), whereas if <ipaddr_format> is 0 - // this produces "ip-name:port-number" (e.g., - // "www.cs.wustl.edu:80/~schmidt/"). Returns -1 if the <size> of - // the <buffer> is too small, else 0. + /** + * Transform the current <ACE_INET_Addr> address into string format. + * If <ipaddr_format> is non-0 this produces + * "ip-number:port-number/path-name" (e.g., + * "128.252.166.57:80/~schmidt/"), whereas if <ipaddr_format> is 0 + * this produces "ip-name:port-number" (e.g., + * "www.cs.wustl.edu:80/~schmidt/"). Uses dynamic memory, which + * is allocated on demand and deallocated when the object is + * destroyed. Returns -1 if dynamic memory fails, else 0. + */ virtual const ACE_TCHAR *addr_to_string (int ipaddr_format = 1) const; - // Transform the current <ACE_INET_Addr> address into string format. - // If <ipaddr_format> is non-0 this produces - // "ip-number:port-number/path-name" (e.g., - // "128.252.166.57:80/~schmidt/"), whereas if <ipaddr_format> is 0 - // this produces "ip-name:port-number" (e.g., - // "www.cs.wustl.edu:80/~schmidt/"). Uses dynamic memory, which - // is allocated on demand and deallocated when the object is - // destroyed. Returns -1 if dynamic memory fails, else 0. + /// Assignment operator. void operator= (const ACE_URL_Addr &addr); - // Assignment operator. + /// Destructor. ~ACE_URL_Addr (void); - // Destructor. + /** + * Compare two addresses for equality. The addresses are considered + * equal if they contain the same IP address, port number, and path + * name. + */ bool operator == (const ACE_URL_Addr &SAP) const; - // Compare two addresses for equality. The addresses are considered - // equal if they contain the same IP address, port number, and path - // name. + /// Compare two addresses for inequality. bool operator != (const ACE_URL_Addr &SAP) const; - // Compare two addresses for inequality. + /// Computes and returns hash value. virtual u_long hash (void) const; - // Computes and returns hash value. + /// Return the path name. const ACE_TCHAR *get_path_name (void) const; - // Return the path name. + /// Commit suicide. int destroy (void); - // Commit suicide. private: + /// Our path name. ACE_TCHAR *path_name_; - // Our path name. + /// The dynamically address string that's used for the + /// <addr_to_string> method. ACE_TCHAR *addr_string_; - // The dynamically address string that's used for the - // <addr_to_string> method. + /// Current length of the <addr_string_> size_t addr_string_len_; - // Current length of the <addr_string_> }; #endif /* ACE_URL_ADDR_H */ diff --git a/ACE/examples/Web_Crawler/URL_Status.h b/ACE/examples/Web_Crawler/URL_Status.h index 9996fbf7e3d..085291ef939 100644 --- a/ACE/examples/Web_Crawler/URL_Status.h +++ b/ACE/examples/Web_Crawler/URL_Status.h @@ -1,18 +1,15 @@ /* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// examples/Web_Crawler -// -// = FILENAME -// URL_Status.h -// -// = AUTHOR -// Douglas C. Schmidt <schmidt@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file URL_Status.h + * + * $Id$ + * + * @author Douglas C. Schmidt <schmidt@cs.wustl.edu> + */ +//============================================================================= + #ifndef _URL_STATUS_H #define _URL_STATUS_H @@ -23,9 +20,12 @@ #pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +/** + * @class URL_Status + * + */ class URL_Status { - // = TITLE public: enum STATUS_CODE { diff --git a/ACE/examples/Web_Crawler/URL_Visitor.h b/ACE/examples/Web_Crawler/URL_Visitor.h index f7522c6707c..485c7366c6a 100644 --- a/ACE/examples/Web_Crawler/URL_Visitor.h +++ b/ACE/examples/Web_Crawler/URL_Visitor.h @@ -1,18 +1,15 @@ /* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// examples/Web_Crawler -// -// = FILENAME -// URL_Visitor.h -// -// = AUTHOR -// Douglas C.Schmidt <schmidt@cs.wustl.edu> -// Kirthika Parameswaran <kirthika@cs.wustl.edu> -// ============================================================================ + +//============================================================================= +/** + * @file URL_Visitor.h + * + * $Id$ + * + * @author Douglas C.Schmidt <schmidt@cs.wustl.edu> Kirthika Parameswaran <kirthika@cs.wustl.edu> + */ +//============================================================================= + #ifndef _URL_VISITOR_H #define _URL_VISITOR_H @@ -35,95 +32,107 @@ // Forward declarations. class URL_Validation_Visitor; +/** + * @class URL_Processing_Strategy + * + * @brief Abstract base class for the URL processing strategy. + * + */ class URL_Processing_Strategy { - // = TITLE - // Abstract base class for the URL processing strategy. - // - // = DESCRIPTION public: + /// Constructor. URL_Processing_Strategy (URL &, URL_Iterator &); - // Constructor. virtual ~URL_Processing_Strategy (void); + /// Perform the strategy. virtual int execute (void) = 0; - // Perform the strategy. virtual int destroy (void); // Close down the resources. protected: + /// A reference to the URL "context" that we're processing. URL &url_; - // A reference to the URL "context" that we're processing. + /// Iterator for the URL that we're processing. URL_Iterator &iterator_; - // Iterator for the URL that we're processing. }; +/** + * @class HTTP_Header_Processing_Strategy + * + * @brief Defines the HTTP header processing strategy. + * + */ class HTTP_Header_Processing_Strategy : public URL_Processing_Strategy { - // = TITLE - // Defines the HTTP header processing strategy. - // - // = DESCRIPTION public: + /// Constructor. HTTP_Header_Processing_Strategy (URL &, URL_Iterator &); - // Constructor. + /// Perform the strategy for processing an HTTP header. virtual int execute (void); - // Perform the strategy for processing an HTTP header. }; +/** + * @class HTML_Body_Validation_Strategy + * + * @brief Defines the HTML body processing strategy. + * + * This class iterates through the body of an HTML file and + * recursively visits embedded links. + */ class HTML_Body_Validation_Strategy : public URL_Processing_Strategy { - // = TITLE - // Defines the HTML body processing strategy. - // - // = DESCRIPTION - // This class iterates through the body of an HTML file and - // recursively visits embedded links. public: + /// Constructor. HTML_Body_Validation_Strategy (URL &, URL_Iterator &, URL_Validation_Visitor &); - // Constructor. + /** + * Perform the strategy for processing an HTML file. This strategy + * iterates over the HTML file and recursively visits embedded links + * to process them, as well. + */ virtual int execute (void); - // Perform the strategy for processing an HTML file. This strategy - // iterates over the HTML file and recursively visits embedded links - // to process them, as well. private: + /// This is the context of the visit. URL_Validation_Visitor &visitor_context_; - // This is the context of the visit. }; +/** + * @class URL_Download_Strategy + * + * @brief Defines a URL downloading strategy. + * + * This class downloads a URL's contents into a temporary file. + */ class URL_Download_Strategy : public URL_Processing_Strategy { - // = TITLE - // Defines a URL downloading strategy. - // - // = DESCRIPTION - // This class downloads a URL's contents into a temporary file. public: + /// Constructor. URL_Download_Strategy (URL &, URL_Iterator &); - // Constructor. + /// Perform the strategy for downloading a URL to a temporary file. virtual int execute (void); - // Perform the strategy for downloading a URL to a temporary file. }; +/** + * @class URL_Visitation_Strategy_Factory + * + * @brief Abstract Factory for the URL visitation strategy. + * + */ class URL_Visitation_Strategy_Factory { - // = TITLE - // Abstract Factory for the URL visitation strategy. - // - // = DESCRIPTION public: URL_Visitation_Strategy_Factory (URL *); @@ -131,108 +140,114 @@ public: virtual ~URL_Visitation_Strategy_Factory (void); // = Factory Methods. + /// Factory Method that makes the header iterator. virtual URL_Iterator *make_header_iterator (void) = 0; - // Factory Method that makes the header iterator. + /// Factory Method that makes the body iterator. virtual URL_Iterator *make_body_iterator (void) = 0; - // Factory Method that makes the body iterator. + /// Factory Method that makes the header processing strategy. virtual URL_Processing_Strategy *make_header_strategy (URL_Iterator &) = 0; - // Factory Method that makes the header processing strategy. + /// Factory Method that makes the body processing strategy . virtual URL_Processing_Strategy *make_body_strategy (URL_Iterator &) = 0; - // Factory Method that makes the body processing strategy . + /// Close down the resources. virtual int destroy (void) = 0; - // Close down the resources. protected: + /// Stash the URL so we don't have to pass it around. URL *url_; - // Stash the URL so we don't have to pass it around. }; +/** + * @class URL_Download_Visitation_Strategy_Factory + * + * @brief Concrete Factory for the URL validation visitation strategy. + * + */ class URL_Download_Visitation_Strategy_Factory : public URL_Visitation_Strategy_Factory { - // = TITLE - // Concrete Factory for the URL validation visitation strategy. - // - // = DESCRIPTION public: + /// Constructor. URL_Download_Visitation_Strategy_Factory (URL *); - // Constructor. // = Factory Methods. + /// Factory Method that makes an <HTTP_Header_Iterator>. virtual URL_Iterator *make_header_iterator (void); - // Factory Method that makes an <HTTP_Header_Iterator>. + /// Factory Method that makes an <HTML_Body_Iterator>. virtual URL_Iterator *make_body_iterator (void); - // Factory Method that makes an <HTML_Body_Iterator>. + /// Factory Method that makes the header processing strategy. virtual URL_Processing_Strategy *make_header_strategy (URL_Iterator &); - // Factory Method that makes the header processing strategy. + /// Factory Method that makes the body processing strategy . virtual URL_Processing_Strategy *make_body_strategy (URL_Iterator &); - // Factory Method that makes the body processing strategy . + /// Close down the resources. virtual int destroy (void); - // Close down the resources. }; +/** + * @class URL_Validation_Visitation_Strategy_Factory + * + * @brief Concrete Factory for the URL validation visitation strategy. + * + */ class URL_Validation_Visitation_Strategy_Factory : public URL_Visitation_Strategy_Factory { - // = TITLE - // Concrete Factory for the URL validation visitation strategy. - // - // = DESCRIPTION public: + /// Constructor. URL_Validation_Visitation_Strategy_Factory (URL *, URL_Validation_Visitor &); - // Constructor. // = Factory Methods. + /// Factory Method that makes an <HTTP_Header_Iterator>. virtual URL_Iterator *make_header_iterator (void); - // Factory Method that makes an <HTTP_Header_Iterator>. + /// Factory Method that makes an <HTML_Body_Iterator>. virtual URL_Iterator *make_body_iterator (void); - // Factory Method that makes an <HTML_Body_Iterator>. + /// Factory Method that makes the header processing strategy. virtual URL_Processing_Strategy *make_header_strategy (URL_Iterator &); - // Factory Method that makes the header processing strategy. + /// Factory Method that makes the body processing strategy . virtual URL_Processing_Strategy *make_body_strategy (URL_Iterator &); - // Factory Method that makes the body processing strategy . + /// Close down the resources. virtual int destroy (void); - // Close down the resources. private: + /// Context of the visitor. URL_Validation_Visitor &visitor_context_; - // Context of the visitor. }; +/** + * @class URL_Visitor + * + * @brief Base class for the URL Visitor. + * + * This class plays the "visitor" role in the Visitor pattern. + */ class URL_Visitor { - // = TITLE - // Base class for the URL Visitor. - // - // = DESCRIPTION - // This class plays the "visitor" role in the Visitor pattern. public: virtual ~URL_Visitor (void); + /// Visit an <HTTP_URL>. virtual int visit (HTTP_URL &http_url) = 0; - // Visit an <HTTP_URL>. // @@ // virtual int visit (FTP_URL &http_url) = 0; + /// Cleanup the resources. virtual int destroy (void) = 0; - // Cleanup the resources. protected: + /// Make the appropriate <URL_Visitation_Strategy_Factory>. virtual URL_Visitation_Strategy_Factory *make_visitation_strategy_factory (URL &) = 0; - // Make the appropriate <URL_Visitation_Strategy_Factory>. }; typedef int ATTRIBUTES; @@ -275,48 +290,52 @@ typedef ACE_NOOP_Concurrency_Strategy<Client_Svc_Handler> typedef ACE_Cached_Connect_Strategy_Ex<Client_Svc_Handler, ACE_SOCK_CONNECTOR, CACHING_STRATEGY, ATTRIBUTES, ACE_SYNCH_NULL_MUTEX> CACHED_CONNECT_STRATEGY; +/** + * @class URL_Validation_Visitor + * + * @brief Subclass that defines the URL validation visitor. + * + * This class checks to make sure that the <HTTP_URL> is valid. + * If the <HTTP_URL> is an <HTML> file, it can also be used to + * recursively check that all embedded links in this file are + * valid. + */ class URL_Validation_Visitor : public URL_Visitor { - // = TITLE - // Subclass that defines the URL validation visitor. - // - // = DESCRIPTION - // This class checks to make sure that the <HTTP_URL> is valid. - // If the <HTTP_URL> is an <HTML> file, it can also be used to - // recursively check that all embedded links in this file are - // valid. public: typedef ACE_Hash_Map_Manager <ACE_URL_Addr, URL_Status, ACE_Null_Mutex> URL_CACHE; + /** + * Visit an <HTTP_URL> to make sure that it's valid. If the content + * type of the <HTTP_URL> is "text/html" and the <recursion> option + * is enabled then <visit> recursively checks each link embedded in + * the HTML page. + */ virtual int visit (HTTP_URL &http_url); - // Visit an <HTTP_URL> to make sure that it's valid. If the content - // type of the <HTTP_URL> is "text/html" and the <recursion> option - // is enabled then <visit> recursively checks each link embedded in - // the HTML page. // @@ // virtual int visit (FTP_URL &http_url); + /// Cleanup the resources. URL_Validation_Visitor (void); virtual int destroy (void); - // Cleanup the resources. + /// Returns a reference to the URL cache. URL_CACHE &url_cache (void); - // Returns a reference to the URL cache. protected: + /// Factory Method that makes a + /// <URL_Validation_Visitation_Strategy_Factory>. virtual ~URL_Validation_Visitor (void); virtual URL_Visitation_Strategy_Factory *make_visitation_strategy_factory (URL &); - // Factory Method that makes a - // <URL_Validation_Visitation_Strategy_Factory>. + /// Cache the status of URLs we've already validated. URL_CACHE url_cache_; - // Cache the status of URLs we've already validated. + /// Check to see if the reply status of this <url_addr> is in the + /// cache. Returns 1 if so, 0 if not. int in_cache (const ACE_URL_Addr &url_addr); - // Check to see if the reply status of this <url_addr> is in the - // cache. Returns 1 if so, 0 if not. NULL_CREATION_STRATEGY creation_strategy_; NULL_ACTIVATION_STRATEGY activation_strategy_; @@ -331,42 +350,48 @@ protected: }; +/** + * @class URL_Download_Visitor + * + * @brief Subclass for the URL validtion visitor. + * + * This class checks to make sure that the <HTTP_URL> is valid. + */ class URL_Download_Visitor : public URL_Visitor { - // = TITLE - // Subclass for the URL validtion visitor. - // - // = DESCRIPTION - // This class checks to make sure that the <HTTP_URL> is valid. public: + /** + * Visit an <HTTP_URL> to make sure that it's valid. If the content + * type of the <HTTP_URL> is "text/html" and the <recursion> option + * is enabled then <visit> recursively checks each link embedded in + * the HTML page. + */ virtual int visit (HTTP_URL &http_url); - // Visit an <HTTP_URL> to make sure that it's valid. If the content - // type of the <HTTP_URL> is "text/html" and the <recursion> option - // is enabled then <visit> recursively checks each link embedded in - // the HTML page. // @@ // virtual int visit (FTP_URL &http_url); + /// Cleanup the resources. virtual int destroy (void); - // Cleanup the resources. protected: + /// Factory Method that makes a <URL_Download_Visitation_Strategy_Factory>. URL_Visitation_Strategy_Factory *make_visitation_strategy_factory (URL &); - // Factory Method that makes a <URL_Download_Visitation_Strategy_Factory>. }; +/** + * @class Auto_Destroyer + * + * @brief Simple class that ensures the <destroy> method is called on our + * <URL_*> objects when they go out of scope. + * + * This class is similar to an auto_ptr<> and should be used to + * simplify blocks of code that must create/destroy pointers to + * various <URL_*> related strategies and iterators. + */ template <class T> class Auto_Destroyer { - // = TITLE - // Simple class that ensures the <destroy> method is called on our - // <URL_*> objects when they go out of scope. - // - // = DESCRIPTION - // This class is similar to an auto_ptr<> and should be used to - // simplify blocks of code that must create/destroy pointers to - // various <URL_*> related strategies and iterators. public: Auto_Destroyer (T *t): t_ (t) {} T *operator-> (void) { return this->t_; } diff --git a/ACE/examples/Web_Crawler/URL_Visitor_Factory.h b/ACE/examples/Web_Crawler/URL_Visitor_Factory.h index 9f484afe9f0..1650f8c9561 100644 --- a/ACE/examples/Web_Crawler/URL_Visitor_Factory.h +++ b/ACE/examples/Web_Crawler/URL_Visitor_Factory.h @@ -1,18 +1,15 @@ /* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// examples/Web_Crawler -// -// = FILENAME -// URL_Visitor_Factory.h -// -// = AUTHOR -// Douglas C. Schmidt <schmidt@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file URL_Visitor_Factory.h + * + * $Id$ + * + * @author Douglas C. Schmidt <schmidt@cs.wustl.edu> + */ +//============================================================================= + #ifndef _URL_VISITOR_FACTORY_H #define _URL_VISITOR_FACTORY_H @@ -24,51 +21,59 @@ #pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +/** + * @class URL_Visitor_Factory + * + * @brief Abstract base class that creates URL visitors. + * + * Subclasses define each of the Factory Methods to + * make the right objects, which all "vary" together. + */ class URL_Visitor_Factory { - // = TITLE - // Abstract base class that creates URL visitors. - // - // = DESCRIPTION - // Subclasses define each of the Factory Methods to - // make the right objects, which all "vary" together. public: /// Destructor. virtual ~URL_Visitor_Factory (void); + /// Factory Method that makes the appropriate type of <URL_Visitor>. virtual URL_Visitor *make_visitor (void) = 0; - // Factory Method that makes the appropriate type of <URL_Visitor>. + /// Factory Method that makes the appropriate type of + /// <Command_Processor>. virtual Command_Processor *make_command_processor (void) = 0; - // Factory Method that makes the appropriate type of - // <Command_Processor>. }; +/** + * @class URL_Validation_Visitor_Factory + * + * @brief Create a URL visitor that validates URL links. + */ class URL_Validation_Visitor_Factory : public URL_Visitor_Factory { - // = TITLE - // Create a URL visitor that validates URL links. public: + /// Factory Method that makes a <URL_Validation_Visitor>. virtual URL_Visitor *make_visitor (void); - // Factory Method that makes a <URL_Validation_Visitor>. + /// Factory Method that makes a <FIFO_Command_Processor>. virtual Command_Processor *make_command_processor (void); - // Factory Method that makes a <FIFO_Command_Processor>. }; +/** + * @class URL_Download_Visitor_Factory + * + * @brief Create a URL visitor that downloads URL links. + */ class URL_Download_Visitor_Factory : public URL_Visitor_Factory { - // = TITLE - // Create a URL visitor that downloads URL links. public: + /// Factory Method that makes a <URL_Download_Visitor>. virtual URL_Visitor *make_visitor (void); - // Factory Method that makes a <URL_Download_Visitor>. + /// Factory Method that makes a <FIFO_Command_Processor>. virtual Command_Processor *make_command_processor (void); - // Factory Method that makes a <FIFO_Command_Processor>. }; #endif /* _URL_VISITOR_FACTORY_H */ diff --git a/ACE/examples/Web_Crawler/Web_Crawler.h b/ACE/examples/Web_Crawler/Web_Crawler.h index 01e275e2187..6c80d20bc95 100644 --- a/ACE/examples/Web_Crawler/Web_Crawler.h +++ b/ACE/examples/Web_Crawler/Web_Crawler.h @@ -1,18 +1,15 @@ /* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// examples/Web_Crawler -// -// = FILENAME -// Web_Crawler.h -// -// = AUTHOR -// Douglas C. Schmidt <schmidt@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file Web_Crawler.h + * + * $Id$ + * + * @author Douglas C. Schmidt <schmidt@cs.wustl.edu> + */ +//============================================================================= + #ifndef _WEB_CRAWLER_H #define _WEB_CRAWLER_H @@ -27,36 +24,40 @@ // Forward declaration. class URL_Visitor_Factory; +/** + * @class Web_Crawler + * + * @brief An abstraction for a Web Crawler. + * + * This class is a Facade that organizes the other classes in the + * solution, which include a factory that creates a visitor, + * which in turn embodies the appropriate visitation strategy. + */ class Web_Crawler { - // = TITLE - // An abstraction for a Web Crawler. - // - // = DESCRIPTION - // This class is a Facade that organizes the other classes in the - // solution, which include a factory that creates a visitor, - // which in turn embodies the appropriate visitation strategy. public: // = Initialization and termination methods. + /// Constructor. Web_Crawler (void); - // Constructor. + /// Destructor. ~Web_Crawler (void); - // Destructor. + /// Parses the command-line options and initializes the + /// <URL_Visitor_Factory>. int open (int argc, ACE_TCHAR *argv[]); - // Parses the command-line options and initializes the - // <URL_Visitor_Factory>. + /// Run the Web Crawler and carries out whatever visitation strategy + /// is configured. Returns -1 on failure and 0 on success. int run (void); - // Run the Web Crawler and carries out whatever visitation strategy - // is configured. Returns -1 on failure and 0 on success. private: + /** + * Pointer to a factory that creates visitors that explore URLs and + * perform various tasks. Subclasses of <URL_Visitor_Factory> + * determine what happens during a visitation. + */ URL_Visitor_Factory *url_visitor_factory_; - // Pointer to a factory that creates visitors that explore URLs and - // perform various tasks. Subclasses of <URL_Visitor_Factory> - // determine what happens during a visitation. }; #endif /* _WEB_CRAWLER_H */ diff --git a/ACE/examples/Web_Crawler/main.cpp b/ACE/examples/Web_Crawler/main.cpp index 93d3674d011..6509858bea6 100644 --- a/ACE/examples/Web_Crawler/main.cpp +++ b/ACE/examples/Web_Crawler/main.cpp @@ -1,21 +1,18 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// examples/Web_Crawler -// -// = FILENAME -// main.cpp -// -// = DESCRIPTION -// This program implements a Web crawler that can be configured to -// apply various strategies to URLs that it visits. -// -// = AUTHOR -// Doug Schmidt <schmidt@cs.wustl.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file main.cpp + * + * $Id$ + * + * This program implements a Web crawler that can be configured to + * apply various strategies to URLs that it visits. + * + * + * @author Doug Schmidt <schmidt@cs.wustl.edu> + */ +//============================================================================= + #include "ace/OS_main.h" #include "ace/Signal.h" |