summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp')
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp76
1 files changed, 71 insertions, 5 deletions
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp
index cebf4c53513..7c472e441d8 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp
@@ -18,9 +18,9 @@
//
// ============================================================================
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
+#include "idl.h"
+#include "idl_extern.h"
+#include "be.h"
#include "be_visitor_interface.h"
@@ -184,10 +184,76 @@ be_visitor_interface_cs::visit_interface (be_interface *node)
ACE_ERROR_RETURN ((LM_ERROR,
"(%N:%l) be_visitor_interface_cs::"
"visit_interface - "
- "TypeCode definition failed\n"
- ), -1);
+ "TypeCode definition failed\n"),
+ -1);
}
+ // AMI
+
+ // Generate code for the AMI Reply Handler.
+ if (idl_global->ami_call_back () == I_TRUE)
+ {
+ // = Generate the default stub code for Handler.
+
+ // Set the context.
+ be_visitor_context ctx (*this->ctx_);
+
+ // Set the state.
+ ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_STUB_CS);
+
+ // Create the visitor.
+ be_visitor *visitor = tao_cg->make_visitor (&ctx);
+ if (!visitor)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_interface_cs::"
+ "visit_interface - "
+ "Bad visitor\n"),
+ -1);
+ }
+
+ // Call the visitor on this interface.
+ if (node->accept (visitor) == -1)
+ {
+ delete visitor;
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_interface_cs::"
+ "visit_interface - "
+ "code gen for ami handler default stub failed\n"),
+ -1);
+ }
+ delete visitor;
+
+ // = Generate the Servant Skeleton code.
+ // Set the context.
+ ctx = *this->ctx_;
+
+ // Set the state.
+ ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_SERVANT_CS);
+
+ // Create the visitor.
+ visitor = tao_cg->make_visitor (&ctx);
+ if (!visitor)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_interface_cs::"
+ "visit_interface - "
+ "Bad visitor\n"),
+ -1);
+ }
+
+ // Call the visitor on this interface.
+ if (node->accept (visitor) == -1)
+ {
+ delete visitor;
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_interface_cs::"
+ "visit_interface - "
+ "code gen for ami handler failed\n"),
+ -1);
+ }
+ delete visitor;
+ }
return 0;
}