summaryrefslogtreecommitdiff
path: root/TAO/tests/ORT/ObjectReferenceFactory.h
blob: 2b487101520c2063d4f6cdeb2792ad5cdc8746d4 (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
// -*- C++ -*-

//=============================================================================
/**
 * @file ObjectReferenceFactory.h
 *
 * $Id$

 * @author Ossama Othman <ossama@uci.edu>
 */
//=============================================================================


#ifndef TAO_OBJECT_REFERENCE_FACTORY_H
#define TAO_OBJECT_REFERENCE_FACTORY_H

#include "ObjectReferenceFactoryC.h"

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

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


/**
 * @class ObjectReferenceFactory
 *
 * @brief Implementation of the PortableInterceptor::ObjectReferenceFactory
 *        interface.
 *
 * This ObjectReferenceFactory creates simply delegates all tasks on
 * to the old ObjectReferenceFactory.  It merely exists to test the
 * @c IORInfo::current_factory attribute internals.
 */
class ObjectReferenceFactory
  : public virtual CORBA::DefaultValueRefCountBase
  , public virtual OBV_ORT_Test::ObjectReferenceFactory
{
 public:

  /// Constructor
  ObjectReferenceFactory (
    PortableInterceptor::ObjectReferenceFactory * old_orf);

  /**
   * @name PortableInterceptor::ObjectReferenceFactory Methods
   *
   * Methods required by the
   * PortableInterceptor::ObjectReferenceFactory interface.
   */
  //@{
  virtual CORBA::Object_ptr make_object (
      const char *repository_id,
      const PortableInterceptor::ObjectId & id
      ACE_ENV_ARG_DECL_WITH_DEFAULTS);
  //@}

protected:

  /// Destructor
  /**
   * Protected destructor to enforce proper memory management via
   * reference counting.
   */
  ~ObjectReferenceFactory (void);

private:

  /// The old ObjectReferenceFactory used to create object references.
  /**
   * This ObjectReferenceFactory will still be used when creating
   * object references.  However, it will be invoked through this
   * ObjectReferenceFactory.
   */
  PortableInterceptor::ObjectReferenceFactory_var old_orf_;

};


#if defined (_MSC_VER) && (_MSC_VER >= 1200)
#pragma warning(pop)
#endif /* _MSC_VER */

#endif  /* TAO_OBJECT_REFERENCE_FACTORY_H */