source: icGREP/icgrep-devel/icgrep/pablo/pe_scanthru.h @ 4388

Last change on this file since 4388 was 4358, checked in by cameron, 4 years ago

Clean up various minor issues that generate compiler warnings.

File size: 1.3 KB
Line 
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 PS_SCANTHRU_H
8#define PS_SCANTHRU_H
9
10#include <pablo/pabloAST.h>
11#include <array>
12
13namespace pablo {
14
15class ScanThru : public  PabloAST {
16    friend class PabloBlock;
17public:
18    static inline bool classof(const PabloAST * e) {
19        return e->getClassTypeId() == ClassTypeId::ScanThru;
20    }
21    static inline bool classof(const void *) {
22        return false;
23    }
24    virtual ~ScanThru() {
25    }
26    virtual PabloAST * getOperand(const unsigned index) const {
27        assert (index < 2);
28        return mExprs[index];
29    }
30    virtual unsigned getNumOperands() const {
31        return 2;
32    }
33    virtual void setOperand(const unsigned index, PabloAST * value) {
34        assert (index < 2);
35        mExprs[index] = value;
36    }
37    PabloAST * getScanFrom() const {
38        return mExprs[0];
39    }
40    PabloAST * getScanThru() const {
41        return mExprs[1];
42    }
43    ScanThru(PabloAST * from, PabloAST * thru)
44    : PabloAST(ClassTypeId::ScanThru)
45    , mExprs({{from, thru}})
46    {
47
48    }
49private:
50    std::array<PabloAST*, 2> mExprs;
51};
52
53}
54
55#endif // PS_SCANTHRU_H
56
57
58
Note: See TracBrowser for help on using the repository browser.