2016-07-05 20:20:33 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <set>
|
|
|
|
|
2016-08-18 22:34:36 +08:00
|
|
|
// #include "storage/label/label.hpp"
|
|
|
|
#include "utils/reference_wrapper.hpp"
|
|
|
|
|
|
|
|
class Label;
|
|
|
|
using label_ref_t = ReferenceWrapper<const Label>;
|
2016-07-05 20:20:33 +08:00
|
|
|
|
|
|
|
class LabelCollection
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
auto begin();
|
|
|
|
auto begin() const;
|
|
|
|
auto cbegin() const;
|
|
|
|
|
|
|
|
auto end();
|
|
|
|
auto end() const;
|
|
|
|
auto cend() const;
|
|
|
|
|
2016-08-18 22:34:36 +08:00
|
|
|
bool add(const Label &label);
|
|
|
|
bool has(const Label &label) const;
|
2016-07-05 20:20:33 +08:00
|
|
|
size_t count() const;
|
2016-08-18 22:34:36 +08:00
|
|
|
bool remove(const Label &label);
|
2016-07-05 20:20:33 +08:00
|
|
|
void clear();
|
2016-08-18 22:34:36 +08:00
|
|
|
const std::set<label_ref_t> &operator()() const;
|
2016-07-05 20:20:33 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
std::set<label_ref_t> _labels;
|
|
|
|
};
|