3 //=============================================================================
5 * @file be_visitor_ami_pre_proc.cpp
7 * This visitor creates for AMI implied IDL constructs
8 * the appropriate AST (Abstract Syntax Tree) node,
9 * sets the corresponding interface or operation strategy
10 * on it and enteres the nodes into the AST.
12 * @author Michael Kircher <Michael.Kircher@mchp.siemens.de>
14 //=============================================================================
16 #include "be_visitor_ami_pre_proc.h"
17 #include "be_visitor_context.h"
19 #include "be_module.h"
20 #include "be_interface.h"
21 #include "be_valuetype.h"
22 #include "be_operation.h"
23 #include "be_attribute.h"
24 #include "be_predefined_type.h"
25 #include "be_argument.h"
27 #include "be_global.h"
28 #include "be_extern.h"
30 #include "utl_identifier.h"
31 #include "utl_exceptlist.h"
33 #include "nr_extern.h"
34 #include "global_extern.h"
36 #include "ace/Log_Msg.h"
38 be_visitor_ami_pre_proc::be_visitor_ami_pre_proc (be_visitor_context
*ctx
)
39 : be_visitor_scope (ctx
)
43 be_visitor_ami_pre_proc::~be_visitor_ami_pre_proc ()
48 be_visitor_ami_pre_proc::visit_root (be_root
*node
)
50 if (this->visit_scope (node
) == -1)
52 ACE_ERROR_RETURN ((LM_ERROR
,
53 ACE_TEXT ("be_visitor_ami_pre_proc::")
54 ACE_TEXT ("visit_root - ")
55 ACE_TEXT ("visit scope failed\n")),
59 if (be_global
->ami4ccm_call_back ())
61 /// Generate the *A.idl file containing AMI4CCM-related
62 /// interfaces and connector.
63 int status
= this->generate_ami4ccm_idl ();
67 ACE_ERROR_RETURN ((LM_ERROR
,
68 ACE_TEXT ("be_visitor_ami_pre_proc::")
69 ACE_TEXT ("visit_root - ")
70 ACE_TEXT ("generate_ami4ccm_idl() ")
71 ACE_TEXT ("failed\n")),
80 be_visitor_ami_pre_proc::visit_module (be_module
*node
)
82 // Skip this for now until we get AMI integrated with
84 if (0 == ACE_OS::strcmp (node
->local_name ()->get_string (), "Components"))
89 if (this->visit_scope (node
) == -1)
91 ACE_ERROR_RETURN ((LM_ERROR
,
92 "(%N:%l) be_visitor_ami_pre_proc::"
94 "visit scope failed\n"),
102 be_visitor_ami_pre_proc::visit_interface (be_interface
*node
)
104 // We check for an imported node after generating the reply handler.
105 if (node
->is_local () || node
->is_abstract ())
110 // The following 3 IF blocks are checks for CCM-related nodes, which
111 // we want to skip until we get AMI integrated with CIAO.
113 // Skip the *EventConsumer added for each eventtype.
114 if (node
->is_event_consumer ())
119 // Check for home equivalent interface. The lookup will find the
120 // home itself, which was declared first.
121 Identifier
*node_lname
= node
->AST_Decl::local_name ();
122 AST_Decl
*first_stored
=
123 node
->defined_in ()->lookup_by_name_local (node_lname
, false);
125 if (nullptr != first_stored
&& first_stored
->node_type () == AST_Decl::NT_home
)
130 ACE_CString
lname (node_lname
->get_string ());
132 // Skip the *Explict and *Implicit interfaces added for a home.
133 if (lname
.substr (lname
.length () - 6) == "plicit")
135 UTL_Scope
*s
= node
->defined_in ();
136 Identifier
local_id (lname
.substr (0, lname
.length () - 8).c_str ());
137 AST_Decl
*d
= s
->lookup_by_name_local (&local_id
, false);
147 dynamic_cast<AST_Module
*> (node
->defined_in ());
151 ACE_ERROR_RETURN ((LM_ERROR
,
152 "(%N:%l) be_visitor_ami_pre_proc::"
158 be_interface
*reply_handler
= this->create_reply_handler (node
);
162 reply_handler
->set_defined_in (node
->defined_in ());
164 // Insert the ami handler after the node, the
165 // exception holder will be placed between these two later.
166 module
->be_add_interface (reply_handler
, node
);
168 // Remember from whom we were cloned
169 reply_handler
->original_interface (node
);
171 // If this was created for an imported node, it will be wrong
173 reply_handler
->set_imported (node
->imported ());
177 ACE_ERROR_RETURN ((LM_ERROR
,
178 "(%N:%l) be_visitor_ami_pre_proc::"
180 "creating the reply handler failed\n"),
184 if (this->visit_scope (node
) == -1)
186 ACE_ERROR_RETURN ((LM_ERROR
,
187 "(%N:%l) be_visitor_ami_pre_proc::"
189 "visit scope failed\n"),
197 be_visitor_ami_pre_proc::visit_operation (be_operation
*node
)
199 if (node
->flags () == AST_Operation::OP_oneway
)
201 // We do nothing for oneways!
205 be_interface
*parent
=
206 dynamic_cast<be_interface
*> (node
->defined_in ());
208 // If we're here, we're sure that the arg traits specialization
209 // for this will be needed.
210 be_global
->messaging_exceptionholder ()->seen_in_operation (true);
212 be_operation
*sendc_op
=
213 this->create_sendc_operation (node
); // for arguments = TRUE
215 parent
->be_add_operation (sendc_op
);
221 be_visitor_ami_pre_proc::visit_attribute (be_attribute
*node
)
223 if (! node
->readonly ())
225 /// Temporarily generate the set operation.
226 be_operation
*set_operation
=
227 this->generate_set_operation (node
);
228 set_operation
->set_defined_in (node
->defined_in ());
230 this->visit_operation (set_operation
);
232 set_operation
->destroy ();
233 delete set_operation
;
234 set_operation
= nullptr;
237 /// Temporarily generate the get operation.
238 be_operation
*get_operation
=
239 this->generate_get_operation (node
);
240 get_operation
->set_defined_in (node
->defined_in ());
242 this->visit_operation (get_operation
);
244 get_operation
->destroy ();
245 delete get_operation
;
246 get_operation
= nullptr;
252 be_visitor_ami_pre_proc::create_reply_handler (be_interface
*node
)
254 // We're at global scope here so we need to fool the scope stack
255 // for a minute so the correct repo id can be calculated at
256 // interface construction time.
257 UTL_Scope
*s
= node
->defined_in ();
258 idl_global
->scopes ().push (s
);
260 // Create the reply handler name.
261 ACE_CString reply_handler_local_name
;
263 this->generate_name (reply_handler_local_name
,
265 node
->name ()->last_component ()->get_string(),
268 UTL_ScopedName
*reply_handler_name
=
269 static_cast<UTL_ScopedName
*> (node
->name ()->copy ());
271 reply_handler_name
->last_component ()->replace_string (
272 reply_handler_local_name
.c_str ());
276 this->create_inheritance_list (node
, n_parents
);
278 if (p_intf
== nullptr)
280 ACE_ERROR_RETURN ((LM_ERROR
,
281 "(%N:%l) be_visitor_ami_pre_proc::visit_interface - "
282 "bad inheritance list\n"),
286 be_interface
*reply_handler
= nullptr;
287 ACE_NEW_RETURN (reply_handler
,
288 be_interface (reply_handler_name
, // name
289 p_intf
, // list of inherited
290 n_parents
, // number of inherited
291 nullptr, // list of all ancestors
292 0, // number of ancestors
298 idl_global
->scopes ().pop ();
300 reply_handler
->set_name (reply_handler_name
);
301 reply_handler
->set_defined_in (s
);
303 /// Store here for convenient retrieval later.
304 node
->ami_handler (reply_handler
);
306 // Set repo id to 0, so it will be recomputed on the next access,
307 // and set the prefix to the node's prefix. All this is
308 // necessary in case the node's prefix was modified after
310 reply_handler
->AST_Decl::repoID (nullptr);
311 reply_handler
->prefix (const_cast<char*> (node
->prefix ()));
313 reply_handler
->gen_fwd_helper_name ();
315 // Now our customized reply handler is created, we have to
316 // add the operations and attributes to the scope.
317 // Imported nodes get admitted here, so they can get
318 // the reply handler operations added, in case they are
319 // needed in the inheritance graph traversal for a
320 // child reply handler. However, no exception holder
321 // stuff is executed for an imported node.
322 if (node
->nmembers () > 0)
324 this->elem_number_
= 0;
325 // Initialize an iterator to iterate thru our scope.
327 for (UTL_ScopeActiveIterator
si (node
, UTL_Scope::IK_decls
);
331 AST_Decl
*d
= si
.item ();
335 ACE_ERROR_RETURN ((LM_ERROR
,
336 "(%N:%l) be_visitor_ami_pre_proc::visit_interface - "
337 "bad node in this scope\n"),
341 if (d
->node_type () == AST_Decl::NT_attr
)
343 be_attribute
*attribute
= dynamic_cast<be_attribute
*> (d
);
347 be_operation
*get_operation
=
348 this->generate_get_operation (attribute
);
350 this->create_reply_handler_operation (get_operation
,
353 this->create_excep_operation (get_operation
,
356 get_operation
->destroy ();
357 delete get_operation
;
358 get_operation
= nullptr;
360 if (!attribute
->readonly ())
362 be_operation
*set_operation
=
363 this->generate_set_operation (attribute
);
365 this->create_reply_handler_operation (set_operation
,
368 this->create_excep_operation (set_operation
,
371 set_operation
->destroy ();
372 delete set_operation
;
373 set_operation
= nullptr;
379 be_operation
* operation
= dynamic_cast<be_operation
*> (d
);
383 this->create_reply_handler_operation (operation
,
386 this->create_excep_operation (operation
,
390 } // end of while loop
393 reply_handler
->is_ami_rh (true);
394 reply_handler
->is_ami4ccm_rh (true);
396 return reply_handler
;
400 be_visitor_ami_pre_proc::create_sendc_operation (be_operation
*node
)
402 if (node
->flags () == AST_Operation::OP_oneway
)
404 // We do nothing for oneways!
408 Identifier
*id
= nullptr;
409 UTL_ScopedName
*sn
= nullptr;
411 // Create the new name
412 // Prepend "sendc_" to the name of the operation
413 ACE_CString
original_op_name (
414 node
->name ()->last_component ()->get_string ());
415 ACE_CString new_op_name
=
416 ACE_CString ("sendc_") + original_op_name
;
418 UTL_ScopedName
*op_name
=
419 static_cast<UTL_ScopedName
*> (node
->name ()->copy ());
420 op_name
->last_component ()->replace_string (new_op_name
.c_str ());
422 idl_global
->scopes ().push (node
->defined_in ());
424 // Create the operation
425 be_operation
*op
= nullptr;
427 be_operation (be_global
->void_type (),
428 AST_Operation::OP_noflags
,
434 idl_global
->scopes ().pop ();
436 op
->set_name (op_name
);
438 // Create the first argument, which is a Reply Handler
440 // Look up the field type.
441 UTL_Scope
*s
= node
->defined_in ();
442 be_interface
*parent
= dynamic_cast<be_interface
*> (s
);
444 // Add the pre- and suffix
445 ACE_CString handler_local_name
;
447 this->generate_name (
450 parent
->name ()->last_component ()->get_string (),
453 AST_Interface
*handler
= parent
->ami_handler ();
455 if (nullptr == handler
)
461 ACE_ERROR_RETURN ((LM_ERROR
,
462 ACE_TEXT ("be_visitor_ami_pre_proc::")
463 ACE_TEXT ("create_sendc_operation - ")
464 ACE_TEXT ("null reply ")
465 ACE_TEXT ("handler found\n")),
469 be_interface
*field_type
=
470 dynamic_cast<be_interface
*> (handler
);
473 Identifier ("ami_handler"),
476 UTL_ScopedName
*tmp
= nullptr;
483 sn
= (UTL_ScopedName
*)op
->name ()->copy ();
486 be_argument
*arg
= nullptr;
488 be_argument (AST_Argument::dir_IN
,
489 field_type
, // is also a valuetype
493 arg
->set_defined_in (op
);
495 op
->be_add_argument (arg
);
497 if (field_type
->imported ())
499 field_type
->seen_in_operation (false);
502 // Iterate over the arguments and put all the in and inout
503 // into the new method.
504 if (node
->nmembers () > 0)
506 // initialize an iterator to iterate thru our scope
507 for (UTL_ScopeActiveIterator
si (node
, UTL_Scope::IK_decls
);
511 AST_Decl
*d
= si
.item ();
517 "(%N:%l) be_visitor_ami_pre_proc::create_sendc_method - "
518 "bad node in this scope\n"
524 AST_Argument
*original_arg
= dynamic_cast<AST_Argument
*> (d
);
526 if (original_arg
->direction () == AST_Argument::dir_IN
||
527 original_arg
->direction () == AST_Argument::dir_INOUT
)
529 // Create the argument.
530 be_argument
*arg
= nullptr;
531 UTL_ScopedName
*new_name
=
532 (UTL_ScopedName
*)original_arg
->name ()->copy ();
534 be_argument (AST_Argument::dir_IN
,
535 original_arg
->field_type (),
539 arg
->set_defined_in (op
);
540 arg
->set_name (new_name
);
541 op
->be_add_argument (arg
);
543 } // end of while loop
546 op
->is_sendc_ami (true);
547 op
->is_attr_op (node
->is_attr_op ());
552 be_visitor_ami_pre_proc::create_reply_handler_operation (
554 be_interface
*reply_handler
)
561 if (node
->flags () == AST_Operation::OP_oneway
)
563 // We do nothing for oneways!
567 Identifier
*id
= nullptr;
568 UTL_ScopedName
*sn
= nullptr;
570 ACE_CString
original_op_name (
571 node
->name ()->last_component ()->get_string ()
574 UTL_ScopedName
*op_name
=
575 static_cast<UTL_ScopedName
*> (reply_handler
->name ()-> copy ());
578 Identifier (original_op_name
.c_str ()),
588 // Create the operation.
589 be_operation
*operation
= nullptr;
590 ACE_NEW_RETURN (operation
,
591 be_operation (be_global
->void_type (),
592 AST_Operation::OP_noflags
,
598 operation
->set_name (op_name
);
600 // If return type is non-void add it as first argument.
602 if (!node
->void_return_type ())
605 Identifier ("ami_return_val"),
608 UTL_ScopedName
*tmp
= nullptr;
615 sn
= (UTL_ScopedName
*)operation
->name ()->copy ();
618 // Create the argument.
619 be_argument
*arg
= nullptr;
621 be_argument (AST_Argument::dir_IN
,
622 node
->return_type (),
626 arg
->set_defined_in (operation
);
629 // Add the reply handler to the argument list.
630 operation
->be_add_argument (arg
);
633 // Iterate over the arguments and put all the in and inout
634 // into the new method.
635 if (node
->nmembers () > 0)
637 // Initialize an iterator to iterate thru our scope.
638 for (UTL_ScopeActiveIterator
si (node
, UTL_Scope::IK_decls
);
642 AST_Decl
*d
= si
.item ();
646 operation
->destroy ();
650 ACE_ERROR_RETURN ((LM_ERROR
,
651 ACE_TEXT ("be_visitor_ami_pre_proc::")
652 ACE_TEXT ("create_reply_handler_operation - ")
653 ACE_TEXT ("bad node in this scope\n")),
657 AST_Argument
*original_arg
= dynamic_cast<AST_Argument
*> (d
);
659 if (original_arg
->direction () == AST_Argument::dir_INOUT
||
660 original_arg
->direction () == AST_Argument::dir_OUT
)
662 // Create the argument.
663 be_argument
*arg
= nullptr;
664 UTL_ScopedName
*new_name
=
665 (UTL_ScopedName
*)original_arg
->name ()->copy ();
667 be_argument (AST_Argument::dir_IN
,
668 original_arg
->field_type (),
672 arg
->set_defined_in (operation
);
673 arg
->set_name (new_name
);
674 operation
->be_add_argument (arg
);
676 } // end of while loop
679 operation
->set_defined_in (reply_handler
);
681 // Copy the exceptions.
682 if (node
->exceptions ())
684 UTL_ExceptList
*exceptions
= node
->exceptions ();
686 if (nullptr != exceptions
)
688 operation
->be_add_exceptions (exceptions
->copy ());
692 // After having generated the operation we insert it into the
693 // reply handler interface.
694 if (nullptr == reply_handler
->be_add_operation (operation
))
699 operation
->is_attr_op (node
->is_attr_op ());
704 be_visitor_ami_pre_proc::create_excep_operation (be_operation
*node
,
705 be_interface
*reply_handler
)
707 if (node
->flags () == AST_Operation::OP_oneway
)
709 // We do nothing for oneways!
713 // Create the return type, which is "void".
714 Identifier
*id
= nullptr;
715 UTL_ScopedName
*sn
= nullptr;
717 // Create the argument.
719 Identifier ("excep_holder"),
727 be_valuetype
*excep_holder
= be_global
->messaging_exceptionholder ();
728 be_argument
*arg
= nullptr;
730 be_argument (AST_Argument::dir_IN
,
731 excep_holder
, // is also a valuetype
737 UTL_ScopedName
*tmp
= (UTL_ScopedName
*)sn
->copy ();
739 // Create the new name
740 // Append _excep to the name of the operation
741 ACE_CString
original_op_name (
742 node
->name ()->last_component ()->get_string ()
744 ACE_CString new_op_name
= original_op_name
+ ACE_CString ("_excep");
746 UTL_ScopedName
*op_name
=
747 static_cast<UTL_ScopedName
*> (reply_handler
->name ()->copy ());
750 Identifier (new_op_name
.c_str ()),
760 AST_PredefinedType
*rt
= be_global
->void_type ();
762 // Create the operation.
763 be_operation
*operation
= nullptr;
764 ACE_NEW_RETURN (operation
,
766 AST_Operation::OP_noflags
,
772 operation
->set_name (op_name
);
773 operation
->be_add_argument (arg
);
774 operation
->set_defined_in (reply_handler
);
776 UTL_ScopedName
*arg_name
=
777 dynamic_cast<UTL_ScopedName
*> (op_name
->copy ());
778 arg_name
->nconc (tmp
);
779 arg
->set_name (arg_name
);
780 arg
->set_defined_in (operation
);
782 // Copy the exceptions since the user exception information may
783 // be needed when collocation is disabled.
784 UTL_ExceptList
*exceptions
= node
->exceptions ();
786 if (nullptr != exceptions
)
788 operation
->be_add_exceptions (exceptions
->copy ());
791 reply_handler
->be_add_operation (operation
);
793 operation
->is_excep_ami (true);
797 // Visit the scope and its elements.
799 be_visitor_ami_pre_proc::visit_scope (be_scope
*node
)
801 // proceed if the number of members in our scope is greater than 0
802 if (node
->nmembers () > 0)
804 int number_of_elements
= 0;
807 // initialize an iterator to iterate thru our scope
808 for (UTL_ScopeActiveIterator
si (node
, UTL_Scope::IK_decls
);
812 ++number_of_elements
;
816 AST_Decl
**elements
= nullptr;
817 ACE_NEW_RETURN (elements
,
818 AST_Decl
*[number_of_elements
],
824 // Initialize an iterator to iterate thru our scope.
825 for (UTL_ScopeActiveIterator
si (node
, UTL_Scope::IK_decls
);
829 elements
[position
++] = si
.item ();
835 // Continue until each element is visited.
836 while (elem_number
< number_of_elements
)
838 AST_Decl
*d
= elements
[elem_number
++];
844 ACE_ERROR_RETURN ((LM_ERROR
,
845 "(%N:%l) be_visitor_scope::visit_scope - "
846 "bad node in this scope\n"),
855 be_decl
*bd
= dynamic_cast<be_decl
*> (d
);
857 // Set the scope node as "node" in which the code is being
858 // generated so that elements in the node's scope can use it
859 // for code generation.
860 this->ctx_
->scope (node
);
862 // Set the node to be visited.
863 this->ctx_
->node (bd
);
866 if (bd
== nullptr || bd
->accept (this) == -1)
870 ACE_ERROR_RETURN ((LM_ERROR
,
871 "(%N:%l) be_visitor_scope::visit_scope - "
872 "codegen for scope failed\n"),
875 } // end of while loop
887 be_visitor_ami_pre_proc::generate_name (ACE_CString
&destination
,
889 const char *middle_name
,
892 destination
= prefix
;
893 destination
+= middle_name
;
894 destination
+= suffix
;
899 be_visitor_ami_pre_proc::generate_get_operation (be_attribute
*node
)
901 ACE_CString
original_op_name (
902 node
->name ()->last_component ()->get_string ()
904 ACE_CString new_op_name
= ACE_CString ("get_") + original_op_name
;
906 UTL_ScopedName
*get_name
=
907 static_cast<UTL_ScopedName
*> (node
->name ()->copy ());
908 get_name
->last_component ()->replace_string (new_op_name
.c_str ());
910 be_operation
*operation
= nullptr;
911 ACE_NEW_RETURN (operation
,
912 be_operation (node
->field_type (),
913 AST_Operation::OP_noflags
,
919 operation
->set_name (get_name
);
920 operation
->set_defined_in (node
->defined_in ());
922 // Copy the exceptions since the user exception information may
923 // be needed when collocation is disabled.
924 UTL_ExceptList
*exceptions
= node
->get_get_exceptions ();
926 if (nullptr != exceptions
)
928 operation
->be_add_exceptions (exceptions
->copy ());
931 operation
->is_attr_op (true);
936 be_visitor_ami_pre_proc::generate_set_operation (be_attribute
*node
)
938 ACE_CString
original_op_name (
939 node
->name ()->last_component ()->get_string ()
941 ACE_CString new_op_name
= ACE_CString ("set_") + original_op_name
;
943 UTL_ScopedName
*set_name
=
944 static_cast<UTL_ScopedName
*> (node
->name ()-> copy ());
945 set_name
->last_component ()->replace_string (new_op_name
.c_str ());
947 // Argument type is the same as the attribute type.
948 be_argument
*arg
= nullptr;
950 be_argument (AST_Argument::dir_IN
,
955 arg
->set_name ((UTL_ScopedName
*) node
->name ()->copy ());
957 // Create the operation.
958 be_operation
*operation
= nullptr;
959 ACE_NEW_RETURN (operation
,
960 be_operation (be_global
->void_type (),
961 AST_Operation::OP_noflags
,
967 operation
->set_name (set_name
);
968 operation
->set_defined_in (node
->defined_in ());
969 operation
->be_add_argument (arg
);
971 // Copy the exceptions since the user exception information may
972 // be needed when collocation is disabled.
973 UTL_ExceptList
*exceptions
= node
->get_set_exceptions ();
975 if (nullptr != exceptions
)
977 operation
->be_add_exceptions (exceptions
->copy ());
980 operation
->is_attr_op (true);
985 be_visitor_ami_pre_proc::create_inheritance_list (be_interface
*node
,
988 AST_Type
**retval
= nullptr;
990 long const n_parents
= node
->n_inherits ();
991 AST_Type
**parents
= node
->inherits ();
992 AST_Type
*parent
= nullptr;
994 for (long i
= 0; i
< n_parents
; ++i
)
998 if (parent
->is_abstract ())
1006 if (n_rh_parents
== 0)
1008 be_interface
*inherit_intf
= be_global
->messaging_replyhandler ();
1010 ACE_NEW_RETURN (retval
,
1014 retval
[0] = inherit_intf
;
1019 ACE_NEW_RETURN (retval
,
1020 AST_Type
*[n_rh_parents
],
1023 ACE_CString
prefix ("AMI_");
1025 ACE_CString
suffix ("Handler");
1028 for (long j
= 0; j
< n_parents
; ++j
)
1030 parent
= parents
[j
];
1032 if (parent
->is_abstract ())
1037 ACE_CString rh_local_name
=
1038 prefix
+ parent
->local_name ()->get_string () + suffix
;
1040 UTL_ScopedName
*rh_parent_name
=
1041 static_cast<UTL_ScopedName
*> (parent
->name ()->copy ());
1043 rh_parent_name
->last_component ()->replace_string (
1044 rh_local_name
.c_str ()
1048 node
->defined_in ()->lookup_by_name (rh_parent_name
,
1053 retval
[index
] = dynamic_cast<AST_Interface
*> (d
);
1054 retval
[index
++]->set_prefix_with_typeprefix (parent
->prefix () ?
1055 const_cast<char*> (parent
->prefix()) :
1056 const_cast<char*> (""));
1059 rh_parent_name
->destroy ();
1060 delete rh_parent_name
;
1061 rh_parent_name
= nullptr;
1064 // Just a sanity check until we're sure this works in all use cases.
1065 if (n_rh_parents
!= index
)
1068 ACE_ERROR_RETURN ((LM_ERROR
,
1069 "reply handler parent iteration mismatch\n"),
1078 be_visitor_ami_pre_proc::generate_ami4ccm_idl ()
1080 /// The interfaces in the list below are from this IDL file,
1081 /// which then must be processed with the -GC option, so we
1082 /// know we'll get here - a good place to generate the *A.idl
1083 /// file containing the local interfaces and connector
1084 /// associated with each interface in the list.
1086 ACE_Unbounded_Queue
<char *> &ccm_ami_ifaces
=
1087 idl_global
->ciao_ami_iface_names ();
1089 /// If the queue is empty, we're done.
1090 if (ccm_ami_ifaces
.size () == 0)
1095 /// Open the *A.idl file and create the file stream.
1097 tao_cg
->start_ciao_ami_conn_idl (
1098 be_global
->be_get_ciao_ami_conn_idl_fname ());
1102 ACE_ERROR_RETURN ((LM_ERROR
,
1103 ACE_TEXT ("be_visitor_ami_pre_proc")
1104 ACE_TEXT ("::generate_ami4ccm_idl - ")
1105 ACE_TEXT ("Error opening CIAO AMI ")
1106 ACE_TEXT ("connector IDL file\n")),
1110 for (ACE_Unbounded_Queue
<char *>::CONST_ITERATOR
i (
1115 char **item
= nullptr;
1118 UTL_ScopedName
*sn
=
1119 FE_Utils::string_to_scoped_name (*item
);
1122 idl_global
->scopes ().top_non_null ();
1124 AST_Decl
*d
= s
->lookup_by_name (sn
, true);
1128 idl_global
->err ()->lookup_error (sn
);
1141 be_interface
*iface
=
1142 dynamic_cast<be_interface
*> (d
);
1144 if (iface
== nullptr)
1146 idl_global
->err ()->interface_expected (d
);
1150 /// The interface's method encapsulates the code that
1151 /// spawns the appropriate visitors. We just pass it
1152 /// the file stream.
1153 iface
->gen_ami4ccm_idl (tao_cg
->ciao_ami_conn_idl ());
1156 tao_cg
->end_ciao_ami_conn_idl ();