source: icGREP/icgrep-devel/icgrep/pablo/carry_data.h @ 5613

Last change on this file since 5613 was 5366, checked in by nmedfort, 2 years ago

Continued work on non-carry-collapsing mode support.

File size: 1.3 KB
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 CARRY_DATA_H
8#define CARRY_DATA_H
9
10namespace pablo {
11
12class CarryData {
13    friend class CarryManager;
14public:
15
16    enum SummaryType : int {
17        NoSummary
18        , ImplicitSummary
19        , BorrowedSummary
20        , ExplicitSummary
21    };
22
23    CarryData()
24    : mSummaryType(NoSummary)
25    , mInNonCollapsingCarryMode(false) {
26
27    }
28             
29    bool hasSummary() const {
30        return (mSummaryType != NoSummary);
31    }
32   
33    bool hasImplicitSummary() const {
34        return (mSummaryType == ImplicitSummary);
35    }
36
37    bool hasBorrowedSummary() const {
38        return (mSummaryType == BorrowedSummary);
39    }
40
41    bool hasExplicitSummary() const {
42        return (mSummaryType == ExplicitSummary);
43    }
44
45    bool nonCarryCollapsingMode() const {
46        return mInNonCollapsingCarryMode;
47    }
48
49    void setSummaryType(const SummaryType value) {
50        mSummaryType = value;
51    }
52
53    void setNonCollapsingCarryMode(const bool value = true) {
54        mInNonCollapsingCarryMode = value;
55    }
56   
57private:
58
59    SummaryType     mSummaryType;
60    bool            mInNonCollapsingCarryMode;
61
62};
63
64
65}
66
67
68#endif // CARRY_DATA_H
Note: See TracBrowser for help on using the repository browser.