#ifndef VLCINDVAL_HEADER #define VLCINDVAL_HEADER 1 ///////////////////////////////////////////////////////// //! file="amma/Logic/Index/LCIndVal.hh" //! lib=VLIndex //! userlevel=Default //! author="Charles Galambos" //! date="03/07/96" //! docentry="Logic.Index" //! rcsid="$Id: LCIndVal.hh,v 1.20 2000/07/13 09:58:44 ees1cg Exp $" #include "amma/Logic2/LCIndNode.hh" #include "amma/Logic2/LExprType.hh" #include "amma/Logic2/LExpr.hh" #include "amma/HashAR.hh" class VLCIndNodeIter; class VLCIndValIter; ////////////////////////////////////// //! userlevel=Develop //: Index by pure symbol class VLCIndVal : public VLCIndNode { public: VLCIndVal(const VLExprLabelC &Lab,const VLSymbC &symb); //: Constructor VLCIndVal(IndexT val,const VLSymbC &symb); //: Constructor. VLCIndVal(const VLCIndVal &Oth); //: Copy constructor. //: Not supported ! 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... virtual BooleanT Match(const VLExprC &vle,VLCIndNodeC &next) const; //: Match an VLExpr... // Exact !! virtual VLSymbIterC GetNewIter(const VLSymbC &filter,const VLBindLstC &oBnd) const; //: Get iterator virtual IndexT IndexBy(void) const { return ind; } //: Term no index by. virtual BooleanT AddIndex(const VLExprC &vle,VLCIndNodeC &next); //: Add to index. private: IndexT ind; //: Index of arg. HashARC lst; friend class VLCIndNodeIter; friend class VLCIndValIter; }; ////////////////////////// //! userlevel=Advanced //: Index by pure symbol class VLCIndValC : public VLCIndNodeC { public: VLCIndValC() {} //: Default constructor. // Creates an invalid handle. VLCIndValC(const VLExprLabelC &lab,const VLSymbC &symb) : VLCIndNodeC(*new VLCIndVal(lab,symb)) {} //: Constructor VLCIndValC(IndexT val,const VLSymbC &symb) : VLCIndNodeC(*new VLCIndVal(val,symb)) {} //: Constructor. protected: VLCIndValC(VLCIndVal &bod) : VLCIndNodeC(bod) {} //: Body constructor. VLCIndVal &Body() { return static_cast(VLCIndNodeC::Body()); } //: Access body const VLCIndVal &Body() const { return static_cast(VLCIndNodeC::Body()); } //: Access body friend class VLCIndValIter; friend class VLCIndVal; }; #endif