commandstream.h

来自「最新的版本ACE-5.6.8,刚从外文网上搬下,与大家分享.」· C头文件 代码 · 共 45 行

H
45
字号
/* -*- C++ -*- */
// $Id: CommandStream.h 80826 2008-03-04 14:51:23Z wotte $

#ifndef COMMAND_STREAM_H
#define COMMAND_STREAM_H

#include "ace/Module.h"
#include "ace/Stream.h"
#include "ace/SOCK_Stream.h"
#include "ace/Synch_Traits.h"

#include "Command.h"

// A CommandStream is a bidirectional ACE_Stream implementing a chain
// of commands. A message will move down the stream until a
// CommandModule is capable of processing it. After processing, it
// will move on down the stream to the end. Data received from the
// tail will likewise move up the stream until the downstream's
// partner module is encoutered. The retrieved data will be processed
// and continue on up the stream.

// Listing 01 code/ch18
class CommandStream : public ACE_Stream<ACE_MT_SYNCH>
{
public:
  typedef ACE_Stream<ACE_MT_SYNCH> inherited;

  CommandStream (ACE_SOCK_Stream *peer)
    : inherited (), peer_(peer) { }

  virtual int open (void *arg,
                    ACE_Module<ACE_MT_SYNCH> *head = 0,
                    ACE_Module<ACE_MT_SYNCH> *tail = 0);

  Command *execute (Command *command);

private:
  CommandStream () { }

  ACE_SOCK_Stream *peer_;
};
// Listing 01

#endif /* COMMAND_STREAM_H */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?