summaryrefslogtreecommitdiff
path: root/ACE/TAO/tao/ZIOP/ZIOP_Stub.h
blob: 89de7e68aa0051b629b324a53427ed33e88c178c (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
// -*- C++ -*-

//=============================================================================
/**
 *  @file    ZIOP_Stub.h
 *
 *  $Id$
 *
 *  This file contains the declaration for the ZIOP Stub.
 *
 *  @author  Johnny Willemsen  <jwillemsen@remedy.nl>
 */
//=============================================================================

#ifndef TAO_ZIOP_STUB_H_
#define TAO_ZIOP_STUB_H_

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

#include "tao/orbconf.h"

#include "tao/ZIOP/ziop_export.h"

#include "tao/Stub.h"

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

#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

// Forward references.
namespace TAO
{
  class CompressorIdListPolicy;
  class CompressionEnablingPolicy;
}

/**
 * @class TAO_ZIOP_Stub
 *
 * This class represent a stub with extended functionality, which are needed
 * for ZIOPCORBA.
 */
class TAO_ZIOP_Export TAO_ZIOP_Stub : public TAO_Stub
{
public:

  TAO_ZIOP_Stub (const char *repository_id,
                 const TAO_MProfile &profiles,
                 TAO_ORB_Core *orb_core);

  virtual ~TAO_ZIOP_Stub (void);

  /**
   * Returns the effective policy if @a type is a known client-exposed
   * policy type.  Returns the effective override for all other policy
   * types.
   */
  CORBA::Policy_ptr get_policy (CORBA::PolicyType type);

  CORBA::Policy_ptr get_cached_policy (TAO_Cached_Policy_Type type);

private:

  /// Helper method used to parse the policies.
  void parse_policies (void);

  void exposed_compression_enabling_policy (CORBA::Policy_ptr policy);

  void exposed_compression_id_list_policy (CORBA::Policy_ptr policy);

  CORBA::Policy_ptr exposed_compression_enabling_policy (void);

  CORBA::Policy_ptr exposed_compression_id_list_policy (void);

  CORBA::Policy *effective_compression_enabling_policy (void);
  CORBA::Policy *effective_compression_id_list_policy (void);

  // The following attribute are used to cache
  // the different kind of policies and avoid to
  // parse the MProfile's policy list each time we
  // are asked about a given policy.

  CORBA::Policy_var compression_enabling_policy_;

  CORBA::Policy_var compression_id_list_policy_;

  CORBA::Boolean are_policies_parsed_;

private:
  // = Disallow copying and assignment.
  TAO_ZIOP_Stub (const TAO_ZIOP_Stub &);
  TAO_ZIOP_Stub &operator = (const TAO_ZIOP_Stub &);
};

TAO_END_VERSIONED_NAMESPACE_DECL

#endif

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

#endif /* TAO_ZIOP_STUB_FACTORY_H_ */