summaryrefslogtreecommitdiff
path: root/TAO/tests/POA/Bug_1592_Regression/ServantLocator.h
blob: 3ff37066256e62293463b4f30f52d7c2c703bfa0 (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// -*- C++ -*-

//=============================================================================
/**
 * @file ServantLocator.h
 *
 * $Id$
 *
 * Implementation header for the PortableServer::ServantLocator for
 * the PortableInterceptor / ServantLocator test.
 *
 * @author Ossama Othman <ossama@dre.vanderbilt.edu>
 */
//=============================================================================

#ifndef SERVANT_LOCATOR_H
#define SERVANT_LOCATOR_H

#include "ace/config-all.h"

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

#include "tao/PortableServer/PortableServer.h"
#include "tao/PortableServer/ServantLocatorC.h"
#include "tao/PortableServer/Servant_Base.h"
#include "tao/LocalObject.h"
#include "tao/ORB.h"

#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable:4250)
#endif /* _MSC_VER */

/**
 * @class ServantLocator
 *
 * @brief Test PortableServer::ServantLocator.
 *
 * PortableServer::ServantLocator used for this test.
 */
class ServantLocator
  : public virtual PortableServer::ServantLocator,
    public virtual TAO_Local_RefCounted_Object
{
public:

  /// Constructor.
  ServantLocator (CORBA::ORB_ptr orb);

  virtual PortableServer::Servant preinvoke (
      const PortableServer::ObjectId & oid,
      PortableServer::POA_ptr adapter,
      const char * operation,
      PortableServer::ServantLocator::Cookie & the_cookie);

  virtual void postinvoke (
      const PortableServer::ObjectId & oid,
      PortableServer::POA_ptr adapter,
      const char * operation,
      PortableServer::ServantLocator::Cookie the_cookie,
      PortableServer::Servant the_servant);

  bool error_status_;
protected:

  /// Destructor.
  ~ServantLocator (void);

private:

  /// Pseudo-reference to the ORB.
  CORBA::ORB_var orb_;

  /// Pointer to the test servant.
  PortableServer::ServantBase_var servant_;

};

#if defined(_MSC_VER)
#pragma warning(pop)
#endif /* _MSC_VER */

#endif  /* SERVANT_LOCATOR_H */