memgraph/include/storage/label/label_collection.hpp

32 lines
756 B
C++
Raw Normal View History

#pragma once
2016-08-28 22:47:13 +08:00
#include <vector>
// #include "storage/label/label.hpp"
#include "utils/reference_wrapper.hpp"
class Label;
using label_ref_t = ReferenceWrapper<const Label>;
class LabelCollection
{
public:
2016-09-08 20:25:52 +08:00
auto begin() { return _labels.begin(); }
auto begin() const { return _labels.begin(); }
auto cbegin() const { return _labels.begin(); }
2016-09-08 20:25:52 +08:00
auto end() { return _labels.end(); }
auto end() const { return _labels.end(); }
auto cend() const { return _labels.end(); }
bool add(const Label &label);
bool has(const Label &label) const;
size_t count() const;
bool remove(const Label &label);
void clear();
2016-08-28 22:47:13 +08:00
const std::vector<label_ref_t> &operator()() const;
private:
2016-08-28 22:47:13 +08:00
std::vector<label_ref_t> _labels;
};