Use =default for skeleton copy constructor
[ACE_TAO.git] / ACE / examples / Connection / blocking / SPIPE-connector.h
blob13954529c8ccbe3ada60c6f930ed8ac2e22c4527
1 /* -*- C++ -*- */
2 #ifndef SP_CONNECTOR_H
3 #define SP_CONNECTOR_H
5 #include "ace/Svc_Handler.h"
6 #include "ace/Service_Config.h"
8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
12 #include "ace/SPIPE_Stream.h"
13 #include "ace/Connector.h"
14 #include "ace/SPIPE_Connector.h"
15 #include "ace/Sig_Adapter.h"
17 class Peer_Handler : public ACE_Svc_Handler<ACE_SPIPE_STREAM, ACE_NULL_SYNCH>
19 public:
20 // = Initialization
22 Peer_Handler (int iterations = 0);
23 // <iterations> is the number of buffers to send. If <iterations>
24 // == 0, then read from stdin.
26 ~Peer_Handler ();
28 virtual int open (void * = 0);
29 // Activate the handler when connection is established.
31 // = Demultiplexing hooks.
32 virtual int handle_input (ACE_HANDLE);
33 virtual int handle_close (ACE_HANDLE handle = ACE_INVALID_HANDLE,
34 ACE_Reactor_Mask mask = ACE_Event_Handler::ALL_EVENTS_MASK);
36 virtual ACE_HANDLE get_handle () const;
38 private:
39 void display_menu ();
41 int iterations_;
42 // No. of buffers to send.
45 class IPC_Client : public ACE_Connector<Peer_Handler, ACE_SPIPE_CONNECTOR>
47 public:
48 // Initialization
49 IPC_Client ();
50 ~IPC_Client ();
52 // = Dynamic linking hooks.
53 virtual int init (int argc, ACE_TCHAR *argv[]);
54 // Initialize the IPC client.
56 virtual int fini ();
57 // Destroy the IPC client.
59 virtual int svc ();
60 // Run the svc.
62 virtual int handle_close (ACE_HANDLE, ACE_Reactor_Mask);
63 // Report connection errors.
65 private:
66 int parse_args (int argc, ACE_TCHAR *argv[]);
67 // Parse command-line arguments.
69 int iterations_;
70 // Number of times to send a buffer.
72 ACE_TCHAR rendezvous_[MAXPATHLEN + 1];
73 // Meeting place for pipe.
75 ACE_Sig_Adapter done_handler_;
76 // Keeps track of when we shut down due to receipt of the SIGINT
77 // signal.
80 #endif /* SP_CONNECTOR_H */