//*-- Author : Valeriy Onuchin 11/09/2000 
//
//
////////////////////////////////////////////////////////////////////////////////
//
//    The set of class iterators: 
//
// rooAttributeItr corresponds to      attribute_iterator
// rooInheritanceItr corresponds to    inheritance_iterator
// rooRelationshipItr corresponds to   relationship_iterator
// rooCollectionTypeItr corresponds to collection_type_iterator
// rooRefTypeItr corresponds to        ref_type_iterator
// rooPropertyItr corresponds to       property_iterator
// rooModuleItr corresponds to         module_iterator
// rooMetaObjecItrt corresponds to     meta_object_iterator
// rooTypeItr corresponds to           type_iterator
//
////////////////////////////////////////////////////////////////////////////////
//
// Each iterator iterates through lists of 
// elements of the same data type. That list is called the iterator's 
// iteration list. During iteration, the list iterator keeps track of its 
// position within its iteration list. The element at the current position 
// is called the iterator's current element.
//
//______________________________________________________________________________
//
//             Obtaining List Iterators
//
// You should not directly instantiate any of the classes created from this 
// template. Instead, you work with iterators returned by various member 
// functions. An iterator of any class in the preceding table is obtained from 
// a descriptor and iterates over an internal list maintained by that
// descriptor.
//
//______________________________________________________________________________
//
//             Attribute Iterators
//
// You can call the defines_attribute_begin member function of a class
// descriptor to obtain an attribute iterator for attributes defined in the
// described class (including relationships and embedded-class attributes 
// corresponding to base classes). You can test for that iterator's termination 
// condition by comparing it with the attribute iterator returned by the same 
// class descriptor's defines_attribute_end member function.
//
//______________________________________________________________________________
//
//             Collection-Type Iterators
//
// You can call the used_in_collection_type_begin member function of a type
// descriptor to obtain a collection-type iterator for collection types using 
// the described type (for example, as their element type). You can test for 
// that iterator's termination condition by comparing it with the 
// collection-type iterator returned by the same type descriptor's 
// used_in_collection_type_end member function.
//
//______________________________________________________________________________
//
//             Inheritance Iterators
//
// You can call the base_class_list_begin member function of a class 
// descriptor to obtain an inheritance iterator for inheritance connections 
// between the described class and its immediate parent classes. You can test
// for that iterator's termination condition by comparing it with the 
// inheritance iterator returned by the same class descriptor's 
// base_class_list_begin member function. You can call the 
// sub_class_list_begin member function of a class descriptor
// to obtain an inheritance iterator for inheritance connections between 
// the described class and its child classes. You can test for that 
// iterator's termination condition by comparing it with the inheritance 
// iterator returned by the same class descriptor's sub_class_list_end member 
// function.
//
//______________________________________________________________________________
//
//             Module Iterators
//
// You can call the named_modules_begin member function of a module descriptor
// for the top-level module to obtain a module iterator for named modules in 
// the schema. You can test for that iterator's termination condition by 
// comparing it with the module iterator returned by the same module 
// descriptor's named_modules_begin member function.
//
//______________________________________________________________________________
//
//             Property Iterators
//
// You can call the used_in_property_begin member function of a type
// descriptor to obtain a property iterator for properties using the described 
// type. You can test for that iterator's termination condition by comparing 
// it with the property iterator returned by the same type descriptor's
// used_in_property_end member function.
//
//______________________________________________________________________________
//
//             Proposed-Base-Class Iterators (not implemented)
//
// You can call the base_class_list_begin member function of a proposed class
// to obtain a proposed-base-class iterator for the base classes of the 
// proposed class. You can test for that iterator's termination condition by 
// comparing it with the proposed-base-class iterator returned by the same 
// proposed class's base_class_list_begin member function.
//
//______________________________________________________________________________
//
//             Proposed-Class Iterators (not implemented)
//
// You can call the proposed_classes_begin member function of a module
// descriptor to obtain a proposed-class iterator for the proposed classes 
// in the proposal list of the described module. You can test for that 
// iterator's termination condition by comparing it with the proposed-class 
// iterator returned by the same module descriptor's proposed_classes_begin 
// member function.
//
//______________________________________________________________________________
//
//             Proposed-Property Iterators (not implemented)
//
// You can call the defines_property_begin member function of a proposed class
// to obtain a proposed-property iterator for the properties of the 
// proposed class. You can test for that iterator's termination condition 
// by comparing it with the proposed-base-class iterator returned by the
//  same proposed class's defines_property_end member function.
//
//______________________________________________________________________________
//
//             Reference-Type Iterators
//
// You can call the used_in_ref_type_begin member function of a type
// descriptor to obtain a reference-type iterator for reference types using 
// the described type. You can test for that iterator's termination condition
// by comparing it with the reference-type iterator returned by the same type
// descriptor's used_in_ref_type_end member function.
//
//______________________________________________________________________________
//
//             Relationship Iterators
//
// You can call the defines_relationship_begin member function of a class
// descriptor to obtain a relationship iterator for relationships defined 
// in the described class. You can test for that iterator's termination 
// condition by comparing it with the relationship iterator returned by 
// the same class descriptor's defines_relationship_end member function.
//
//______________________________________________________________________________
//
//             Descriptor Iterators
//
// The class rooMetaObjectItr represents iterators for descriptors of entities
// in a given scope. An instance of this class is called a descriptor iterator.
// of member functions
// 
// A descriptor iterator steps through the entities in the scope of some 
// particular module or class. That collection of entities is called the 
// iterator's iteration set; during iteration, the descriptor iterator keeps
// track of its position within its iteration set. The element at the current
// position is called the iterator's current element. The descriptor iterator 
// allows you to step through the iteration set, obtaining a descriptor for 
// the current element at each step. 
// You should not instantiate this class directly. Instead, you work with 
// descriptor iterators returned by the following member functions:
//
//    The defines_begin member function of a module descriptor returns a
//    descriptor iterator for the entities in the scope of the described 
//    module. You can test for that iterator's termination condition by 
//    comparing it with the descriptor iterator returned by the same module 
//    descriptor's defines_end member function.
//
//    The defines_begin member function of a class descriptor returns a
//    descriptor iterator for the properties of the described class. 
//    You can test for that   iterator's termination condition by comparing 
//    it with the descriptor iterator returned by the same class descriptor's 
//    defines_end member function.
//
//______________________________________________________________________________
//
//             About Type Iterators
//
// A type iterator steps through the types in the scope of some particular 
// module. That collection of types is called the iterator's iteration set; 
// during iteration, the type iterator keeps track of its position within its 
// iteration set. The element at the current position is called the iterator's 
// current element. The type iterator allows you to step through the iteration 
// set, obtaining a descriptor for the current element at each step.
// You should not instantiate this class directly. Instead, you call the
// defines_types_begin() member function of a module descriptor to get 
// a type iterator for the types in the scope of the described module. 
// You can test for that iterator's termination condition by comparing it with 
// the type iterator returned by the same module descriptor's 
// defines_types_end member function.


