source: icGREP/icgrep-devel/icgrep/re/re_rep.h @ 5350

Last change on this file since 5350 was 4516, checked in by nmedfort, 5 years ago

More memory leak fixes. All known leaks accounted for.

File size: 1.4 KB
RevLine 
[3850]1/*
2 *  Copyright (c) 2014 International Characters.
3 *  This software is licensed to the public under the Open Software License 3.0.
4 *  icgrep is a trademark of International Characters.
5 */
6
7#ifndef RE_REP_H
8#define RE_REP_H
9
10#include "re_re.h"
11
[4194]12namespace re {
13
[4187]14class Rep : public RE {
15public:
[4194]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    }
[4187]22    enum { UNBOUNDED_REP = -1 };
23    RE * getRE() const;
24    void setRE(RE * re = nullptr);
[4182]25    int getLB() const;
[4194]26    void setLB(const int lb);
[4182]27    int getUB() const;
[4194]28    void setUB(const int ub);
29    virtual ~Rep();
30protected:
[4203]31    friend RE * makeRep(RE *, const int, const int);
[4194]32    Rep(RE * re, const int lb, const int ub);
[3850]33private:
34    RE* mRE;
35    int mLB;
[3914]36    int mUB;
[3850]37};
38
[4194]39inline Rep::Rep(RE * re, const int lb, const int ub)
40: RE(ClassTypeId::Rep)
41, mRE(re)
[4187]42, mLB(lb)
43, mUB(ub)
44{
45
46}
47
48inline Rep::~Rep() {
49    delete mRE;
50}
51
52inline RE * Rep::getRE() const {
53    return mRE;
54}
55
56inline void Rep::setRE(RE * re) {
57    mRE = re;
58}
59
60inline int Rep::getLB() const {
61    return mLB;
62}
63
[4194]64inline void Rep::setLB(const int lb) {
[4187]65    mLB = lb;
66}
67
68inline int Rep::getUB() const {
69    return mUB;
70}
71
[4194]72inline void Rep::setUB(const int ub) {
[4187]73    mUB = ub;
74}
75
[4203]76RE * makeRep(RE * re, const int lower_bound, const int upper_bound);
[4194]77
78}
79
[3850]80#endif
Note: See TracBrowser for help on using the repository browser.