Program Listing for File range-spec.h

Return to documentation for file (include\utility\range-spec.h)

/******************************************************************************
© Intel Corporation.

This software and the related documents are Intel copyrighted materials,
and your use of them is governed by the express license under which they
were provided to you ("License"). Unless the License provides otherwise,
you may not use, modify, copy, publish, distribute, disclose or transmit
this software or the related documents without Intel's prior written
permission.


 This software and the related documents are provided as is, with no express
or implied warranties, other than those that are expressly stated in the
License.

******************************************************************************/

#pragma once

#include <cstddef>

namespace gpa {
namespace utility {

class RangeSpec
{
public:
    RangeSpec();
    RangeSpec(size_t frame);
    RangeSpec(size_t start, bool startOpen, size_t end, bool endOpen);
    RangeSpec(size_t start, bool startOpen, size_t end, bool endOpen, size_t step);
    ~RangeSpec();

    static size_t const NOT_SET;

    bool operator<(RangeSpec const& other) const;

    bool Matches(size_t frame) const;

    size_t Start() const;

    size_t End() const;

    size_t Step() const;

    bool StartOpen() const;

    bool EndOpen() const;

private:
    size_t mStart;
    size_t mEnd;
    size_t mStep;
    bool mStartOpen;
    bool mEndOpen;
};

}  // namespace utility
}  // namespace gpa