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
|
// -*- C++ -*-
//=============================================================================
/**
* @file objref_typecode.cpp
*
* $Id$
*
* Object reference TypeCode generation visitor.
*
* @author Ossama Othman <ossama@dre.vanderbilt.edu>
*/
//=============================================================================
TAO::be_visitor_objref_typecode::be_visitor_objref_typecode (
be_visitor_context * ctx)
: be_visitor_typecode_defn (ctx)
{
}
int
TAO::be_visitor_objref_typecode::visit_interface (be_interface * node)
{
static char const abstract_interface[] = "abstract_interface";
static char const component[] = "component";
static char const home[] = "home";
static char const local_interface[] = "local_interface";
static char const objref[] = "objref";
char const * kind = 0;
if (dynamic_cast<be_component *> (node))
kind = component;
else if (dynamic_cast<be_home *> (node))
kind = home;
else if (node->is_abstract ())
kind = abstract_interface;
else if (node->is_local ())
kind = local_interface;
else
kind = objref;
return this->visit_i (kind,
node->flat_name (),
node->repoID (),
node->original_local_name ()->get_string (),
node);
}
int
TAO::be_visitor_objref_typecode::visit_native (be_native * /* node */)
{
return 0;
// return this->visit_i ("native",
// ,
// ,
// ,
// node);
}
int
TAO::be_visitor_objref_typecode::visit_i (char const * kind,
char const * flat_name,
char const * repository_id,
char const * original_local_name,
be_type * node)
{
TAO_OutStream & os = *this->ctx_->stream ();
os << be_nl << be_nl
<< "// TAO_IDL - Generated from" << be_nl
<< "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
// Generate the TypeCode instantiation.
os
<< "static TAO::TypeCode::Objref<char const *," << be_nl
<< " CORBA::tk_" << kind << "," << be_nl
<< " TAO::Null_RefCount_Policy> const"
<< be_idt_nl
<< "_tao_tc_" << flat_name << " (" << be_idt_nl
<< "\"" << repository_id << "\"," << be_nl
<< "\"" << original_local_name << "\");" << be_uidt_nl
<< be_uidt_nl;
return this->gen_typecode_ptr (node);
}
|