#include <ooas.h>
#include <oo.h>
#include "rooObjy.h"

ClassImp(rooAttributeItr)
ClassImp(rooInheritanceItr)
ClassImp(rooRelationshipItr)
ClassImp(rooCollectionTypeItr)
ClassImp(rooRefTypeItr)
ClassImp(rooPropertyItr)
ClassImp(rooModuleItr)
ClassImp(rooMetaObjectItr)
ClassImp(rooTypeItr)

//////////////////////////////// Iterators /////////////////////////////////////
#define IMPLEMENT_ITR(OBJ,ITR)                  \
OBJ##Itr::OBJ##Itr()                            \
{                                               \
   fImp = new ITR();                            \
   fObj = new OBJ();                            \
}                                               \
                                                \
OBJ##Itr::OBJ##Itr(const OBJ##Itr& in)          \
{                                               \
   fImp = new ITR(*((ITR*)in.getImp()));        \
   fObj = new OBJ();                            \
}                                               \
                                                \
OBJ##Itr::~OBJ##Itr()                           \
{                                               \
   fImp = 0;                                    \
}                                               \
                                                \
OBJ##Itr & OBJ##Itr::operator=(const OBJ##Itr & in)  \
{                                               \
   *((ITR*)fImp) = *((ITR*)in.getImp());        \
   return *this;                                \
}                                               \
                                                \
Bool_t OBJ##Itr::operator==(const OBJ##Itr & in) const \
{                                                  \
   return *((const ITR*)fImp) == *((const ITR*)in.getImp()); \
}                                                  \
                                                   \
Bool_t OBJ##Itr::operator!=(const OBJ##Itr & in) const \
{                                                  \
   return *((const ITR*)fImp) != *((const ITR*)in.getImp()); \
}                                                  \
                                                   \
OBJ##Itr & OBJ##Itr::operator++(int)               \
{                                                  \
   (*((ITR*)fImp))++;                              \
   return *this;                                   \
}                                                  \
                                                   \
OBJ##Itr & OBJ##Itr::operator++()                  \
{                                                  \
   ++(*((ITR*)fImp));                              \
   return *this;                                   \
}                                                  \
                                                   \
const OBJ& OBJ##Itr::operator*()                   \
{                                                  \
   fObj->setImp((void*)&(*(*((ITR*)fImp))));       \
   return *fObj;                                   \
}                                                  \
                                                   \
OBJ* OBJ##Itr::elementP()                          \
{                                                  \
   fObj->setImp((void*)&(*(*((ITR*)fImp))));       \
   return fObj;                                    \
}

IMPLEMENT_ITR(rooAttribute,attribute_iterator)
IMPLEMENT_ITR(rooInheritance,inheritance_iterator)
IMPLEMENT_ITR(rooRelationship,relationship_iterator)
IMPLEMENT_ITR(rooCollectionType,collection_type_iterator)
IMPLEMENT_ITR(rooRefType,ref_type_iterator)
IMPLEMENT_ITR(rooProperty,property_iterator)
IMPLEMENT_ITR(rooModule,module_iterator)
IMPLEMENT_ITR(rooMetaObject,meta_object_iterator)
IMPLEMENT_ITR(rooType,type_iterator)



ROOT page - Class index - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.