summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL/be/be_operation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/TAO_IDL/be/be_operation.cpp')
-rw-r--r--TAO/TAO_IDL/be/be_operation.cpp47
1 files changed, 45 insertions, 2 deletions
diff --git a/TAO/TAO_IDL/be/be_operation.cpp b/TAO/TAO_IDL/be/be_operation.cpp
index 89d1b325b6a..b9c385b75d6 100644
--- a/TAO/TAO_IDL/be/be_operation.cpp
+++ b/TAO/TAO_IDL/be/be_operation.cpp
@@ -30,7 +30,8 @@ ACE_RCSID(be, be_operation, "$Id$")
*/
be_operation::be_operation (void)
: argument_count_ (-1),
- has_native_ (0)
+ has_native_ (0),
+ strategy_ (new be_operation_default_strategy (this))
{
}
@@ -40,10 +41,20 @@ be_operation::be_operation (AST_Type *rt, AST_Operation::Flags fl,
AST_Decl (AST_Decl::NT_op, n, p),
UTL_Scope (AST_Decl::NT_op),
argument_count_ (-1),
- has_native_ (0)
+ has_native_ (0),
+ strategy_ (new be_operation_default_strategy (this))
{
}
+
+be_operation::~be_operation (void)
+{
+ // We know that it cannot be 0, but..
+ if (!this->strategy_)
+ delete this->strategy_;
+}
+
+
// compute total number of members
int
be_operation::compute_argument_attr (void)
@@ -172,6 +183,38 @@ be_operation::accept (be_visitor *visitor)
return visitor->visit_operation (this);
}
+be_operation_strategy *
+be_operation::set_strategy (be_operation_strategy *new_strategy)
+{
+ be_operation_strategy *old = this->strategy_;
+
+ if (new_strategy != 0)
+ this->strategy_ = new_strategy;
+
+ return old;
+}
+
+
+TAO_CodeGen::CG_STATE
+be_operation::next_state (TAO_CodeGen::CG_STATE current_state,
+ int is_extra_state)
+{
+ return this->strategy_->next_state (current_state, is_extra_state);
+}
+
+int
+be_operation::has_extra_code_generation (TAO_CodeGen::CG_STATE current_state)
+{
+ return this->strategy_->has_extra_code_generation (current_state);
+}
+
+be_operation*
+be_operation::hidden_operation ()
+{
+ return this->strategy_->hidden_operation ();
+}
+
+
// Narrowing
IMPL_NARROW_METHODS3 (be_operation, AST_Operation, be_scope, be_decl)
IMPL_NARROW_FROM_DECL (be_operation)