source: icGREP/icgrep-devel/icgrep/pablo/pe_count.h @ 5032

Last change on this file since 5032 was 4720, checked in by cameron, 4 years ago

Implementatation of the Pablo Count operation

File size: 1019 bytes
Line 
1/*
2 *  Copyright (c) 2015 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 PE_COUNT_H
8#define PE_COUNT_H
9
10#include <pablo/pabloAST.h>
11
12namespace pablo {
13
14class Count : public Statement {
15    friend class PabloBlock;
16public:
17    static inline bool classof(const PabloAST * e) {
18        return e->getClassTypeId() == ClassTypeId::Count;
19    }
20    static inline bool classof(const void *) {
21        return false;
22    }
23    virtual ~Count() {
24    }
25    inline PabloAST * getExpr() const {
26        return getOperand(0);
27    }
28    inline void setGlobalCountIndex(const unsigned idx) {
29        globalCountIndex = idx;
30    }
31    inline unsigned getGlobalCountIndex() const {
32        return globalCountIndex;
33    }
34protected:
35    Count(PabloAST * expr, String * name)
36    : Statement(ClassTypeId::Count, {expr}, name)
37    {
38
39    }
40private:
41    unsigned globalCountIndex;
42};
43
44}
45
46#endif // PE_COUNT_H
47
48
49
Note: See TracBrowser for help on using the repository browser.