2 * @file be_visitor_ccm_pre_proc.cpp
6 //=============================================================================
8 #include "be_visitor_ccm_pre_proc.h"
9 #include "be_visitor_context.h"
10 #include "be_visitor_xplicit_pre_proc.h"
12 #include "be_operation.h"
13 #include "be_argument.h"
14 #include "be_exception.h"
15 #include "be_structure.h"
16 #include "be_sequence.h"
17 #include "be_valuetype.h"
18 #include "be_module.h"
19 #include "be_template_module.h"
20 #include "be_template_module_inst.h"
22 #include "be_typedef.h"
23 #include "be_connector.h"
24 #include "be_provides.h"
26 #include "be_publishes.h"
28 #include "be_consumes.h"
29 #include "be_extended_port.h"
30 #include "be_porttype.h"
31 #include "be_eventtype.h"
32 #include "be_eventtype_fwd.h"
34 #include "be_finder.h"
35 #include "be_extern.h"
37 #include "ast_generator.h"
39 #include "utl_exceptlist.h"
40 #include "utl_namelist.h"
43 #include "fe_interface_header.h"
44 #include "global_extern.h"
45 #include "nr_extern.h"
47 const char *LW_EXCEP_NAMES
[] =
52 "ExceededConnectionLimit",
58 const char *ADDL_EXCEP_NAMES
[] =
65 const int N_LW_EXCEPS
=
66 sizeof (LW_EXCEP_NAMES
) / sizeof (char *);
67 const int N_ADDL_EXCEPS
=
68 sizeof (ADDL_EXCEP_NAMES
) / sizeof (char *);
70 be_exception
*LW_EXCEPS
[N_LW_EXCEPS
];
71 be_exception
*ADDL_EXCEPS
[N_ADDL_EXCEPS
];
73 be_visitor_ccm_pre_proc::be_visitor_ccm_pre_proc (
74 be_visitor_context
*ctx
)
75 : be_visitor_component_scope (ctx
),
76 module_id_ ("Components"),
78 already_connected_ (nullptr),
79 invalid_connection_ (nullptr),
80 no_connection_ (nullptr),
81 exceeded_connection_limit_ (nullptr),
82 create_failure_ (nullptr),
83 remove_failure_ (nullptr),
84 finder_failure_ (nullptr),
85 invalid_key_ (nullptr),
86 unknown_key_value_ (nullptr),
87 duplicate_key_value_ (nullptr),
90 ccm_lookups_done_ (false)
94 be_visitor_ccm_pre_proc::~be_visitor_ccm_pre_proc ()
96 this->module_id_
.destroy ();
100 be_visitor_ccm_pre_proc::visit_root (be_root
*node
)
102 /// Do this before traversing the tree so the traversal
103 /// will pick up the implied uses nodes we add, if any.
104 /// No need to check for the -GM option here - what's
105 /// generated by this call depends only on the contents
106 /// of the ciao_ami_recep_names_ queue.
107 int const status
= this->generate_ami4ccm_uses ();
111 ACE_ERROR_RETURN ((LM_ERROR
,
112 ACE_TEXT ("be_visitor_ccm_pre_proc::")
113 ACE_TEXT ("visit_root - ")
114 ACE_TEXT ("generate_ami4ccm_uses() ")
115 ACE_TEXT ("failed\n")),
119 if (this->visit_scope (node
) == -1)
121 ACE_ERROR_RETURN ((LM_ERROR
,
122 ACE_TEXT ("be_visitor_ccm_pre_proc::")
123 ACE_TEXT ("visit_root - ")
124 ACE_TEXT ("visit scope failed\n")),
132 be_visitor_ccm_pre_proc::visit_module (be_module
*node
)
134 if (this->visit_scope (node
) == -1)
136 ACE_ERROR_RETURN ((LM_ERROR
,
137 ACE_TEXT ("be_visitor_ccm_pre_proc::")
138 ACE_TEXT ("visit_module - ")
139 ACE_TEXT ("visit scope failed\n")),
147 be_visitor_ccm_pre_proc::visit_component (be_component
*node
)
149 /// Waiting to do this until a component is seen will ensure
150 /// that Components.idl is present and the lookups will
151 /// succeed. The flag ensures that the lookup is done only
153 if (!this->ccm_lookups_done_
)
155 if (this->lookup_cookie () == -1)
157 ACE_ERROR_RETURN ((LM_ERROR
,
158 ACE_TEXT ("be_visitor_ccm_pre_proc::")
159 ACE_TEXT ("visit_root - ")
160 ACE_TEXT ("Components::Cookie ")
161 ACE_TEXT ("lookup failed\n")),
165 if (this->lookup_exceptions () == -1)
167 ACE_ERROR_RETURN ((LM_ERROR
,
168 ACE_TEXT ("be_visitor_ccm_pre_proc::")
169 ACE_TEXT ("visit_root - ")
170 ACE_TEXT ("component exception ")
171 ACE_TEXT ("lookups failed\n")),
175 this->ccm_lookups_done_
= true;
178 // Set working node for all port code generation.
181 if (this->visit_scope (node
) == -1)
183 ACE_ERROR_RETURN ((LM_ERROR
,
184 ACE_TEXT ("be_visitor_ccm_pre_proc::")
185 ACE_TEXT ("visit_component - ")
186 ACE_TEXT ("code generation for ")
187 ACE_TEXT ("scope3 failed\n")),
195 be_visitor_ccm_pre_proc::visit_connector (be_connector
*node
)
197 return this->visit_component (node
);
201 be_visitor_ccm_pre_proc::visit_provides (be_provides
*node
)
203 if (node
->provides_type ()->is_local ())
208 if (!be_global
->gen_lwccm ())
210 // If this facet comes from a porttype, the instantiated
211 // port/mirrorport name is prefixed to the facet name.
212 ACE_CString
prefix ("provide_");
213 prefix
+= this->ctx_
->port_prefix ();
215 AST_Operation
*provides_op
= nullptr;
216 UTL_ScopedName
*op_name
=
217 this->create_scoped_name (prefix
.c_str (),
218 node
->local_name ()->get_string (),
221 ACE_NEW_RETURN (provides_op
,
222 be_operation (node
->provides_type (),
223 AST_Operation::OP_noflags
,
229 provides_op
->set_defined_in (comp_
);
230 provides_op
->set_imported (comp_
->imported ());
231 provides_op
->set_name (op_name
);
233 if (nullptr == comp_
->be_add_operation (provides_op
))
235 ACE_ERROR_RETURN ((LM_ERROR
,
236 ACE_TEXT ("be_visitor_ccm_pre_proc::")
237 ACE_TEXT ("visit_provides - ")
238 ACE_TEXT ("be_add_operation() failed\n")),
247 be_visitor_ccm_pre_proc::visit_uses (be_uses
*node
)
249 if (node
->uses_type ()->is_local ())
254 if (!be_global
->gen_lwccm ())
256 if (node
->is_multiple ())
258 if (this->gen_connect_multiple (node
) == -1)
260 ACE_ERROR_RETURN ((LM_ERROR
,
261 ACE_TEXT ("be_visitor_ccm_pre_proc::")
262 ACE_TEXT ("visit_uses - ")
263 ACE_TEXT ("gen_connect_multiple failed\n")),
267 if (this->gen_disconnect_multiple (node
) == -1)
269 ACE_ERROR_RETURN ((LM_ERROR
,
270 ACE_TEXT ("be_visitor_ccm_pre_proc::")
271 ACE_TEXT ("visit_uses - ")
272 ACE_TEXT ("gen_disconnect_multiple failed\n")),
276 if (this->gen_get_connection_multiple (node
) == -1)
278 ACE_ERROR_RETURN ((LM_ERROR
,
279 ACE_TEXT ("be_visitor_ccm_pre_proc::")
280 ACE_TEXT ("visit_uses - ")
281 ACE_TEXT ("gen_get_connection_single failed\n")),
287 if (this->gen_connect_single (node
) == -1)
289 ACE_ERROR_RETURN ((LM_ERROR
,
290 ACE_TEXT ("be_visitor_ccm_pre_proc::")
291 ACE_TEXT ("visit_uses - ")
292 ACE_TEXT ("gen_connect_single failed\n")),
296 if (this->gen_disconnect_single (node
) == -1)
298 ACE_ERROR_RETURN ((LM_ERROR
,
299 ACE_TEXT ("be_visitor_ccm_pre_proc::")
300 ACE_TEXT ("visit_uses - ")
301 ACE_TEXT ("gen_disconnect_single failed\n")),
305 if (this->gen_get_connection_single (node
) == -1)
307 ACE_ERROR_RETURN ((LM_ERROR
,
308 ACE_TEXT ("be_visitor_ccm_pre_proc::")
309 ACE_TEXT ("visit_uses - ")
310 ACE_TEXT ("gen_get_connection_single failed\n")),
320 be_visitor_ccm_pre_proc::visit_publishes (be_publishes
*node
)
322 if (!be_global
->gen_noeventccm ())
324 if (this->gen_subscribe (node
) == -1)
326 ACE_ERROR_RETURN ((LM_ERROR
,
327 ACE_TEXT ("be_visitor_ccm_pre_proc::")
328 ACE_TEXT ("visit_publishes - ")
329 ACE_TEXT ("gen_subscribe failed\n")),
333 if (this->gen_unsubscribe (node
) == -1)
335 ACE_ERROR_RETURN ((LM_ERROR
,
336 ACE_TEXT ("be_visitor_ccm_pre_proc::")
337 ACE_TEXT ("visit_publishes - ")
338 ACE_TEXT ("gen_unsubscribe failed\n")),
346 be_visitor_ccm_pre_proc::visit_emits (be_emits
*node
)
348 if (!be_global
->gen_noeventccm ())
350 if (this->gen_emits_connect (node
) == -1)
352 ACE_ERROR_RETURN ((LM_ERROR
,
353 ACE_TEXT ("be_visitor_ccm_pre_proc::")
354 ACE_TEXT ("visit_emits - ")
355 ACE_TEXT ("gen_emits_connect failed\n")),
359 if (this->gen_emits_disconnect (node
) == -1)
361 ACE_ERROR_RETURN ((LM_ERROR
,
362 ACE_TEXT ("be_visitor_ccm_pre_proc::")
363 ACE_TEXT ("visit_emits - ")
364 ACE_TEXT ("gen_emits_disconnect failed\n")),
372 be_visitor_ccm_pre_proc::visit_consumes (be_consumes
*node
)
374 if (!be_global
->gen_noeventccm ())
376 if (this->gen_get_consumer (node
) == -1)
378 ACE_ERROR_RETURN ((LM_ERROR
,
379 ACE_TEXT ("be_visitor_ccm_pre_proc::")
380 ACE_TEXT ("visit_comsumes - ")
381 ACE_TEXT ("gen_get_consumer failed\n")),
389 be_visitor_ccm_pre_proc::visit_home (be_home
*node
)
391 AST_Interface
*xplicit
= this->create_explicit (node
);
393 if (xplicit
== nullptr)
395 ACE_ERROR_RETURN ((LM_ERROR
,
396 ACE_TEXT ("be_visitor_ccm_pre_proc::")
397 ACE_TEXT ("visit_home - code generation ")
398 ACE_TEXT ("for explicit interface failed\n")),
402 AST_Interface
*implicit
= this->create_implicit (node
);
404 if (implicit
== nullptr)
406 ACE_ERROR_RETURN ((LM_ERROR
,
407 ACE_TEXT ("be_visitor_ccm_pre_proc::")
408 ACE_TEXT ("visit_home - code generation ")
409 ACE_TEXT ("for implicit interface failed\n")),
413 if (this->gen_implicit_ops (node
, implicit
) == -1)
415 ACE_ERROR_RETURN ((LM_ERROR
,
416 ACE_TEXT ("be_visitor_ccm_pre_proc::")
417 ACE_TEXT ("visit_home - ")
418 ACE_TEXT ("code generation for primary key ")
419 ACE_TEXT ("operations failed\n")),
423 if (this->create_equivalent (node
, xplicit
, implicit
) == nullptr)
425 ACE_ERROR_RETURN ((LM_ERROR
,
426 ACE_TEXT ("be_visitor_ccm_pre_proc::")
427 ACE_TEXT ("visit_home - code generation ")
428 ACE_TEXT ("for equivalent interface failed\n")),
436 be_visitor_ccm_pre_proc::visit_eventtype (be_eventtype
*node
)
438 if (!be_global
->gen_noeventccm ())
440 if (node
->ccm_pre_proc_gen ())
445 if (this->create_event_consumer (node
) == -1)
447 ACE_ERROR_RETURN ((LM_ERROR
,
448 ACE_TEXT ("be_visitor_ccm_pre_proc::")
449 ACE_TEXT ("visit_eventtype - code generation ")
450 ACE_TEXT ("for consumer failed\n")),
454 node
->ccm_pre_proc_gen (true);
460 be_visitor_ccm_pre_proc::visit_eventtype_fwd (be_eventtype_fwd
*node
)
463 dynamic_cast<be_eventtype
*> (node
->full_definition ());
465 return this->visit_eventtype (fd
);
469 be_visitor_ccm_pre_proc::gen_implicit_ops (be_home
*node
,
470 AST_Interface
*implicit
)
472 if (this->gen_create (node
, implicit
) == -1)
474 ACE_ERROR_RETURN ((LM_ERROR
,
475 ACE_TEXT ("be_visitor_ccm_pre_proc::")
476 ACE_TEXT ("gen_implicit_ops - ")
477 ACE_TEXT ("gen_create failed\n")),
481 AST_Type
*pk
= node
->primary_key ();
488 if (!be_global
->gen_lwccm ())
490 if (this->gen_find_by_primary_key (node
, implicit
) == -1)
492 ACE_ERROR_RETURN ((LM_ERROR
,
493 ACE_TEXT ("be_visitor_ccm_pre_proc::")
494 ACE_TEXT ("gen_implicit_ops - ")
495 ACE_TEXT ("gen_find_by_primary_key failed\n")),
500 if (this->gen_remove (node
, implicit
) == -1)
502 ACE_ERROR_RETURN ((LM_ERROR
,
503 ACE_TEXT ("be_visitor_ccm_pre_proc::")
504 ACE_TEXT ("gen_implicit_ops - ")
505 ACE_TEXT ("gen_remove failed\n")),
509 if (!be_global
->gen_lwccm ())
511 if (this->gen_get_primary_key (node
, implicit
) == -1)
513 ACE_ERROR_RETURN ((LM_ERROR
,
514 ACE_TEXT ("be_visitor_ccm_pre_proc::")
515 ACE_TEXT ("gen_implicit_ops - ")
516 ACE_TEXT ("gen_get_primary_key failed\n")),
524 // **************************************************************
527 be_visitor_ccm_pre_proc::gen_connect_single (be_uses
*node
)
529 // If this facet comes from a porttype, the instantiated
530 // port/mirrorport name is prefixed to the receptacle name.
531 ACE_CString
prefix ("connect_");
532 prefix
+= this->ctx_
->port_prefix ();
534 UTL_ScopedName
*op_full_name
=
535 this->create_scoped_name (prefix
.c_str (),
536 node
->local_name ()->get_string (),
539 be_operation
*op
= nullptr;
541 be_operation (be_global
->void_type (),
542 AST_Operation::OP_noflags
,
547 op
->set_defined_in (comp_
);
548 op
->set_imported (comp_
->imported ());
549 op
->set_name (op_full_name
);
550 Identifier
arg_id ("conxn");
551 UTL_ScopedName
arg_name (&arg_id
,
553 be_argument
*arg
= nullptr;
555 be_argument (AST_Argument::dir_IN
,
560 op
->be_add_argument (arg
);
562 UTL_ExceptList
*tail
= nullptr;
563 ACE_NEW_RETURN (tail
,
564 UTL_ExceptList (this->invalid_connection_
,
567 UTL_ExceptList
*connect_single
= nullptr;
568 ACE_NEW_RETURN (connect_single
,
569 UTL_ExceptList (this->already_connected_
,
572 op
->be_add_exceptions (connect_single
);
574 if (nullptr == comp_
->be_add_operation (op
))
583 be_visitor_ccm_pre_proc::gen_disconnect_single (be_uses
*node
)
585 // If this facet comes from a porttype, the instantiated
586 // port/mirrorport name is prefixed to the receptacle name.
587 ACE_CString
prefix ("disconnect_");
588 prefix
+= this->ctx_
->port_prefix ();
590 UTL_ScopedName
*op_full_name
=
591 this->create_scoped_name (prefix
.c_str (),
592 node
->local_name ()->get_string (),
595 be_operation
*op
= nullptr;
597 be_operation (node
->uses_type (),
598 AST_Operation::OP_noflags
,
603 op
->set_name (op_full_name
);
604 op
->set_defined_in (comp_
);
605 op
->set_imported (comp_
->imported ());
606 UTL_ExceptList
*disconnect_single
= nullptr;
607 ACE_NEW_RETURN (disconnect_single
,
608 UTL_ExceptList (this->no_connection_
,
611 op
->be_add_exceptions (disconnect_single
);
613 if (nullptr == comp_
->be_add_operation (op
))
622 be_visitor_ccm_pre_proc::gen_get_connection_single (be_uses
*node
)
624 // If this facet comes from a porttype, the instantiated
625 // port/mirrorport name is prefixed to the receptacle name.
626 ACE_CString
prefix ("get_connection_");
627 prefix
+= this->ctx_
->port_prefix ();
629 UTL_ScopedName
*op_full_name
=
630 this->create_scoped_name (prefix
.c_str (),
631 node
->local_name ()->get_string (),
634 be_operation
*op
= nullptr;
636 be_operation (node
->uses_type (),
637 AST_Operation::OP_noflags
,
642 op
->set_name (op_full_name
);
643 op
->set_defined_in (comp_
);
644 op
->set_imported (comp_
->imported ());
646 if (nullptr == comp_
->be_add_operation (op
))
655 be_visitor_ccm_pre_proc::gen_connect_multiple (be_uses
*node
)
657 // If this facet comes from a porttype, the instantiated
658 // port/mirrorport name is prefixed to the receptacle name.
659 ACE_CString
prefix ("connect_");
660 prefix
+= this->ctx_
->port_prefix ();
662 UTL_ScopedName
*op_full_name
=
663 this->create_scoped_name (prefix
.c_str (),
664 node
->local_name ()->get_string (),
668 be_operation
*op
= nullptr;
670 be_operation (this->cookie_
,
671 AST_Operation::OP_noflags
,
676 op
->set_name (op_full_name
);
677 op
->set_defined_in (comp_
);
678 op
->set_imported (comp_
->imported ());
679 Identifier
arg_id ("connection");
680 UTL_ScopedName
arg_name (&arg_id
,
682 be_argument
*arg
= nullptr;
684 be_argument (AST_Argument::dir_IN
,
689 op
->be_add_argument (arg
);
690 UTL_ExceptList
*tail
= nullptr;
691 ACE_NEW_RETURN (tail
,
692 UTL_ExceptList (this->invalid_connection_
,
695 UTL_ExceptList
*connect_multiple
= nullptr;
696 ACE_NEW_RETURN (connect_multiple
,
697 UTL_ExceptList (this->exceeded_connection_limit_
,
700 op
->be_add_exceptions (connect_multiple
);
702 if (nullptr == comp_
->be_add_operation (op
))
711 be_visitor_ccm_pre_proc::gen_disconnect_multiple (be_uses
*node
)
713 // If this facet comes from a porttype, the instantiated
714 // port/mirrorport name is prefixed to the receptacle name.
715 ACE_CString
prefix ("disconnect_");
716 prefix
+= this->ctx_
->port_prefix ();
718 UTL_ScopedName
*op_full_name
=
719 this->create_scoped_name (prefix
.c_str (),
720 node
->local_name ()->get_string (),
723 be_operation
*op
= nullptr;
725 be_operation (node
->uses_type (),
726 AST_Operation::OP_noflags
,
731 op
->set_name (op_full_name
);
732 op
->set_defined_in (comp_
);
733 op
->set_imported (comp_
->imported ());
734 Identifier
arg_id ("ck");
735 UTL_ScopedName
arg_name (&arg_id
,
737 be_argument
*arg
= nullptr;
739 be_argument (AST_Argument::dir_IN
,
744 op
->be_add_argument (arg
);
745 UTL_ExceptList
*disconnect_multiple
= nullptr;
746 ACE_NEW_RETURN (disconnect_multiple
,
747 UTL_ExceptList (this->invalid_connection_
,
750 op
->be_add_exceptions (disconnect_multiple
);
752 if (nullptr == comp_
->be_add_operation (op
))
761 be_visitor_ccm_pre_proc::gen_get_connection_multiple (be_uses
*node
)
763 // If this facet comes from a porttype, the instantiated
764 // port/mirrorport name is prefixed to the receptacle name.
765 ACE_CString
prefix ("get_connections_");
766 prefix
+= this->ctx_
->port_prefix ();
768 UTL_ScopedName
*op_full_name
=
769 this->create_scoped_name (prefix
.c_str (),
770 node
->local_name ()->get_string (),
774 // Look up the implied IDL typedef created in the front end.
775 // It will be the return type of the created operation. The
776 // sequence was originally created with the port prefix (if
777 // any) in its name, so we must use it here.
778 ACE_CString
connections_string (this->ctx_
->port_prefix ());
779 connections_string
+= node
->local_name ()->get_string ();
780 connections_string
+= "Connections";
781 Identifier
connections_id (connections_string
.c_str ());
782 UTL_ScopedName
connections_name (&connections_id
,
784 AST_Decl
*d
= comp_
->lookup_by_name (&connections_name
,
786 be_typedef
*td
= dynamic_cast<be_typedef
*> (d
);
787 connections_id
.destroy ();
789 be_operation
*op
= nullptr;
792 AST_Operation::OP_noflags
,
797 op
->set_name (op_full_name
);
798 op
->set_defined_in (comp_
);
799 op
->set_imported (comp_
->imported ());
801 if (nullptr == comp_
->be_add_operation (op
))
810 be_visitor_ccm_pre_proc::gen_push_op (be_eventtype
*node
,
811 AST_Interface
*consumer
)
813 if (!be_global
->gen_noeventccm ())
815 UTL_ScopedName
*op_full_name
=
816 this->create_scoped_name ("push_",
820 be_operation
*push_op
= nullptr;
821 ACE_NEW_RETURN (push_op
,
822 be_operation (be_global
->void_type (),
823 AST_Operation::OP_noflags
,
828 push_op
->set_defined_in (consumer
);
829 push_op
->set_imported (node
->imported ());
830 push_op
->set_name (op_full_name
);
831 ACE_CString
arg_string ("the_",
834 arg_string
+= node
->local_name ();
835 Identifier
arg_id (arg_string
.fast_rep ());
836 UTL_ScopedName
arg_name (&arg_id
,
838 be_argument
*arg
= nullptr;
840 be_argument (AST_Argument::dir_IN
,
845 push_op
->be_add_argument (arg
);
847 if (nullptr == consumer
->be_add_operation (push_op
))
856 be_visitor_ccm_pre_proc::gen_subscribe (be_publishes
*node
)
858 if ((be_global
->gen_lwccm ()) ||(be_global
->gen_noeventccm ()))
863 UTL_ScopedName
*op_name
=
864 this->create_scoped_name ("subscribe_",
865 node
->local_name ()->get_string (),
868 be_operation
*op
= nullptr;
870 be_operation (this->cookie_
,
871 AST_Operation::OP_noflags
,
876 op
->set_defined_in (comp_
);
877 op
->set_imported (comp_
->imported ());
878 op
->set_name (op_name
);
880 AST_Interface
*i
= this->lookup_consumer (node
);
888 ACE_ERROR_RETURN ((LM_ERROR
,
889 ACE_TEXT ("be_visitor_ccm_pre_proc::")
890 ACE_TEXT ("gen_subscribe - ")
891 ACE_TEXT ("consumer lookup failed\n")),
895 Identifier
arg_id ("consumer");
896 UTL_ScopedName
arg_name (&arg_id
,
898 be_argument
*arg
= nullptr;
900 be_argument (AST_Argument::dir_IN
,
904 op
->be_add_argument (arg
);
905 UTL_ExceptList
*subscribe
= nullptr;
906 ACE_NEW_RETURN (subscribe
,
907 UTL_ExceptList (this->exceeded_connection_limit_
,
910 op
->be_add_exceptions (subscribe
);
912 if (nullptr == comp_
->be_add_operation (op
))
921 be_visitor_ccm_pre_proc::gen_unsubscribe (be_publishes
*node
)
923 if (be_global
->gen_lwccm () ||be_global
->gen_noeventccm ())
928 AST_Interface
*i
= this->lookup_consumer (node
);
932 ACE_ERROR_RETURN ((LM_ERROR
,
933 ACE_TEXT ("be_visitor_ccm_pre_proc::")
934 ACE_TEXT ("gen_unsubscribe - ")
935 ACE_TEXT ("consumer lookup failed\n")),
939 UTL_ScopedName
*op_name
=
940 this->create_scoped_name ("unsubscribe_",
941 node
->local_name ()->get_string (),
944 be_operation
*op
= nullptr;
947 AST_Operation::OP_noflags
,
952 op
->set_defined_in (comp_
);
953 op
->set_imported (comp_
->imported ());
954 op
->set_name (op_name
);
955 Identifier
arg_id ("ck");
956 UTL_ScopedName
arg_name (&arg_id
,
958 be_argument
*arg
= nullptr;
960 be_argument (AST_Argument::dir_IN
,
964 op
->be_add_argument (arg
);
965 UTL_ExceptList
*unsubscribe
= nullptr;
966 ACE_NEW_RETURN (unsubscribe
,
967 UTL_ExceptList (this->invalid_connection_
,
970 op
->be_add_exceptions (unsubscribe
);
972 if (nullptr == comp_
->be_add_operation (op
))
981 be_visitor_ccm_pre_proc::gen_emits_connect (be_emits
*node
)
983 if ((be_global
->gen_lwccm ()) ||(be_global
->gen_noeventccm ()))
988 UTL_ScopedName
*op_name
=
989 this->create_scoped_name ("connect_",
990 node
->local_name ()->get_string (),
993 be_operation
*op
= nullptr;
995 be_operation (be_global
->void_type (),
996 AST_Operation::OP_noflags
,
1001 op
->set_name (op_name
);
1002 op
->set_defined_in (comp_
);
1003 op
->set_imported (comp_
->imported ());
1004 AST_Interface
*i
= this->lookup_consumer (node
);
1012 ACE_ERROR_RETURN ((LM_ERROR
,
1013 ACE_TEXT ("be_visitor_ccm_pre_proc::")
1014 ACE_TEXT ("gen_emits_connect - ")
1015 ACE_TEXT ("consumer lookup failed\n")),
1019 Identifier
arg_id ("consumer");
1020 UTL_ScopedName
arg_name (&arg_id
,
1022 be_argument
*arg
= nullptr;
1023 ACE_NEW_RETURN (arg
,
1024 be_argument (AST_Argument::dir_IN
,
1028 op
->be_add_argument (arg
);
1029 UTL_ExceptList
*emits_connect
= nullptr;
1030 ACE_NEW_RETURN (emits_connect
,
1031 UTL_ExceptList (this->already_connected_
,
1034 op
->be_add_exceptions (emits_connect
);
1036 if (nullptr == comp_
->be_add_operation (op
))
1045 be_visitor_ccm_pre_proc::gen_emits_disconnect (be_emits
*node
)
1047 if ((be_global
->gen_lwccm ()) ||(be_global
->gen_noeventccm ()))
1052 AST_Interface
*i
= this->lookup_consumer (node
);
1056 ACE_ERROR_RETURN ((LM_ERROR
,
1057 ACE_TEXT ("be_visitor_ccm_pre_proc::")
1058 ACE_TEXT ("gen_emits_disconnect - ")
1059 ACE_TEXT ("consumer lookup failed\n")),
1063 UTL_ScopedName
*op_name
=
1064 this->create_scoped_name ("disconnect_",
1065 node
->local_name ()->get_string (),
1068 be_operation
*op
= nullptr;
1071 AST_Operation::OP_noflags
,
1076 op
->set_name (op_name
);
1077 op
->set_defined_in (comp_
);
1078 op
->set_imported (comp_
->imported ());
1079 UTL_ExceptList
*emits_disconnect
= nullptr;
1080 ACE_NEW_RETURN (emits_disconnect
,
1081 UTL_ExceptList (this->no_connection_
,
1084 op
->be_add_exceptions (emits_disconnect
);
1086 if (nullptr == comp_
->be_add_operation (op
))
1095 be_visitor_ccm_pre_proc::gen_get_consumer (be_consumes
*node
)
1097 if (be_global
->gen_lwccm () || be_global
->gen_noeventccm ())
1102 AST_Interface
*i
= this->lookup_consumer (node
);
1106 ACE_ERROR_RETURN ((LM_ERROR
,
1107 ACE_TEXT ("be_visitor_ccm_pre_proc::")
1108 ACE_TEXT ("gen_get_consumer - ")
1109 ACE_TEXT ("consumer lookup failed\n")),
1113 UTL_ScopedName
*op_name
=
1114 this->create_scoped_name ("get_consumer_",
1115 node
->local_name ()->get_string (),
1118 be_operation
*op
= nullptr;
1121 AST_Operation::OP_noflags
,
1126 op
->set_name (op_name
);
1127 op
->set_defined_in (comp_
);
1128 op
->set_imported (comp_
->imported ());
1130 if (nullptr == comp_
->be_add_operation (op
))
1139 be_visitor_ccm_pre_proc::gen_create (be_home
*node
,
1140 AST_Interface
*implicit
)
1142 UTL_ScopedName
*op_name
= this->create_scoped_name (nullptr,
1146 be_operation
*op
= nullptr;
1148 be_operation (node
->managed_component (),
1149 AST_Operation::OP_noflags
,
1154 op
->set_name (op_name
);
1155 AST_Type
*pk
= node
->primary_key ();
1156 UTL_ExceptList
*exceps
= nullptr;
1157 ACE_NEW_RETURN (exceps
,
1158 UTL_ExceptList (this->create_failure_
,
1162 if (pk
!= nullptr && !be_global
->gen_lwccm ())
1164 Identifier
arg_id ("key");
1165 UTL_ScopedName
arg_name (&arg_id
,
1167 AST_Argument
*arg
= nullptr;
1168 ACE_NEW_RETURN (arg
,
1169 be_argument (AST_Argument::dir_IN
,
1174 op
->be_add_argument (arg
);
1176 UTL_ExceptList
*tail
= nullptr;
1177 ACE_NEW_RETURN (tail
,
1178 UTL_ExceptList (this->invalid_key_
,
1181 UTL_ExceptList
*middle
= nullptr;
1182 ACE_NEW_RETURN (middle
,
1183 UTL_ExceptList (this->duplicate_key_value_
,
1186 exceps
->nconc (middle
);
1189 op
->be_add_exceptions (exceps
);
1190 op
->set_defined_in (implicit
);
1191 op
->set_imported (node
->imported ());
1193 if (nullptr == implicit
->be_add_operation (op
))
1202 be_visitor_ccm_pre_proc::gen_find_by_primary_key (be_home
*node
,
1203 AST_Interface
*implicit
)
1205 UTL_ScopedName
*op_name
= this->create_scoped_name (nullptr,
1206 "find_by_primary_key",
1209 be_operation
*op
= nullptr;
1211 be_operation (node
->managed_component (),
1212 AST_Operation::OP_noflags
,
1217 op
->set_name (op_name
);
1218 AST_Type
*pk
= node
->primary_key ();
1219 Identifier
arg_id ("key");
1220 UTL_ScopedName
arg_name (&arg_id
,
1222 AST_Argument
*arg
= nullptr;
1223 ACE_NEW_RETURN (arg
,
1224 be_argument (AST_Argument::dir_IN
,
1229 op
->be_add_argument (arg
);
1231 UTL_ExceptList
*tail
= nullptr;
1232 UTL_ExceptList
*middle
= nullptr;
1234 if (!be_global
->gen_lwccm ())
1236 ACE_NEW_RETURN (tail
,
1237 UTL_ExceptList (this->invalid_key_
,
1240 ACE_NEW_RETURN (middle
,
1241 UTL_ExceptList (this->unknown_key_value_
,
1246 UTL_ExceptList
*exceps
= nullptr;
1247 ACE_NEW_RETURN (exceps
,
1248 UTL_ExceptList (this->finder_failure_
,
1251 op
->be_add_exceptions (exceps
);
1252 op
->set_defined_in (implicit
);
1253 op
->set_imported (node
->imported ());
1255 if (nullptr == implicit
->be_add_operation (op
))
1264 be_visitor_ccm_pre_proc::gen_remove (be_home
*node
,
1265 AST_Interface
*implicit
)
1267 UTL_ScopedName
*op_name
= this->create_scoped_name (nullptr,
1271 be_operation
*op
= nullptr;
1273 be_operation (be_global
->void_type (),
1274 AST_Operation::OP_noflags
,
1279 op
->set_name (op_name
);
1280 AST_Type
*pk
= node
->primary_key ();
1281 Identifier
arg_id ("key");
1282 UTL_ScopedName
arg_name (&arg_id
,
1284 AST_Argument
*arg
= nullptr;
1285 ACE_NEW_RETURN (arg
,
1286 be_argument (AST_Argument::dir_IN
,
1291 op
->be_add_argument (arg
);
1293 UTL_ExceptList
*tail
= nullptr;
1294 UTL_ExceptList
*middle
= nullptr;
1296 if (!be_global
->gen_lwccm ())
1298 ACE_NEW_RETURN (tail
,
1299 UTL_ExceptList (this->invalid_key_
,
1302 ACE_NEW_RETURN (middle
,
1303 UTL_ExceptList (this->unknown_key_value_
,
1308 UTL_ExceptList
*exceps
= nullptr;
1309 ACE_NEW_RETURN (exceps
,
1310 UTL_ExceptList (this->remove_failure_
,
1313 op
->be_add_exceptions (exceps
);
1314 op
->set_defined_in (implicit
);
1315 op
->set_imported (node
->imported ());
1317 if (nullptr == implicit
->be_add_operation (op
))
1326 be_visitor_ccm_pre_proc::gen_get_primary_key (be_home
*node
,
1327 AST_Interface
*implicit
)
1329 UTL_ScopedName
*op_name
= this->create_scoped_name (nullptr,
1333 be_operation
*op
= nullptr;
1335 be_operation (node
->primary_key (),
1336 AST_Operation::OP_noflags
,
1341 op
->set_name (op_name
);
1342 Identifier
arg_id ("comp");
1343 UTL_ScopedName
arg_name (&arg_id
,
1345 AST_Argument
*arg
= nullptr;
1346 ACE_NEW_RETURN (arg
,
1347 be_argument (AST_Argument::dir_IN
,
1348 node
->managed_component (),
1352 op
->be_add_argument (arg
);
1353 op
->set_defined_in (implicit
);
1354 op
->set_imported (node
->imported ());
1356 if (nullptr == implicit
->be_add_operation (op
))
1365 be_visitor_ccm_pre_proc::gen_extended_port (be_porttype
*pt
)
1367 if (this->visit_scope (pt
) == -1)
1369 ACE_ERROR_RETURN ((LM_ERROR
,
1370 ACE_TEXT ("be_visitor_ccm_pre_proc::")
1371 ACE_TEXT ("gen_extended_port - ")
1372 ACE_TEXT ("visit_scope for porttype failed\n")),
1380 be_visitor_ccm_pre_proc::lookup_cookie ()
1382 if (this->cookie_
== nullptr)
1384 Identifier
local_id ("Cookie");
1385 UTL_ScopedName
local_name (&local_id
,
1387 UTL_ScopedName
cookie_name (&this->module_id_
,
1390 idl_global
->root ()->lookup_by_name (&cookie_name
,
1392 local_id
.destroy ();
1396 idl_global
->err ()->lookup_error (&cookie_name
);
1400 this->cookie_
= dynamic_cast<be_valuetype
*> (d
);
1402 if (this->cookie_
== nullptr)
1404 idl_global
->err ()->valuetype_expected (d
);
1413 be_visitor_ccm_pre_proc::lookup_exceptions ()
1417 for (int i
= 0; i
< N_LW_EXCEPS
; ++i
)
1419 status
= this->lookup_one_exception (LW_EXCEP_NAMES
[i
],
1428 this->already_connected_
= LW_EXCEPS
[0];
1429 this->invalid_connection_
= LW_EXCEPS
[1];
1430 this->no_connection_
= LW_EXCEPS
[2];
1431 this->exceeded_connection_limit_
= LW_EXCEPS
[3];
1432 this->create_failure_
= LW_EXCEPS
[4];
1433 this->remove_failure_
= LW_EXCEPS
[5];
1434 this->finder_failure_
= LW_EXCEPS
[6];
1436 if (!be_global
->gen_lwccm ())
1438 for (int j
= 0; j
< N_ADDL_EXCEPS
; ++j
)
1440 status
= this->lookup_one_exception (ADDL_EXCEP_NAMES
[j
],
1449 this->invalid_key_
= ADDL_EXCEPS
[0];
1450 this->unknown_key_value_
= ADDL_EXCEPS
[1];
1451 this->duplicate_key_value_
= ADDL_EXCEPS
[2];
1458 be_visitor_ccm_pre_proc::lookup_one_exception (const char *name
,
1459 be_exception
*&result
)
1461 Identifier
id (name
);
1462 UTL_ScopedName
local_name (&id
,
1464 UTL_ScopedName
scoped_name (&this->module_id_
,
1467 idl_global
->root ()->lookup_by_name (&scoped_name
,
1473 idl_global
->err ()->lookup_error (&scoped_name
);
1477 result
= dynamic_cast<be_exception
*> (d
);
1479 if (result
== nullptr)
1488 be_visitor_ccm_pre_proc::create_event_consumer (be_eventtype
*node
)
1490 UTL_Scope
*s
= node
->defined_in ();
1492 UTL_ScopedName
*consumer_name
=
1493 this->create_scoped_name (nullptr,
1494 node
->local_name (),
1496 ScopeAsDecl (node
->defined_in ()));
1498 /// We need to create event consumers even for forward
1499 /// declared eventtypes. Since forward declarations can
1500 /// appear any number of times, we need to check that this
1501 /// event consumer hasn't already been created.
1502 if (s
->lookup_by_name (consumer_name
, true) != nullptr)
1507 AST_Interface
*event_consumer
= nullptr;
1508 AST_Module
*m
= dynamic_cast<AST_Module
*> (s
);
1510 // We're at global scope here so we need to fool the scope stack
1511 // for a minute so the correct repo id can be calculated at
1512 // interface construction time.
1513 idl_global
->scopes ().push (s
);
1515 Identifier
parent_id ("EventConsumerBase");
1516 UTL_ScopedName
parent_local_name (&parent_id
,
1518 UTL_ScopedName
parent_full_name (&this->module_id_
,
1519 &parent_local_name
);
1520 UTL_NameList
parent_list (&parent_full_name
,
1522 FE_InterfaceHeader
header (consumer_name
,
1527 ACE_NEW_RETURN (event_consumer
,
1528 be_interface (header
.name (),
1530 header
.n_inherits (),
1531 header
.inherits_flat (),
1532 header
.n_inherits_flat (),
1536 parent_id
.destroy ();
1539 idl_global
->scopes ().pop ();
1541 event_consumer
->set_defined_in (s
);
1542 event_consumer
->set_imported (node
->imported ());
1543 event_consumer
->set_name (consumer_name
);
1545 dynamic_cast<be_interface
*> (event_consumer
);
1546 bec
->original_interface (node
);
1548 // Set repo id to 0, so it will be recomputed on the next access,
1549 // and set the prefix to the eventtype's prefix. All this is
1550 // necessary in case the eventtype's prefix was modified after
1551 // its declaration. We assume 'implied IDL' means that the
1552 // derived event consumer interface should have the same prefix.
1553 event_consumer
->repoID (nullptr);
1554 event_consumer
->prefix (const_cast<char*> (node
->prefix ()));
1556 dynamic_cast<be_type
*> (event_consumer
)->gen_fwd_helper_name ();
1557 m
->be_add_interface (event_consumer
);
1558 return this->gen_push_op (node
,
1563 be_visitor_ccm_pre_proc::lookup_consumer (be_field
*node
)
1565 AST_Type
*impl
= node
->field_type ();
1566 ACE_CString
rettype_string (impl
->local_name ()->get_string ());
1567 rettype_string
+= "Consumer";
1568 Identifier
rettype_id (rettype_string
.fast_rep ());
1570 impl
->defined_in ()->lookup_by_name_local (&rettype_id
, false);
1571 rettype_id
.destroy ();
1578 AST_Interface
*i
= dynamic_cast<AST_Interface
*> (d
);
1582 idl_global
->err ()->interface_expected (d
);
1590 be_visitor_ccm_pre_proc::create_explicit (be_home
*node
)
1592 be_visitor_xplicit_pre_proc
v (this->ctx_
);
1594 if (v
.visit_home (node
) != 0)
1596 ACE_ERROR_RETURN ((LM_ERROR
,
1597 ACE_TEXT ("be_visitor_ccm_pre_proc::")
1598 ACE_TEXT ("create_explicit - ")
1599 ACE_TEXT ("home xplicit visitor failed\n")),
1603 return v
.xplicit ();
1607 be_visitor_ccm_pre_proc::create_implicit (be_home
*node
)
1609 Identifier
*parent_id
= nullptr;
1610 ACE_NEW_RETURN (parent_id
,
1611 Identifier ("KeylessCCMHome"),
1614 UTL_ScopedName
*parent_local_name
= nullptr;
1615 ACE_NEW_RETURN (parent_local_name
,
1616 UTL_ScopedName (parent_id
, nullptr),
1619 UTL_ScopedName
*parent_full_name
= nullptr;
1620 ACE_NEW_RETURN (parent_full_name
,
1621 UTL_ScopedName (this->module_id_
.copy (),
1625 UTL_NameList
parent_list (parent_full_name
, nullptr);
1627 UTL_NameList
*parent_list_ptr
= nullptr;
1629 if (node
->primary_key () == nullptr)
1631 parent_list_ptr
= &parent_list
;
1634 FE_InterfaceHeader
header (nullptr,
1640 // We're at global scope here so we need to fool the scope stack
1641 // for a minute so the correct repo id can be calculated at
1642 // interface construction time.
1643 idl_global
->scopes ().push (node
->defined_in ());
1645 UTL_ScopedName
*implicit_name
=
1646 this->create_scoped_name (nullptr,
1647 node
->local_name (),
1649 ScopeAsDecl (node
->defined_in ()));
1651 be_interface
*i
= nullptr;
1653 be_interface (implicit_name
,
1655 header
.n_inherits (),
1656 header
.inherits_flat (),
1657 header
.n_inherits_flat (),
1663 idl_global
->scopes ().pop ();
1666 parent_list
.destroy ();
1668 // So we can generate the proper typecode.
1669 i
->home_equiv (true);
1671 i
->set_name (implicit_name
);
1672 i
->set_defined_in (node
->defined_in ());
1673 i
->set_imported (node
->imported ());
1675 i
->gen_fwd_helper_name ();
1676 i
->original_interface (node
);
1677 AST_Module
*m
= dynamic_cast<AST_Module
*> (node
->defined_in ());
1678 m
->be_add_interface (i
);
1684 be_visitor_ccm_pre_proc::create_equivalent (be_home
*node
,
1685 AST_Interface
*xplicit
,
1686 AST_Interface
*implicit
)
1688 UTL_Scope
*s
= node
->defined_in ();
1689 UTL_ScopedName
*equiv_name
=
1690 this->create_scoped_name (nullptr,
1691 node
->local_name (),
1694 UTL_NameList
tail (implicit
->name (),
1696 UTL_NameList
parent_list (xplicit
->name (),
1698 FE_InterfaceHeader
header (nullptr,
1704 // We're at global scope here so we need to fool the scope stack
1705 // for a minute so the correct repo id can be calculated at
1706 // interface construction time.
1707 idl_global
->scopes ().push (node
->defined_in ());
1709 be_interface
*retval
= nullptr;
1710 ACE_NEW_RETURN (retval
,
1711 be_interface (equiv_name
,
1713 header
.n_inherits (),
1714 header
.inherits_flat (),
1715 header
.n_inherits_flat (),
1721 idl_global
->scopes ().pop ();
1723 // So we can generate the proper typecode.
1724 retval
->home_equiv (true);
1726 retval
->set_name (equiv_name
);
1727 retval
->set_defined_in (s
);
1728 retval
->set_imported (node
->imported ());
1729 retval
->gen_fwd_helper_name ();
1730 retval
->original_interface (node
);
1732 UTL_ScopedName
*unmangled_name
=
1733 static_cast<UTL_ScopedName
*> (node
->name ()->copy ());
1734 UTL_ScopedName
*mangled_name
=
1735 this->create_scoped_name (nullptr,
1736 node
->local_name (),
1737 "_tao_home_name_extension",
1739 node
->set_name (mangled_name
);
1740 AST_Module
*m
= dynamic_cast<AST_Module
*> (s
);
1742 /// Calling be_add_interface() here calls add_to_referenced(),
1743 /// which will give a redef error.
1744 m
->add_to_scope (retval
);
1746 node
->set_name (unmangled_name
);
1751 be_visitor_ccm_pre_proc::create_scoped_name (const char *prefix
,
1752 const char *local_name
,
1756 ACE_CString
local_string (prefix
,
1759 local_string
+= local_name
;
1760 local_string
+= suffix
;
1761 Identifier
*local_id
= nullptr;
1762 ACE_NEW_RETURN (local_id
,
1763 Identifier (local_string
.fast_rep ()),
1765 UTL_ScopedName
*last_segment
= nullptr;
1766 ACE_NEW_RETURN (last_segment
,
1767 UTL_ScopedName (local_id
,
1770 UTL_ScopedName
*full_name
=
1771 static_cast<UTL_ScopedName
*> (parent
->name ()->copy ());
1772 full_name
->nconc (last_segment
);
1777 be_visitor_ccm_pre_proc::compute_inheritance (be_home
*node
)
1779 UTL_NameList
*retval
= nullptr;
1781 if (node
->base_home () == nullptr)
1783 Identifier
*local_id
= nullptr;
1784 ACE_NEW_RETURN (local_id
,
1785 Identifier ("CCMHome"),
1787 UTL_ScopedName
*local_name
= nullptr;
1788 ACE_NEW_RETURN (local_name
,
1789 UTL_ScopedName (local_id
,
1792 UTL_ScopedName
*full_name
= nullptr;
1793 ACE_NEW_RETURN (full_name
,
1794 UTL_ScopedName (this->module_id_
.copy (),
1797 ACE_NEW_RETURN (retval
,
1798 UTL_NameList (full_name
,
1804 ACE_CString
new_local (
1805 node
->base_home ()->local_name ()->get_string ()
1807 new_local
+= "Explicit";
1808 UTL_ScopedName
*parent_name
=
1809 static_cast<UTL_ScopedName
*> (node
->base_home ()->name ()->copy ());
1810 parent_name
->last_component ()->replace_string (new_local
.c_str ());
1811 ACE_NEW_RETURN (retval
,
1812 UTL_NameList (parent_name
,
1817 long n_supports
= node
->n_inherits ();
1818 UTL_ScopedName
*supported_name
= nullptr;
1819 UTL_NameList
*conc_value
= nullptr;
1821 for (long i
= 0; i
< n_supports
; ++i
)
1824 static_cast<UTL_ScopedName
*> (node
->inherits ()[i
]->name ()->copy ());
1825 ACE_NEW_RETURN (conc_value
,
1826 UTL_NameList (supported_name
,
1829 retval
->nconc (conc_value
);
1836 be_visitor_ccm_pre_proc::generate_ami4ccm_uses ()
1838 /// The interfaces in the list below are from this IDL file,
1839 /// which then must be processed with the -GC option, so we
1840 /// know we'll get here - a good place to generate the *A.idl
1841 /// file containing the local interfaces and connector
1842 /// associated with each interface in the list.
1844 ACE_Unbounded_Queue
<char *> &ccm_ami_receps
=
1845 idl_global
->ciao_ami_recep_names ();
1847 /// If the queue is empty, we're done.
1848 if (ccm_ami_receps
.size () == 0)
1853 for (ACE_Unbounded_Queue
<char *>::CONST_ITERATOR
i (
1858 char **item
= nullptr;
1861 UTL_ScopedName
*sn
=
1862 FE_Utils::string_to_scoped_name (*item
);
1865 idl_global
->scopes ().top_non_null ();
1867 AST_Decl
*d
= s
->lookup_by_name (sn
, true);
1871 idl_global
->err ()->lookup_error (sn
);
1884 be_uses
*u
= dynamic_cast<be_uses
*> (d
);
1888 ACE_ERROR_RETURN ((LM_ERROR
,
1889 ACE_TEXT ("be_visitor_ccm_pre_proc")
1890 ACE_TEXT ("::generate_ami4ccm_uses - ")
1891 ACE_TEXT ("narrow to receptacle ")
1892 ACE_TEXT ("failed\n")),
1896 be_interface
*iface
=
1897 dynamic_cast<be_interface
*> (u
->uses_type ());
1899 /// The real AMI_xxx exists only in the *A.idl file, so
1900 /// we create a dummy as the uses type for the implied
1901 /// receptacle created below, but only if it hasn't
1902 /// already been created for this uses type.
1904 be_interface
*ami_iface
=
1905 dynamic_cast<be_interface
*> (iface
->ami4ccm_uses ());
1907 if (ami_iface
== nullptr)
1909 ACE_CString
iname ("AMI4CCM_");
1911 iname
+= iface
->local_name ();
1912 Identifier
itmp_id (iname
.c_str ());
1913 UTL_ScopedName
itmp_sn (&itmp_id
, nullptr);
1915 s
= iface
->defined_in ();
1916 idl_global
->scopes ().push (s
);
1917 ACE_NEW_RETURN (ami_iface
,
1918 be_interface (&itmp_sn
,
1927 idl_global
->scopes ().pop ();
1929 /// Make it imported so it doesn't trigger
1930 /// any unwanted code generation.
1931 ami_iface
->set_imported (true);
1933 s
->add_to_scope (ami_iface
);
1934 iface
->ami4ccm_uses (ami_iface
);
1937 /// Now create the receptacle, passing in
1938 /// the local interface created above as the
1939 /// uses type. We don't generate anything
1940 /// in the main IDL file from the interface's
1941 /// contents, so it's ok that it's empty.
1943 ACE_CString
uname ("sendc_");
1944 uname
+= u
->local_name ()->get_string ();
1945 Identifier
utmp_id (uname
.c_str ());
1946 UTL_ScopedName
utmp_sn (&utmp_id
, nullptr);
1948 s
= u
->defined_in ();
1949 idl_global
->scopes ().push (s
);
1950 be_uses
*ami_uses
= nullptr;
1951 ACE_NEW_RETURN (ami_uses
,
1957 s
->add_to_scope (ami_uses
);
1958 idl_global
->scopes ().pop ();
1960 if (u
->is_multiple ())
1963 AST_Type *t = u->uses_type ();
1964 ACE_CString fname (t->file_name ());
1966 char *path = ACE_OS::realpath (fname.c_str (), dummy);
1967 ACE_DEBUG ((LM_DEBUG, "utype file: %s\n", path));
1969 // Grammar ensures this narrowing will never be 0.
1971 dynamic_cast<AST_Component
*> (s
);
1972 FE_Utils::create_uses_multiple_stuff (c
, ami_uses
);