Ignore:
Timestamp:
Dec 13, 2018, 12:16:02 PM (9 months ago)
Author:
cameron
Message:

Clean-up/refactoring step for REs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/re/re_rep.h

    r5991 r6226  
    1414class Rep : public RE {
    1515public:
    16     static inline bool classof(const RE * re) {
    17         return re->getClassTypeId() == ClassTypeId::Rep;
    18     }
    19     static inline bool classof(const void *) {
    20         return false;
    21     }
    2216    enum { UNBOUNDED_REP = -1 };
    23     RE * getRE() const;
    24     void setRE(RE * re = nullptr);
    25     int getLB() const;
    26     void setLB(const int lb);
    27     int getUB() const;
    28     void setUB(const int ub);
    29     virtual ~Rep() {}
    30 protected:
    31     friend RE * makeRep(RE *, const int, const int);
    32     Rep(RE * re, const int lb, const int ub);
     17    RE * getRE() const {return mRE;}
     18    int getLB() const {return mLB;}
     19    int getUB() const {return mUB;}
     20    static Rep * Create(RE * r, const int lb, const int ub) {return new Rep(r, lb, ub);}
     21    RE_SUBTYPE(Rep)
    3322private:
     23    Rep(RE * repeated, const int lb, const int ub) : RE(ClassTypeId::Rep), mRE(repeated), mLB(lb), mUB(ub) {}
    3424    RE* mRE;
    3525    int mLB;
    3626    int mUB;
    3727};
    38 
    39 inline Rep::Rep(RE * re, const int lb, const int ub)
    40 : RE(ClassTypeId::Rep)
    41 , mRE(re)
    42 , mLB(lb)
    43 , mUB(ub)
    44 {
    45 
    46 }
    47 
    48 inline RE * Rep::getRE() const {
    49     return mRE;
    50 }
    51 
    52 inline void Rep::setRE(RE * re) {
    53     mRE = re;
    54 }
    55 
    56 inline int Rep::getLB() const {
    57     return mLB;
    58 }
    59 
    60 inline void Rep::setLB(const int lb) {
    61     mLB = lb;
    62 }
    63 
    64 inline int Rep::getUB() const {
    65     return mUB;
    66 }
    67 
    68 inline void Rep::setUB(const int ub) {
    69     mUB = ub;
    70 }
    7128
    7229RE * makeRep(RE * re, const int lower_bound, const int upper_bound);
Note: See TracChangeset for help on using the changeset viewer.