Changes to attempt to silence bcc64x
[ACE_TAO.git] / TAO / TAO_IDL / be / be_connector.cpp
blobfb1863a9759f15a13140645bf4181c904d1f6b7f
1 #include "be_connector.h"
2 #include "be_visitor.h"
3 #include "ast_module.h"
4 #include "ast_template_module_inst.h"
6 #include "utl_identifier.h"
8 be_connector::be_connector (
9 UTL_ScopedName *n,
10 AST_Connector *base_connector)
11 : COMMON_Base (false,
12 false),
13 AST_Decl (AST_Decl::NT_connector,
14 n),
15 AST_Type (AST_Decl::NT_connector,
16 n),
17 UTL_Scope (AST_Decl::NT_connector),
18 AST_Interface (n,
19 nullptr,
21 nullptr,
23 false,
24 false),
25 AST_Component (n,
26 base_connector,
27 nullptr,
29 nullptr,
30 0),
31 AST_Connector (n,
32 base_connector),
33 be_scope (AST_Decl::NT_connector),
34 be_decl (AST_Decl::NT_connector,
35 n),
36 be_type (AST_Decl::NT_connector,
37 n),
38 be_interface (n,
39 nullptr,
41 nullptr,
43 false,
44 false),
45 be_component (n,
46 base_connector,
47 nullptr,
49 nullptr,
50 0),
51 dds_connector_ (false),
52 ami_connector_ (false)
54 if (! this->imported ())
56 this->check_ancestors ();
60 be_connector::~be_connector ()
64 void
65 be_connector::destroy ()
67 this->AST_Connector::destroy ();
68 this->be_component::destroy ();
71 int
72 be_connector::accept (be_visitor *visitor)
74 return visitor->visit_connector (this);
77 bool
78 be_connector::dds_connector ()
80 return this->dds_connector_;
83 bool
84 be_connector::ami_connector ()
86 return this->ami_connector_;
89 void
90 be_connector::check_ancestors ()
92 AST_Connector *base = this;
94 while (base != nullptr)
96 const char *base_fname = base->full_name ();
98 if (ACE_OS::strcmp (base_fname, "CCM_DDS::DDS_Base") == 0)
100 this->dds_connector_ = true;
101 idl_global->dds_connector_seen_ = true;
102 break;
104 else if (ACE_OS::strcmp (base_fname, "CCM_AMI::AMI4CCM_Base") == 0)
106 this->ami_connector_ = true;
107 idl_global->ami_connector_seen_ = true;
108 break;
110 else
112 // If we have a templated module, enable it as dds_connector_
113 // for the moment
114 AST_Module *m =
115 dynamic_cast<AST_Module*> (this->defined_in ());
116 AST_Template_Module_Inst *t_inst = nullptr;
117 while (t_inst == nullptr && m != nullptr)
119 t_inst = m->from_inst ();
120 m = dynamic_cast<AST_Module*> (m->defined_in ());
122 if (t_inst != nullptr && t_inst->template_args () != nullptr)
124 if (t_inst->template_args ()->size () > 0)
126 this->dds_connector_ = true;
127 idl_global->dds_connector_seen_ = true;
132 base = base->base_connector ();