source: icGREP/icgrep-devel/icgrep/pablo/pe_ones.h @ 4272

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

Implemented slab allocator based on the original Parabix StringPool?; intergrated it with RE and Pablo AST nodes.

File size: 927 bytes
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 PE_ONES_H
8#define PE_ONES_H
9
10#include "pabloAST.h"
11
12namespace pablo {
13
14class Ones : public PabloAST {
15    friend class PabloBlock;
16public:
17    static inline bool classof(const PabloAST * e) {
18        return e->getClassTypeId() == ClassTypeId::Ones;
19    }
20    static inline bool classof(const void *) {
21        return false;
22    }
23    virtual ~Ones() {
24
25    }
26    inline bool operator==(const Ones & other) const {
27        return true;
28    }
29    virtual bool operator==(const PabloAST & other) const {
30        return isa<Ones>(other);
31    }
32protected:
33    void* operator new (std::size_t size) noexcept {
34        return mAllocator.allocate(size);
35    }
36    Ones() : PabloAST(ClassTypeId::Ones) { }
37};
38
39}
40
41#endif // PE_ONES_H
42
43
Note: See TracBrowser for help on using the repository browser.