3 //=============================================================================
5 * @file Command_Processor.h
7 * @author Douglas C. Schmidt <d.schmidt@vanderbilt.edu>
9 //=============================================================================
12 #ifndef _COMMAND_PROCESSOR_H
13 #define _COMMAND_PROCESSOR_H
15 #if !defined (ACE_LACKS_PRAGMA_ONCE)
17 #endif /* ACE_LACKS_PRAGMA_ONCE */
19 #include "ace/Containers.h"
28 * @brief Abstract base class for a command.
30 * Each command is executed by a <Command_Processor>.
35 /// Virtual destructor.
38 /// This is the entry point to execute the command.
39 virtual int execute () = 0;
40 virtual int destroy () = 0;
46 * @brief Defines an API for executing a command on a URL.
48 * Each command is executed by a <Command_Processor>.
50 class URL_Command
: public Command
56 /// Execute the URL command.
57 virtual int execute ();
62 /// Pointer to the URL.
67 * @class Command_Processor
69 * @brief Execute commands that are passed to it.
71 * This class implements the Command Processor pattern.
73 class Command_Processor
78 /// Insert a new <Command> into the <Command_Processor>'s queue.
79 int insert (Command
*);
81 /// Execute all the <Commands> in the queue.
84 /// Destroy the <Command_Processor>.
88 /// Ensure dynamic allocation.
89 ~Command_Processor ();
92 // @@ You fill in here...
93 ACE_Unbounded_Queue
<Command
*> url_queue_
;
97 #endif /* _COMMAND_PROCESSOR_H */