summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL/include/utl_scope.h
diff options
context:
space:
mode:
authorsma <sma@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2010-05-27 13:52:07 +0000
committersma <sma@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2010-05-27 13:52:07 +0000
commit86260a3d6790f81a13c97064a9bd720a99de1f82 (patch)
tree596c23a59a033023a53419eecf39935abc216979 /TAO/TAO_IDL/include/utl_scope.h
parent158c8dfb021c8448596b5635d369024c69aca5e6 (diff)
downloadATCD-86260a3d6790f81a13c97064a9bd720a99de1f82.tar.gz
ChangeLogTag: Thu May 27 13:53:00 UTC 2010 Simon Massey <sma at prismtech dot com>
Diffstat (limited to 'TAO/TAO_IDL/include/utl_scope.h')
-rw-r--r--TAO/TAO_IDL/include/utl_scope.h107
1 files changed, 23 insertions, 84 deletions
diff --git a/TAO/TAO_IDL/include/utl_scope.h b/TAO/TAO_IDL/include/utl_scope.h
index 1164f091b00..6fa5da565f0 100644
--- a/TAO/TAO_IDL/include/utl_scope.h
+++ b/TAO/TAO_IDL/include/utl_scope.h
@@ -151,9 +151,6 @@ public:
IK_both // Iterate through both decls and local types.
, IK_decls // Iterate only through decls.
, IK_localtypes // Iterate only through local types.
-
- // End users should not use this value directly
- , IK_both_local // (Same as IK_both)
};
// Operations.
@@ -519,97 +516,39 @@ private:
class TAO_IDL_FE_Export UTL_ScopeActiveIterator
{
public:
- // data members:
- // Scope to iterate over.
- UTL_Scope *source_;
+ // Operations.
- // What stage?
- UTL_Scope::ScopeIterationKind stage_;
+ // Constructor.
+ UTL_ScopeActiveIterator (UTL_Scope *s,
+ UTL_Scope::ScopeIterationKind ik);
- // How many items left in this stage
- unsigned long limit_;
+ // Advance to next item.
+ void next (void);
- // The current item
- AST_Decl **item_;
+ // Get current item.
+ AST_Decl *item (void);
-public:
- // Constructors.
- UTL_ScopeActiveIterator ()
- : stage_ (UTL_Scope::IK_decls),
- limit_ (0)
- {}
+ // Have we iterated over entire scope?
+ bool is_done (void);
- UTL_ScopeActiveIterator (UTL_Scope *s,
- const UTL_Scope::ScopeIterationKind k)
- : source_ (s),
- stage_ ((UTL_Scope::IK_both == k && source_->pd_locals_used)
- ? UTL_Scope::IK_both_local
- : k),
- limit_ ((UTL_Scope::IK_decls == stage_ ||
- UTL_Scope::IK_both == stage_ )
- ? source_->pd_decls_used
- : source_->pd_locals_used),
- item_ ((UTL_Scope::IK_decls == stage_ ||
- UTL_Scope::IK_both == stage_ )
- ? source_->pd_decls
- : source_->pd_local_types)
- {}
+ // What kind of iterator is this?
+ UTL_Scope::ScopeIterationKind iteration_kind (void);
- // Advance to next item.
- void next (void)
- {
- // If not done
- if (this->limit_)
- {
- if (--this->limit_)
- {
- // Still more left, so advance to next item
- ++this->item_;
- }
- // Out of data in this stage, move onto another?
- else if (UTL_Scope::IK_both_local == this->stage_)
- {
- // Switch to next stage. Note that IK_both
- // is the same as IK_decls but also notes
- // that both types were being asked for!
- this->stage_ = UTL_Scope::IK_both;
- this->limit_ = this->source_->pd_decls_used;
- this->item_ = source_->pd_decls;
- }
- }
- }
+ // What stage are we in with this iterator?
+ UTL_Scope::ScopeIterationKind iteration_stage (void);
- // Get the current item.
- AST_Decl *item (void)
- {
- return (this->limit_) ? *this->item_ : 0;
- }
+private:
+ // Scope to iterate over.
+ UTL_Scope *iter_source;
- // Have we iterated over the entire scope?
- bool is_done (void)
- {
- return !this->limit_;
- }
+ // What kind of iteration?
+ UTL_Scope::ScopeIterationKind ik;
- // What kind of iterator is this?
- UTL_Scope::ScopeIterationKind iteration_kind (void)
- {
- return (UTL_Scope::IK_decls == this->stage_ ||
- UTL_Scope::IK_localtypes == this->stage_ )
- ? this->stage_
- : UTL_Scope::IK_both;
- }
+ // What stage?
+ UTL_Scope::ScopeIterationKind stage;
- // What stage are we at with this iterator?
- UTL_Scope::ScopeIterationKind iteration_stage (void)
- {
- return (UTL_Scope::IK_decls == this->stage_ ||
- UTL_Scope::IK_localtypes == this->stage_ )
- ? this->stage_
- : (UTL_Scope::IK_both == this->stage_)
- ? UTL_Scope::IK_decls
- : UTL_Scope::IK_localtypes;
- }
+ // What location in stage?
+ long il;
};
#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)