Ignore:
Timestamp:
Jun 29, 2015, 1:46:55 PM (4 years ago)
Author:
nmedfort
Message:

Preliminary changes to inclusion of UCD Compiler into the RE Compiler.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/UCD/unicode_set.h

    r4621 r4622  
    4444    using length_t = uint16_t;
    4545    using run_t = std::pair<run_type_t, length_t>;
     46    using quad_iterator_return_t = std::pair<run_t, bitquad_t>;
    4647
    4748    using codepoint_t = re::codepoint_t;
     
    6364        void advance(const unsigned n);
    6465
    65         re::interval_t dereference() const {
     66        inline interval_t dereference() const {
    6667            return std::make_pair(mMinCodePoint, mMaxCodePoint);
    6768        }
     
    7172        }
    7273
    73         inline bool equal(iterator const & other) const {
     74        inline bool equal(const iterator & other) const {
    7475            return (mRunIterator == other.mRunIterator) && (mQuadIterator == other.mQuadIterator) &&
    7576                   (mMixedRunIndex == other.mMixedRunIndex) && (mQuadOffset == other.mQuadOffset);
     
    9495    }
    9596
    96     class quad_iterator : public boost::iterator_facade<quad_iterator, std::pair<run_t, bitquad_t>, boost::random_access_traversal_tag> {
     97    class quad_iterator : public boost::iterator_facade<quad_iterator, quad_iterator_return_t, boost::random_access_traversal_tag, quad_iterator_return_t> {
    9798        friend class UnicodeSet;
    9899        friend class boost::iterator_core_access;
     
    103104        void advance(unsigned n);
    104105
    105         inline const std::pair<run_t, bitquad_t> dereference() const {
    106             return std::make_pair(getRun(), getQuad());
     106        inline quad_iterator_return_t dereference() const {
     107            return std::make_pair(run(), quad());
    107108        }
    108109
     
    111112        }
    112113
    113         inline run_t getRun() const {
     114        inline run_t run() const {
    114115            const auto & t = *mRunIterator;
    115116            return std::make_pair(std::get<0>(t), std::get<1>(t) - mOffset);
    116117        }
    117118
    118         inline bitquad_t getQuad() const {
     119        inline bitquad_t quad() const {
    119120            return *mQuadIterator;
    120121        }
     
    147148    UnicodeSet operator-(const UnicodeSet & other) const;
    148149    UnicodeSet operator^(const UnicodeSet & other) const;
     150    inline UnicodeSet & operator=(const UnicodeSet & other) = default;
     151    inline UnicodeSet & operator=(UnicodeSet && other) = default;
    149152    UnicodeSet operator==(const UnicodeSet & other) const;
    150153
     
    152155    UnicodeSet(const codepoint_t codepoint);
    153156    UnicodeSet(const codepoint_t lo_codepoint, const codepoint_t hi_codepoint);
     157    inline UnicodeSet(const UnicodeSet & other) = default;
    154158    UnicodeSet(std::initializer_list<run_t> r, std::initializer_list<bitquad_t> q) : mRuns(r), mQuads(q) {}
    155159    UnicodeSet(std::vector<run_t> && r, std::vector<bitquad_t> && q) : mRuns(r), mQuads(q) {}
     
    160164private:
    161165
    162     std::vector<run_t>   mRuns;
    163     std::vector<bitquad_t>      mQuads;
     166    RunVector       mRuns;
     167    QuadVector      mQuads;
    164168};
    165169
    166170inline void UnicodeSet::swap(UnicodeSet & other) {
    167     mRuns.swap(other.mRuns);
    168     mQuads.swap(other.mQuads);
     171    mRuns.swap(other.mRuns); mQuads.swap(other.mQuads);
    169172}
    170173
    171174inline void UnicodeSet::swap(UnicodeSet && other) {
    172     mRuns.swap(other.mRuns);
    173     mQuads.swap(other.mQuads);
     175    mRuns.swap(other.mRuns); mQuads.swap(other.mQuads);
    174176}
    175177
Note: See TracChangeset for help on using the changeset viewer.