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 (
10 AST_Connector
*base_connector
)
13 AST_Decl (AST_Decl::NT_connector
,
15 AST_Type (AST_Decl::NT_connector
,
17 UTL_Scope (AST_Decl::NT_connector
),
33 be_scope (AST_Decl::NT_connector
),
34 be_decl (AST_Decl::NT_connector
,
36 be_type (AST_Decl::NT_connector
,
51 dds_connector_ (false),
52 ami_connector_ (false)
54 if (! this->imported ())
56 this->check_ancestors ();
60 be_connector::~be_connector (void)
65 be_connector::destroy (void)
67 this->AST_Connector::destroy ();
68 this->be_component::destroy ();
72 be_connector::accept (be_visitor
*visitor
)
74 return visitor
->visit_connector (this);
78 be_connector::dds_connector (void)
80 return this->dds_connector_
;
84 be_connector::ami_connector (void)
86 return this->ami_connector_
;
90 be_connector::check_ancestors (void)
92 AST_Connector
*base
= this;
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;
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;
112 // If we have a templated module, enable it as dds_connector_
115 dynamic_cast<AST_Module
*> (this->defined_in ());
116 AST_Template_Module_Inst
*t_inst
= 0;
117 while (t_inst
== 0 && m
!= 0)
119 t_inst
= m
->from_inst ();
120 m
= dynamic_cast<AST_Module
*> (m
->defined_in ());
122 if (t_inst
!= 0 && t_inst
->template_args () != 0)
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 ();
136 IMPL_NARROW_FROM_DECL (be_connector
)
137 IMPL_NARROW_FROM_SCOPE (be_connector
)