#ifndef LCINDTYPE_HEADER #define LCINDTYPE_HEADER 1 ///////////////////////////////////////////////////////// //! file="amma/Logic/Index/LCIndType.hh" //! lib=VLIndex //! author="Charles Galambos" //! date="03/07/96" //! docentry="Logic.Index" //! rcsid="$Id: LCIndType.hh,v 1.19 2000/07/14 14:30:27 ees1cg Exp $" #include "amma/Logic2/LCIndNode.hh" #include "amma/HashAR.hh" class VLCIndNodeIter; class VLCIndTypeIter; //! userlevel=Develop //: Type index. class VLCIndType : public VLCIndNode { public: VLCIndType(const VLSymbC &symb = VLSymbC()); //: Constructor. virtual BooleanT AddExpr(const VLExprC &cnd,const RCWrapBaseC &data,VLCIndNodeC &next); // Add new expression. virtual BooleanT Match(const VLExprC &vle,VLBindLst &bnd,VLCIndNodeC &next) const; //: Match an VLExpr... // Unify based expression match . virtual BooleanT Match(const VLExprC &vle,VLCIndNodeC &next) const; //: Match an VLExpr... // Exact !! virtual VLSymbIterC GetNewIter(const VLSymbC &filter,VLBindLst &oBnd) const; //: Get iterator virtual BooleanT AddIndex(const VLExprC &vle,VLCIndNodeC &next); //: Add a new entry. virtual IndexT IndexBy(void) const { return -2; } //: Filed we're indexing by. private: HashARC lst; friend class VLCIndNodeIter; friend class VLCIndTypeIter; friend class VLCIndTypeC; }; ///////////////////////// //! userlevel=Advanced //: Type index handle. class VLCIndTypeC : public VLCIndNodeC { public: VLCIndTypeC() {} //: Default constructor. // Creates an invalid handle. VLCIndTypeC(const VLSymbC &arg) : VLCIndNodeC(*new VLCIndType(arg)) {} //: Default constructor. // Creates an invalid handle. protected: VLCIndTypeC(VLCIndType &bod) : VLCIndNodeC(bod) {} //: Body constructor. VLCIndType &Body() { return static_cast(VLCIndNodeC::Body()); } //: Access body const VLCIndType &Body() const { return static_cast(VLCIndNodeC::Body()); } //: Access body public: friend class VLCIndType; friend class VLCIndNodeIter; friend class VLCIndTypeIter; }; #endif