Squashed messages from 9 commits:
9.
Properties now uses PropertyFamily and contained classes.
Fetching,seting,clearing properties can be done with PropertyFamilyKey or PropertyTypeKey.
Hierarchy of newly added clases is:
Vertices -n-> PropertyFamily {name: String} <-1-n-> PropertyType {type: Property::Flags}
Edges -n-> PropertyFamily {name: String} <-1-n-> PropertyType {type: Property::Flags}
PropertyFamilyKey -> PropertyType
PropertyTypeKey -> PropertyType
PropertyType t0,t1;
let t0!=t1 be true
let t0.family==t1.family be true
then next is true
PropertyTypeKey{&t0}!=PropertyTypeKey{&t1}
PropertyFamilyKey{&t0}==PropertyFamilyKey{&t1}
PropertyFamilyKey{&t0}==PropertyTypeKey{&t1}
PropertyTypeKey{&t0}==PropertyFamilyKey{&t1}
8.
Intermedate commit.
Noticed that integration queries throw SEGFAULT.
7.
Defined interface for indexes.
Fixed three memory leaks.
Fixed integration_queries test which now passes.
6.
Commit which return Xorshift128plus to valid shape.
5.
Tmp commit.
4.
Label Index is compiling.
3.
tmp
2.
Vertex::Accessor now updates Label index.
1.
Applied changes for code review.
52 lines
1.1 KiB
C++
52 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include "utils/option.hpp"
|
|
|
|
// Defines Including as [ and Excluding < for ranges.
|
|
enum BorderType
|
|
{
|
|
Including = 0,
|
|
Excluding = 1,
|
|
};
|
|
|
|
template <class T>
|
|
class Border
|
|
{
|
|
|
|
public:
|
|
Border() : key(Option<T>()), type(Including) {}
|
|
Border(T Tey, BorderType type) : key(Option<T>(std::move(key))), type(type)
|
|
{
|
|
}
|
|
|
|
// Border(Border &other) = default;
|
|
Border(Border &other) = default;
|
|
Border(Border &&other) = default;
|
|
|
|
Border &operator=(Border &&other) = default;
|
|
Border &operator=(Border &other) = default;
|
|
|
|
// true if no border or this>key or this>=key depends on border type.
|
|
bool operator>(const T &other) const
|
|
{
|
|
return !key.is_present() || key.get() > other ||
|
|
(type == Including && key.get() == other);
|
|
}
|
|
|
|
// true if no border or this<key or this<=key depends on border type.
|
|
bool operator<(const T &other) const
|
|
{
|
|
return !key.is_present() || key.get() < other ||
|
|
(type == Including && key.get() == other);
|
|
}
|
|
|
|
Option<T> key;
|
|
const BorderType type;
|
|
};
|
|
|
|
template <class T>
|
|
auto make_inf_border()
|
|
{
|
|
return Border<T>();
|
|
}
|