summaryrefslogtreecommitdiff
path: root/ACE/tests/MEM_Stream_Test.h
blob: 990fdd4645e63ddc18d8e541ee98929543f110eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/* -*- C++ -*- */

//=============================================================================
/**
 *  @file    MEM_Stream_Test.h
 *
 * This file has the class definitions needed for template generation in
 * MEM_Stream_Test.cpp.
 *
 *  @author Steve Huston <shuston@riverace.com>
 */
//=============================================================================


#ifndef ACE_TESTS_MEM_STREAM_TEST_H
#define ACE_TESTS_MEM_STREAM_TEST_H

#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

#include "ace/MEM_Stream.h"
#include "ace/Reactor.h"
#include "ace/Svc_Handler.h"
#include "ace/Synch_Traits.h"

#if (ACE_HAS_POSITION_INDEPENDENT_POINTERS == 1)

/**
 * @class Echo_Handler
 *
 * @brief Simple class for reading in the data and then sending it back
 */
class Echo_Handler : public ACE_Svc_Handler<ACE_MEM_STREAM, ACE_SYNCH>
{
public:
  /// The Svc_Handler callbacks.
  Echo_Handler (ACE_Thread_Manager *thr_mgr = 0);
  virtual int open (void *);
  static void reset_handler ();
  virtual int handle_input (ACE_HANDLE h);
  virtual int handle_close (ACE_HANDLE handle,
                            ACE_Reactor_Mask close_mask);
  virtual int svc ();

private:
  ACE_TCHAR name_[MAXPATHLEN];
  u_short connection_;
};

#endif /* ACE_HAS_POSITION_INDEPENDENT_POINTERS */

#endif /* ACE_TESTS_MEM_STREAM_TEST_H */