#include <net_peerlist.h>
Definition at line 62 of file net_peerlist.h.
◆ peerlist_storage() [1/3]
| nodetool::peerlist_storage::peerlist_storage |
( |
| ) |
|
|
inline |
◆ peerlist_storage() [2/3]
◆ peerlist_storage() [3/3]
◆ ~peerlist_storage()
| nodetool::peerlist_storage::~peerlist_storage |
( |
| ) |
|
|
noexcept |
◆ open() [1/2]
| boost::optional< peerlist_storage > nodetool::peerlist_storage::open |
( |
std::istream & |
src, |
|
|
const bool |
new_format |
|
) |
| |
|
static |
- Returns
- Peers stored in stream
src in new_format (portable archive or older non-portable).
Definition at line 161 of file net_peerlist.cpp.
173 boost::archive::binary_iarchive
a{src};
179 std::sort(
out.m_types.white.begin(),
out.m_types.white.end(), by_zone{});
180 std::sort(
out.m_types.gray.begin(),
out.m_types.gray.end(), by_zone{});
181 std::sort(
out.m_types.anchor.begin(),
out.m_types.anchor.end(), by_zone{});
185 catch (
const std::exception& e)
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
const T & move(const T &t)
◆ open() [2/2]
| boost::optional< peerlist_storage > nodetool::peerlist_storage::open |
( |
const std::string & |
path | ) |
|
|
static |
- Returns
- Peers stored in file at
path
Definition at line 191 of file net_peerlist.cpp.
193 std::ifstream src_file{};
194 src_file.open( path , std::ios_base::binary | std::ios_base::in);
198 boost::optional<peerlist_storage>
out =
open(src_file,
true);
202 boost::filesystem::copy_file(path, path +
".unportable", boost::filesystem::copy_option::overwrite_if_exists);
204 src_file.open( path , std::ios_base::binary | std::ios_base::in);
214 MWARNING(
"Failed to load p2p config file, falling back to default config");
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ store() [1/2]
| bool nodetool::peerlist_storage::store |
( |
std::ostream & |
dest, |
|
|
const peerlist_types & |
other |
|
) |
| const |
Save peers from this and other in stream dest.
Definition at line 225 of file net_peerlist.cpp.
230 const peerlist_join pj{std::cref(m_types), std::cref(other)};
234 catch (
const boost::archive::archive_exception& e)
CXA_THROW_INFO_T void(* dest)(void *))
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
◆ store() [2/2]
| bool nodetool::peerlist_storage::store |
( |
const std::string & |
path, |
|
|
const peerlist_types & |
other |
|
) |
| const |
Save peers from this and other in one file at path.
Definition at line 240 of file net_peerlist.cpp.
242 std::ofstream dest_file{};
243 dest_file.open( path , std::ios_base::binary | std::ios_base::out| std::ios::trunc);
247 return store(dest_file, other);
◆ take_zone()
- Returns
- Peers in
zone and from remove from this.
Definition at line 250 of file net_peerlist.cpp.
252 peerlist_types
out{};
The documentation for this class was generated from the following files: