~verifypn-cpn/verifypn/TACPNModel

« back to all changes in this revision

Viewing changes to PetriEngine/Colored/TimeInterval.h

  • Committer: Niels Christensen
  • Date: 2019-03-29 13:49:15 UTC
  • Revision ID: nchri13@student.aau.dk-20190329134915-sjddgd1kfge55bzt
Made arcs with intervals

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
        {
21
21
        public: //Construter
22
22
            TimeInterval(Colored::Color color) : leftStrict(false), lowerBound(0), upperBound(std::numeric_limits<int>::max()), rightStrict(true), color(color){ };
23
 
            TimeInterval(bool leftStrict, int lowerBound, int upperBound, bool rightStrict, Colored::Color color) : leftStrict(leftStrict), lowerBound(lowerBound), upperBound(upperBound), rightStrict(rightStrict), color(color) { };
 
23
            TimeInterval(bool leftStrict, uint32_t lowerBound, uint32_t upperBound, bool rightStrict, Colored::Color color) : leftStrict(leftStrict), lowerBound(lowerBound), upperBound(upperBound), rightStrict(rightStrict), color(color) { };
24
24
            TimeInterval(const TimeInterval& ti) : leftStrict(ti.leftStrict), lowerBound(ti.lowerBound), upperBound(ti.upperBound), rightStrict(ti.rightStrict), color(ti.color) {};
25
25
            TimeInterval& operator=(const TimeInterval& ti)
26
26
            {
41
41
        public: // inspectors
42
42
            void print(std::ostream& out) const;
43
43
 
44
 
            inline const int getLowerBound() const { return lowerBound; }
45
 
            inline const int getUpperBound() const { return upperBound; }
 
44
            inline const uint32_t getLowerBound() const { return lowerBound; }
 
45
            inline const uint32_t getUpperBound() const { return upperBound; }
46
46
            inline const bool isLowerBoundStrict() const { return leftStrict; }
47
47
            inline const bool isUpperBoundStrict() const { return rightStrict; }
48
48
            inline bool setUpperBound(int bound, bool isStrict)
75
75
            }
76
76
 
77
77
        public: // statics
78
 
            static TimeInterval createFor(const std::string& interval, const std::map<std::string, int>& replace);
 
78
            static TimeInterval createFor(const std::string& interval, const std::map<std::string, int>& replace,
 
79
                                          std::vector<const Colored::Color*> colors);
79
80
            static inline void ltrim(std::string &s) {
80
81
                s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](int ch) {
81
82
                    return !std::isspace(ch);
82
83
                }));
83
84
            }
 
85
            static Colored::Color createColor(std::vector<const Colored::Color*> colors);
84
86
 
85
87
            // trim from end
86
88
            static inline void rtrim(std::string &s) {
97
99
 
98
100
        private: // data
99
101
            bool leftStrict;
100
 
            int lowerBound;
101
 
            int upperBound;
 
102
            uint32_t lowerBound;
 
103
            uint32_t upperBound;
102
104
            bool rightStrict;
103
105
            Colored::Color color;
104
106
        };