Merge pull request #2216 from jwillemsen/jwi-cxxversionchecks
[ACE_TAO.git] / ACE / examples / APG / Streams / CommandStream.h
blobbaa093e544b9aede459b64f170309d0cd306037a
1 /* -*- C++ -*- */
2 #ifndef COMMAND_STREAM_H
3 #define COMMAND_STREAM_H
5 #include "ace/Module.h"
6 #include "ace/Stream.h"
7 #include "ace/SOCK_Stream.h"
8 #include "ace/Synch_Traits.h"
10 #include "Command.h"
12 // A CommandStream is a bidirectional ACE_Stream implementing a chain
13 // of commands. A message will move down the stream until a
14 // CommandModule is capable of processing it. After processing, it
15 // will move on down the stream to the end. Data received from the
16 // tail will likewise move up the stream until the downstream's
17 // partner module is encoutered. The retrieved data will be processed
18 // and continue on up the stream.
20 // Listing 01 code/ch18
21 class CommandStream : public ACE_Stream<ACE_MT_SYNCH>
23 public:
24 typedef ACE_Stream<ACE_MT_SYNCH> inherited;
26 CommandStream (ACE_SOCK_Stream *peer)
27 : inherited (), peer_(peer) { }
29 virtual int open (void *arg,
30 ACE_Module<ACE_MT_SYNCH> *head = 0,
31 ACE_Module<ACE_MT_SYNCH> *tail = 0);
33 Command *execute (Command *command);
35 private:
36 CommandStream () { }
38 ACE_SOCK_Stream *peer_;
40 // Listing 01
42 #endif /* COMMAND_STREAM_H */