Open CASCADE Technology 6.6.0
Public Member Functions | Protected Attributes
NIS_ObjectsIterator Class Reference

#include <NIS_ObjectsIterator.hxx>

Public Member Functions

 NIS_ObjectsIterator ()
 NIS_ObjectsIterator (const Handle_NIS_InteractiveContext &theCtx)
void Initialize (const Handle_NIS_InteractiveContext &theCtx)
Standard_Boolean More () const
const
Handle_NIS_InteractiveObject & 
Value () const
void Next ()

Protected Attributes

NCollection_SparseArray
< Handle_NIS_InteractiveObject >
::ConstIterator 
myIter

Detailed Description

Iterator of objects contained in a NIS_InteractiveContext instance. The iteration is always in the ascending sense of object ID. Examples:

    // Erase all objects in the Context
 NIS_ObjectsIterator anIter (myContext);
 for (; anIter.More(); anIter.Next())
   myContext->Erase (anIter.Value(), Standard_False);

    // Set object attributes to their IDs (hardly useful outside the example)
 anIter.Initialize (myContext);
 Handle(NIS_InteractiveObject) anObj;
 while (!(anObj = anIter.Value().IsNull())) {
   anObj->SetAttribute (static_cast<void *> (anObj->ID()));
   anIter.Next();
 }

Constructor & Destructor Documentation

NIS_ObjectsIterator::NIS_ObjectsIterator ( ) [inline]

Empty Constructor.

NIS_ObjectsIterator::NIS_ObjectsIterator ( const Handle_NIS_InteractiveContext &  theCtx) [inline]

Constructor.

Parameters:
theCtxInteractive context that is to be iterated for all objects.

Member Function Documentation

void NIS_ObjectsIterator::Initialize ( const Handle_NIS_InteractiveContext &  theCtx)

Reset the Iterator to start the iterations of objects.

Parameters:
theCtxInteractive context that is to be iterated for all objects.
Standard_Boolean NIS_ObjectsIterator::More ( void  ) const [inline]

Query if the Iterator has an object (not yet finished the iteration process).

void NIS_ObjectsIterator::Next ( )

Step forward to the next valid InteractiveObject instance.

const Handle_NIS_InteractiveObject& NIS_ObjectsIterator::Value ( ) const

Returns the current object at the iteration pointer. If the iteration is over (More() == False) this method returns NULL Handle.


Field Documentation

NCollection_SparseArray<Handle_NIS_InteractiveObject>::ConstIterator NIS_ObjectsIterator::myIter [protected]

The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines