summaryrefslogtreecommitdiff
path: root/trunk/TAO/orbsvcs/orbsvcs/IFRService/Contained_i.h
blob: ec017de342d60efed1b39357213531bef8be852e (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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
// -*- C++ -*-


//=============================================================================
/**
 *  @file    Contained_i.h
 *
 *  $Id$
 *
 *  Contained servant class.
 *
 *
 *  @author Jeff Parsons <parsons@cs.wustl.edu>
 */
//=============================================================================


#ifndef TAO_CONTAINED_I_H
#define TAO_CONTAINED_I_H

#include "orbsvcs/IFRService/IRObject_i.h"
#include "orbsvcs/IFRService/ifr_service_export.h"

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

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

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

/**
 * @class TAO_Contained_i
 *
 * @brief TAO_Contained_i
 *
 * Abstract base class for all IR objects that are contained
 * by other IR objects.
 */
class TAO_IFRService_Export TAO_Contained_i : public virtual TAO_IRObject_i
{
public:
  /// Constructor.
  TAO_Contained_i (TAO_Repository_i *repo);

  /// Destructor.
  virtual ~TAO_Contained_i (void);

  /// Remove the repository entry.
  virtual void destroy (
    );

  virtual void destroy_i (
    );

  virtual char *id (
    );

  char *id_i (
    );

  virtual void id (
      const char *id
    );

  void id_i (
      const char *id
    );

  virtual char *name (
    );

  char *name_i (
    );

  virtual void name (
      const char *name
    );

  void name_i (
      const char *name
    );

  virtual char *version (
    );

  char *version_i (
    );

  virtual void version (
      const char *version
    );

  void version_i (
      const char *version
    );

  virtual CORBA::Container_ptr defined_in (
    );

  CORBA::Container_ptr defined_in_i (
    );

  virtual char *absolute_name (
    );

  char *absolute_name_i (
    );

  virtual CORBA::Repository_ptr containing_repository (
    );

  virtual CORBA::Contained::Description *describe (
    );

  virtual CORBA::Contained::Description *describe_i ();

  virtual void move (
      CORBA::Container_ptr new_container,
      const char *new_name,
      const char *new_version
    );

  /// Called from TAO_IFR_Service_Utils::name_exists.
  static int same_as_tmp_name (const char *name);

protected:
  /**
   * Engine for move() with an extra 'cleanup'
   * parameter. Since a section removal can be
   * recursive, this need be done only at the top
   * level.
   */
  void move_i (
      CORBA::Container_ptr new_container,
      const char *new_name,
      const char *new_version,
      CORBA::Boolean cleanup
    );

private:
  /// Check if <name> already exists in our container
  CORBA::Boolean name_exists (
      const char *name
    );

  /// Recursively update the scoped name of our contents.
  void contents_name_update (
      ACE_TString stem,
      ACE_Configuration_Section_Key key
    );

  /**
   * Mangle the names of references that are also
   * defined in the scope, so a name clash will
   * not occur when create_* is called. Create_*
   * unmangles the names.
   */
  void move_pre_process (
      CORBA::Container_ptr container,
      const char *contained_path,
      const char *name
    );

  /**
   * Recursively calls move_i for definitions,
   * as well as operations and attributes if
   * applicable.
   */
  void move_contents (
      CORBA::Container_ptr new_container
    );

private:
  static const char *tmp_name_holder_;
};

TAO_END_VERSIONED_NAMESPACE_DECL


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

#endif /* TAO_CONTAINED_I_H */