Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / Utils / RIR_Narrow.h
blobddaa3c9348710db1c8a8a021ae2cff790c787b3e
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file RIR_Narrow.h
7 * @author Carlos O'Ryan <coryan@atdesk.com>
8 */
9 //=============================================================================
11 #ifndef TAO_UTILS_RIR_NARROW_H
12 #define TAO_UTILS_RIR_NARROW_H
14 #include /**/ "ace/pre.h"
16 #include "ace/config-all.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 # pragma once
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 #include "tao/PI/PI.h"
23 #include "tao/ORB.h"
25 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
27 namespace TAO
29 namespace Utils
31 /**
32 * @class RIR_Narrow
34 * @brief Helper class to obtain an initial reference and narrow it
35 * to the proper object reference.
37 template<class T> class RIR_Narrow
39 public:
40 typedef typename T::_ptr_type _ptr_type;
41 typedef typename T::_var_type _var_type;
43 /// Use resolve_initial_references to find an object and then
44 /// narrow it.
45 static _ptr_type narrow (CORBA::ORB_ptr orb, char const * id);
47 /// Use resolve_initial_references to find an object and then
48 /// narrow it.
49 static _ptr_type narrow (PortableInterceptor::ORBInitInfo_ptr orb,
50 char const * id);
52 private:
53 static _ptr_type narrow_object (CORBA::Object_ptr object);
55 } // namespace Utils
56 } // namespace TAO
59 TAO_END_VERSIONED_NAMESPACE_DECL
61 #include "tao/Utils/RIR_Narrow.cpp"
63 #include /**/ "ace/post.h"
65 #endif /*TAO_UTILS_RIR_NARROW_H*/