summaryrefslogtreecommitdiff
path: root/TAO/tao/PolicyFactory_Registry_Adapter.h
blob: e359b8048719c72badf5ebc70863b44014eaf42c (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
// -*- C++ -*-

// ===================================================================
/**
 *  @file   PolicyFactory_Registry_Adapter.h
 *
 *  @author Johnny Willemsen  <jwillemsen@remedy.nl>
 */
// ===================================================================

#ifndef TAO_POLICY_FACTORY_REGISTRY_ADAPTER_H
#define TAO_POLICY_FACTORY_REGISTRY_ADAPTER_H

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

#include /**/ "tao/TAO_Export.h"

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

#include "tao/Basic_Types.h"

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

//-- Forward Declarations--
namespace CORBA
{
  typedef ULong PolicyType;

  class Policy;
  typedef Policy *Policy_ptr;

  class Any;
}

namespace PortableInterceptor
{
  class PolicyFactory;
  typedef PolicyFactory *PolicyFactory_ptr;
}

namespace TAO
{
  /**
   * @class PolicyFactory_Registry_Adapter
   *
   * @brief ORB-specific PortableInterceptor::PolicyFactory registry.
   *
   * Class that offers an interface to the ORB to load and manipulate
   * PolicyFactory_Registry
   */
  class TAO_Export PolicyFactory_Registry_Adapter
  {
  public:
    virtual ~PolicyFactory_Registry_Adapter ();

    /// Register a PolicyFactory with the underlying PolicyFactory
    /// sequence.  This method should only be called during ORB
    /// initialization.
    virtual void register_policy_factory (
      CORBA::PolicyType type,
      PortableInterceptor::PolicyFactory_ptr policy_factory) = 0;

    /// Construct a policy of the given type with the information
    /// contained in the CORBA::Any @a value.
    virtual CORBA::Policy_ptr create_policy (CORBA::PolicyType type,
                                             const CORBA::Any &value) = 0;

    /// Create an empty policy, usually to be filled in later by
    /// demarshaling.
    virtual CORBA::Policy_ptr _create_policy (CORBA::PolicyType type) = 0;

    /// Check if a @c PolicyFactory corresponding to the given type,
    /// exists.
    virtual bool factory_exists (CORBA::PolicyType & type) const = 0;
  };
}

TAO_END_VERSIONED_NAMESPACE_DECL

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

#endif  /* TAO_POLICY_FACTORY_REGISTRY_ADAPTER_H */