~ubuntu-branches/ubuntu/breezy/ace/breezy

« back to all changes in this revision

Viewing changes to TAO/TAO_IDL/be/be_visitor_structure/any_op_ch.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad, Benjamin Montgomery, Adam Conrad
  • Date: 2005-09-18 22:51:38 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 sarge) (0.1.2 woody)
  • Revision ID: james.westby@ubuntu.com-20050918225138-seav22q6fyylb536
Tags: 5.4.7-3ubuntu1
[ Benjamin Montgomery ]
* Added a patch for amd64 and powerpc that disables the compiler
  option -fvisibility-inlines-hidden

[ Adam Conrad ]
* Added DPATCH_OPTION_CPP=1 to debian/patches/00options to make
  Benjamin's above changes work correctly with dpatch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
//
2
 
// any_op_ch.cpp,v 1.12 2002/09/25 16:25:37 parsons Exp
3
 
//
4
 
 
5
 
// ============================================================================
6
 
//
7
 
// = LIBRARY
8
 
//    TAO IDL
9
 
//
10
 
// = FILENAME
11
 
//    any_op_ch.cpp
12
 
//
13
 
// = DESCRIPTION
14
 
//    Visitor generating code for Any operators for structures
15
 
//
16
 
// = AUTHOR
17
 
//    Aniruddha Gokhale
18
 
//
19
 
// ============================================================================
20
 
 
21
 
ACE_RCSID (be_visitor_structure, 
22
 
           any_op_ch, 
23
 
           "any_op_ch.cpp,v 1.12 2002/09/25 16:25:37 parsons Exp")
24
 
 
25
 
// ***************************************************************************
26
 
// Structure visitor for generating Any operator declarations in the client header
27
 
// ***************************************************************************
28
 
 
29
 
be_visitor_structure_any_op_ch::be_visitor_structure_any_op_ch (
30
 
    be_visitor_context *ctx
31
 
  )
32
 
  : be_visitor_structure (ctx)
33
 
{
34
 
}
35
 
 
36
 
be_visitor_structure_any_op_ch::~be_visitor_structure_any_op_ch (void)
37
 
{
38
 
}
39
 
 
40
 
int
41
 
be_visitor_structure_any_op_ch::visit_structure (be_structure *node)
42
 
{
43
 
  if (node->cli_hdr_any_op_gen ()
44
 
      || node->imported ())
45
 
    {
46
 
      return 0;
47
 
    }
48
 
 
49
 
  TAO_OutStream *os = this->ctx_->stream ();
50
 
 
51
 
  *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
52
 
      << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
53
 
 
54
 
  *os << be_global->stub_export_macro () << " void"
55
 
      << " operator<<= (CORBA::Any &, const " << node->name ()
56
 
      << " &); // copying version" << be_nl;
57
 
  *os << be_global->stub_export_macro () << " void"
58
 
      << " operator<<= (CORBA::Any &, " << node->name ()
59
 
      << "*); // noncopying version" << be_nl;
60
 
  *os << be_global->stub_export_macro () << " CORBA::Boolean"
61
 
      << " operator>>= (const CORBA::Any &, "
62
 
      << node->name () << " *&); // deprecated\n";
63
 
  *os << be_global->stub_export_macro () << " CORBA::Boolean"
64
 
      << " operator>>= (const CORBA::Any &, const "
65
 
      << node->name () << " *&);";
66
 
 
67
 
 
68
 
  // All we have to do is to visit the scope and generate code.
69
 
  if (this->visit_scope (node) == -1)
70
 
    {
71
 
      ACE_ERROR_RETURN ((LM_ERROR,
72
 
                         "(%N:%l) be_visitor_structure::visit_structure - "
73
 
                         "codegen for scope failed\n"), 
74
 
                        -1);
75
 
    }
76
 
 
77
 
  node->cli_hdr_any_op_gen (1);
78
 
  return 0;
79
 
}
80
 
 
81
 
int
82
 
be_visitor_structure_any_op_ch::visit_field (be_field *node)
83
 
{
84
 
  be_type *bt;
85
 
 
86
 
  // First generate the type information.
87
 
  bt = be_type::narrow_from_decl (node->field_type ());
88
 
 
89
 
  if (!bt)
90
 
    {
91
 
      ACE_ERROR_RETURN ((LM_ERROR,
92
 
                         "(%N:%l) be_visitor_structure_any_op_ch::"
93
 
                         "visit_field - "
94
 
                         "Bad field type\n"), 
95
 
                        -1);
96
 
    }
97
 
 
98
 
  if (bt->accept (this) == -1)
99
 
    {
100
 
      ACE_ERROR_RETURN ((LM_ERROR,
101
 
                         "(%N:%l) be_visitor_structure_any_op_ch::"
102
 
                         "visit_field - "
103
 
                         "codegen for field type failed\n"), 
104
 
                        -1);
105
 
    }
106
 
 
107
 
  return 0;
108
 
}
109
 
 
110
 
int
111
 
be_visitor_structure_any_op_ch::visit_union (be_union *node)
112
 
{
113
 
  if (node->cli_hdr_any_op_gen ()
114
 
      || node->imported ())
115
 
    {
116
 
      return 0;
117
 
    }
118
 
 
119
 
  be_visitor_union_any_op_ch visitor (this->ctx_);
120
 
 
121
 
  if (node->accept (&visitor) == -1)
122
 
    {
123
 
      ACE_ERROR_RETURN ((LM_ERROR,
124
 
                         "(%N:%l) be_visitor_structure_any_op_ch::"
125
 
                         "visit_union - "
126
 
                         "codegen for field type failed\n"), 
127
 
                        -1);
128
 
    }
129
 
 
130
 
  return 0;
131
 
}
132
 
 
133
 
int
134
 
be_visitor_structure_any_op_ch::visit_enum (be_enum *node)
135
 
{
136
 
  if (node->cli_hdr_any_op_gen ()
137
 
      || node->imported ())
138
 
    {
139
 
      return 0;
140
 
    }
141
 
 
142
 
  be_visitor_enum_any_op_ch visitor (this->ctx_);
143
 
 
144
 
  if (node->accept (&visitor) == -1)
145
 
    {
146
 
      ACE_ERROR_RETURN ((LM_ERROR,
147
 
                         "(%N:%l) be_visitor_structure_any_op_ch::"
148
 
                         "visit_enum - "
149
 
                         "codegen for field type failed\n"), 
150
 
                        -1);
151
 
    }
152
 
 
153
 
  return 0;
154
 
}
155