Changes for audit of previous commit.
This commit is contained in:
parent
5a42e15c4a
commit
cdd7188747
include
data_structures/concurrent
storage
utils
src
@ -7,7 +7,7 @@
|
||||
template <class T>
|
||||
class List
|
||||
{
|
||||
|
||||
private:
|
||||
template <class V>
|
||||
static V load(std::atomic<V> &atomic)
|
||||
{
|
||||
@ -33,7 +33,6 @@ class List
|
||||
return atomic.exchange(desired, std::memory_order_seq_cst);
|
||||
}
|
||||
|
||||
private:
|
||||
class Node
|
||||
{
|
||||
public:
|
||||
|
@ -103,8 +103,13 @@ public:
|
||||
}
|
||||
|
||||
protected:
|
||||
IndexRecord<T, std::nullptr_t> create_index_record()
|
||||
{
|
||||
return create_index_record(std::nullptr_t());
|
||||
}
|
||||
|
||||
template <class K>
|
||||
IndexRecord<T, K> create_ir(K &&key)
|
||||
IndexRecord<T, K> create_index_record(K &&key)
|
||||
{
|
||||
return IndexRecord<T, K>(std::move(key), record, vlist);
|
||||
}
|
||||
|
@ -3,10 +3,7 @@
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include "data_structures/concurrent/concurrent_map.hpp"
|
||||
// #include "database/db_transaction.hpp"
|
||||
#include "storage/common.hpp"
|
||||
// #include "storage/indexes/index.hpp"
|
||||
// #include "storage/indexes/index_record_collection.hpp"
|
||||
#include "storage/model/properties/property_family.hpp"
|
||||
#include "storage/vertex_accessor.hpp"
|
||||
#include "utils/option.hpp"
|
||||
@ -33,7 +30,7 @@ public:
|
||||
|
||||
private:
|
||||
vertices_t vertices;
|
||||
// TODO: Because familys wont be removed this could be done with more
|
||||
// TODO: Because families wont be removed this could be done with more
|
||||
// efficent
|
||||
// data structure.
|
||||
prop_familys_t prop_familys;
|
||||
|
@ -26,14 +26,14 @@ public:
|
||||
Border &operator=(Border &&other) = default;
|
||||
Border &operator=(Border &other) = default;
|
||||
|
||||
// true if no border or this>key or this>=key depends on border type.
|
||||
// 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.
|
||||
// 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 ||
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
#include "utils/iterator/accessor.hpp"
|
||||
#include "utils/iterator/for_all.hpp"
|
||||
#include "utils/iterator/func_iterator.hpp"
|
||||
#include "utils/iterator/iterator_accessor.hpp"
|
||||
#include "utils/iterator/iterator_base.hpp"
|
||||
#include "utils/iterator/lambda_iterator.hpp"
|
||||
#include "utils/iterator/map.hpp"
|
||||
#include "utils/iterator/range_iterator.hpp"
|
||||
|
@ -4,14 +4,14 @@
|
||||
|
||||
namespace iter
|
||||
{
|
||||
// Wraps function into interator with next().
|
||||
// Wraps lambda into interator with next().
|
||||
// T - type of return value
|
||||
// F - type of wraped function
|
||||
// F - type of wraped lambda
|
||||
template <class T, class F>
|
||||
class FunctionIterator : public IteratorBase<T>
|
||||
class LambdaIterator : public IteratorBase<T>
|
||||
{
|
||||
public:
|
||||
FunctionIterator(F &&f) : func(std::move(f)) {}
|
||||
LambdaIterator(F &&f) : func(std::move(f)) {}
|
||||
|
||||
Option<T> next() final { return func(); }
|
||||
|
||||
@ -19,7 +19,7 @@ private:
|
||||
F func;
|
||||
};
|
||||
|
||||
// Wraps function which returns options as an iterator.
|
||||
// Wraps lambda which returns options as an iterator.
|
||||
template <class F>
|
||||
auto make_iterator(F &&f)
|
||||
{
|
||||
@ -27,6 +27,6 @@ auto make_iterator(F &&f)
|
||||
// FunctionIterator compiler can't deduce it thats way there is decltype in
|
||||
// construction of FunctionIterator. Resoulting type of iter.next().take()
|
||||
// is T.
|
||||
return FunctionIterator<decltype(f().take()), F>(std::move(f));
|
||||
return LambdaIterator<decltype(f().take()), F>(std::move(f));
|
||||
}
|
||||
}
|
@ -6,8 +6,8 @@
|
||||
#include "utils/option_ptr.hpp"
|
||||
|
||||
// RobinHood base.
|
||||
// Entrys are POINTERS alligned to 8B.
|
||||
// Entrys must know thers key.
|
||||
// Entries are POINTERS alligned to 8B.
|
||||
// Entries must know thers key.
|
||||
// D must have method K& get_key()
|
||||
// K must be comparable with ==.
|
||||
template <class K, class D, size_t init_size_pow2 = 2>
|
||||
|
@ -19,7 +19,7 @@ bool Vertex::Accessor::add_label(const Label &label)
|
||||
{
|
||||
// update vertex
|
||||
if (this->record->data.labels.add(label)) {
|
||||
label.index->insert(create_ir(std::nullptr_t()));
|
||||
label.index->insert(create_index_record());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user