summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/PortableGroup/POA_Hooks.h
blob: a5468f224ab016da02cdb253855f58c57a4c0f84 (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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
// -*- C++ -*-

//=============================================================================
/**
 *  @file   POA_Hooks.h
 *
 *  $Id$
 *
 *  @author Frank Hunleth <fhunleth@cs.wustl.edu>
 */
//=============================================================================

#ifndef TAO_POA_HOOKS_H
#define TAO_POA_HOOKS_H

#include /**/ "ace/pre.h"

#include "tao/PortableServer/PortableGroup_Hooks.h"

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

#include "portablegroup_export.h"

#include "orbsvcs/orbsvcs/PortableGroupC.h"

// Forward references
class PortableGroup_Request_Dispatcher;
class TAO_PortableGroup_Loader;
class TAO_Profile;
class TAO_PortableGroup_Acceptor_Registry;

/**
 * @class TAO_POA_Hooks
 *
 * @brief TAO_POA_Hooks
 *
 * This class acts as a facade for all of the POA specific methods in the
 * PortableGroup library.
 */
class TAO_PortableGroup_Export TAO_POA_Hooks :
  public TAO_POA_PortableGroup_Hooks
{
public:
  TAO_POA_Hooks (PortableGroup_Request_Dispatcher &request_dispatcher);

  virtual ~TAO_POA_Hooks (void);

#if (TAO_HAS_MINIMUM_POA == 0)

  virtual PortableServer::ObjectId * create_id_for_reference (
      TAO_POA &the_poa,
      CORBA::Object_ptr the_ref
      ACE_ENV_ARG_DECL_WITH_DEFAULTS
    )
    ACE_THROW_SPEC ((
      CORBA::SystemException,
      PortableServer::NotAGroupObject
    ));

  virtual PortableServer::IDs * reference_to_ids (
      TAO_POA &the_poa,
      CORBA::Object_ptr the_ref
      ACE_ENV_ARG_DECL_WITH_DEFAULTS
    )
    ACE_THROW_SPEC ((
      CORBA::SystemException,
      PortableServer::NotAGroupObject
    ));

  virtual void associate_reference_with_id (
      TAO_POA &the_poa,
      CORBA::Object_ptr ref,
      const PortableServer::ObjectId & oid
      ACE_ENV_ARG_DECL_WITH_DEFAULTS
    )
    ACE_THROW_SPEC ((
      CORBA::SystemException,
      PortableServer::NotAGroupObject
    ));

  virtual void disassociate_reference_with_id (
      TAO_POA &the_poa,
      CORBA::Object_ptr ref,
      const PortableServer::ObjectId & oid
      ACE_ENV_ARG_DECL_WITH_DEFAULTS
    )
    ACE_THROW_SPEC ((
      CORBA::SystemException,
      PortableServer::NotAGroupObject
    ));

#endif  /* TAO_HAS_MINIMUM_POA == 0 */

protected:

#if (TAO_HAS_MINIMUM_POA == 0)

  int find_group_component (const CORBA::Object_ptr the_ref,
                            PortableGroup::TagGroupTaggedComponent &group);

  int find_group_component_in_profile (
      const TAO_Profile* profile,
      PortableGroup::TagGroupTaggedComponent &group
    );

  int create_group_acceptors (
      CORBA::Object_ptr the_ref,
      TAO_PortableGroup_Acceptor_Registry &acceptor_registry,
      TAO_ORB_Core &orb_core
      ACE_ENV_ARG_DECL
    );

  /// Helper function to associate group references with
  /// object references.
  void associate_group_with_ref (
        TAO_POA &the_poa,
        CORBA::Object_ptr group_ref,
        CORBA::Object_ptr obj_ref
        ACE_ENV_ARG_DECL)
      ACE_THROW_SPEC ((CORBA::SystemException,
                       PortableServer::NotAGroupObject));

#endif  /* TAO_HAS_MINIMUM_POA == 0 */

private:

  PortableGroup_Request_Dispatcher &request_dispatcher_;

};

#include /**/ "ace/post.h"

#endif /* TAO_POA_HOOKS_H */