A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
example s4u-platform-properties: test thehost->get_englobing_zone and diplay its...
[simgrid.git]
/
examples
/
s4u
/
dht-kademlia
/
routing_table.hpp
diff --git
a/examples/s4u/dht-kademlia/routing_table.hpp
b/examples/s4u/dht-kademlia/routing_table.hpp
index
60354ce
..
4d8258a
100644
(file)
--- a/
examples/s4u/dht-kademlia/routing_table.hpp
+++ b/
examples/s4u/dht-kademlia/routing_table.hpp
@@
-1,4
+1,4
@@
-/* Copyright (c) 2012
, 2014, 2017
. The SimGrid Team.
+/* Copyright (c) 2012
-2019
. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
@@
-8,6
+8,7
@@
#define _KADEMLIA_ROUTING_TABLE_HPP
#include "s4u-dht-kademlia.hpp"
#include <deque>
#define _KADEMLIA_ROUTING_TABLE_HPP
#include "s4u-dht-kademlia.hpp"
#include <deque>
+#include <vector>
namespace kademlia {
namespace kademlia {
@@
-16,19
+17,19
@@
class Bucket {
unsigned int id_; // bucket id
public:
std::deque<unsigned int> nodes; // Nodes in the bucket.
unsigned int id_; // bucket id
public:
std::deque<unsigned int> nodes; // Nodes in the bucket.
- unsigned int getId() { return id_; }
+ unsigned int getId()
const
{ return id_; }
explicit Bucket(unsigned int id) : id_(id) {}
explicit Bucket(unsigned int id) : id_(id) {}
- ~Bucket() = default;
};
/* Node routing table */
class RoutingTable {
unsigned int id_; // node id of the client's routing table
public:
};
/* Node routing table */
class RoutingTable {
unsigned int id_; // node id of the client's routing table
public:
-
Bucket**
buckets; // Node bucket list - 160 sized.
+
std::vector<Bucket>
buckets; // Node bucket list - 160 sized.
explicit RoutingTable(unsigned int node_id);
explicit RoutingTable(unsigned int node_id);
- ~RoutingTable();
- void print();
+ RoutingTable(const RoutingTable&) = delete;
+ RoutingTable& operator=(const RoutingTable&) = delete;
+ void print() const;
Bucket* findBucket(unsigned int id);
bool contains(unsigned int node_id);
};
Bucket* findBucket(unsigned int id);
bool contains(unsigned int node_id);
};