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

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

Continued work on non-carry-collapsing mode support.

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