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

//=============================================================================
/**
 *  @file    Object_T.h
 *
 *  $Id$
 *
 *   Templatized utilities common to all IDL interfaces.
 *
 *  @author  Jeff Parsons <j.parsons@vanderbilt.edu>
 */
//=============================================================================

#ifndef TAO_CORBA_OBJECT_T_H
#define TAO_CORBA_OBJECT_T_H

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

#include "ace/CORBA_macros.h"

namespace CORBA
{
  class Object;
  typedef Object *Object_ptr;

  class AbstractBase;
  typedef AbstractBase *AbstractBase_ptr;
}

namespace TAO
{
  class Collocation_Proxy_Broker;

  typedef
    Collocation_Proxy_Broker * (* Proxy_Broker_Factory)(CORBA::Object_ptr);

  template<typename T>
  class Narrow_Utils
  {
  public:
    typedef T *T_ptr;

    static T_ptr narrow (CORBA::Object_ptr,
                         const char *repo_id,
                         Proxy_Broker_Factory
                         ACE_ENV_ARG_DECL);

    static T_ptr narrow (CORBA::AbstractBase_ptr,
                         const char *repo_id,
                         Proxy_Broker_Factory
                         ACE_ENV_ARG_DECL);

    // Version used the operators.
    static T_ptr unchecked_narrow (CORBA::Object_ptr,
                                   Proxy_Broker_Factory);

    static T_ptr unchecked_narrow (CORBA::Object_ptr,
                                   const char *repo_id,
                                   Proxy_Broker_Factory
                                   ACE_ENV_ARG_DECL);

    // static T_ptr unchecked_narrow (CORBA::AbstractBase_ptr,
    //                              Proxy_Broker_Factory);
  private:
    // Code for lazily evaluated IORs.
    static T_ptr lazy_evaluation (CORBA::Object_ptr);
  };
}

#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
#include "tao/Object_T.cpp"
#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */

#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
#pragma implementation ("Object_T.cpp")
#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */

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

#endif /* TAO_CORBA_OBJECT_T_H */