summaryrefslogtreecommitdiff
path: root/TAO/tests/DIOP/UDP_i.h
blob: 110e4385d634bb25f5be9da817abd298ab3301a2 (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
54
55
56
57
58
59
60
// -*- C++ -*-

//=============================================================================
/**
 *  @file    UDP_i.h
 *
 *  This class implements the server functionality of the UDP test.
 *  We support only single threaded servers, as we have a null mutex
 *  for locking our state.
 *
 *  @author Michael Kircher <Michael.Kircher@mchp.siemens.de>
 */
//=============================================================================


#ifndef UDP_I_H
#define UDP_I_H

#include "UDPS.h"
#include "ace/Hash_Map_Manager.h"
#include "ace/Null_Mutex.h"

/**
 * @class UDP_i:
 *
 * @brief UDP Object Implementation
 *
 * This class implements the UDP object, which accepts two methods.
 * The first, <invoke> accepts a string identifying the client
 * and a request_id so that the server can verify if the requests
 * arrived in order.
 */
class UDP_i: public POA_UDP
{
public:
  /// Constructor
  UDP_i (CORBA::ORB_ptr o);

  /// Destructor
  ~UDP_i (void);

  virtual void invoke (const char *client_name,
                       UDP_ptr udpHandler,
                       CORBA::Long request_id);

  /// Shutdown the server.
  virtual void shutdown (void);

private:
  /// ORB pointer.
  CORBA::ORB_var orb_;

  ACE_Hash_Map_Manager_Ex < CORBA::String_var,
                            CORBA::Long,
                            ACE_Hash < const char * >,
                            ACE_Equal_To < const char * >,
                            ACE_Null_Mutex > request_id_table_;
};

#endif /* UDP_I_H */