PSync 0.5.0-6-g410520d9 documentation
Loading...
Searching...
No Matches
common.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2014-2024, The University of Memphis
4
*
5
* This file is part of PSync.
6
* See AUTHORS.md for complete list of PSync authors and contributors.
7
*
8
* PSync is free software: you can redistribute it and/or modify it under the terms
9
* of the GNU Lesser General Public License as published by the Free Software Foundation,
10
* either version 3 of the License, or (at your option) any later version.
11
*
12
* PSync is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
13
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14
* PURPOSE. See the GNU Lesser General Public License for more details.
15
*
16
* You should have received a copy of the GNU Lesser General Public License along with
17
* PSync, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
18
*/
19
20
#ifndef PSYNC_COMMON_HPP
21
#define PSYNC_COMMON_HPP
22
23
#include "PSync/detail/config.hpp"
24
25
#include <ndn-cxx/name.hpp>
26
#include <ndn-cxx/util/time.hpp>
27
28
#include <cstddef>
29
#include <cstdint>
30
#include <functional>
31
#include <stdexcept>
32
#include <vector>
33
34
namespace
psync
{
35
36
using namespace
ndn::time_literals;
37
38
inline
constexpr
ndn::time::milliseconds
HELLO_INTEREST_LIFETIME
= 1_s;
39
inline
constexpr
ndn::time::milliseconds
HELLO_REPLY_FRESHNESS
= 1_s;
40
inline
constexpr
ndn::time::milliseconds
SYNC_INTEREST_LIFETIME
= 1_s;
41
inline
constexpr
ndn::time::milliseconds
SYNC_REPLY_FRESHNESS
= 1_s;
42
43
enum class
CompressionScheme
{
44
NONE
,
45
ZLIB
,
46
GZIP
,
47
BZIP2
,
48
LZMA
,
49
ZSTD
,
50
#ifdef PSYNC_HAVE_ZLIB
51
DEFAULT
=
ZLIB
52
#else
53
DEFAULT
=
NONE
54
#endif
55
};
56
57
class
CompressionError
:
public
std::runtime_error
58
{
59
public
:
60
using
std::runtime_error::runtime_error;
61
};
62
63
struct
MissingDataInfo
64
{
65
ndn::Name
prefix
;
66
uint64_t
lowSeq
;
67
uint64_t
highSeq
;
68
uint64_t
incomingFace
;
69
};
70
71
using
UpdateCallback
= std::function<void(
const
std::vector<MissingDataInfo>&)>;
72
73
}
// namespace psync
74
75
#endif
// PSYNC_COMMON_HPP
psync::CompressionError
Definition
common.hpp:58
psync
Definition
common.hpp:34
psync::HELLO_REPLY_FRESHNESS
constexpr ndn::time::milliseconds HELLO_REPLY_FRESHNESS
Definition
common.hpp:39
psync::CompressionScheme
CompressionScheme
Definition
common.hpp:43
psync::CompressionScheme::DEFAULT
@ DEFAULT
psync::CompressionScheme::BZIP2
@ BZIP2
psync::CompressionScheme::ZSTD
@ ZSTD
psync::CompressionScheme::ZLIB
@ ZLIB
psync::CompressionScheme::NONE
@ NONE
psync::CompressionScheme::GZIP
@ GZIP
psync::CompressionScheme::LZMA
@ LZMA
psync::SYNC_INTEREST_LIFETIME
constexpr ndn::time::milliseconds SYNC_INTEREST_LIFETIME
Definition
common.hpp:40
psync::HELLO_INTEREST_LIFETIME
constexpr ndn::time::milliseconds HELLO_INTEREST_LIFETIME
Definition
common.hpp:38
psync::SYNC_REPLY_FRESHNESS
constexpr ndn::time::milliseconds SYNC_REPLY_FRESHNESS
Definition
common.hpp:41
psync::UpdateCallback
std::function< void(const std::vector< MissingDataInfo > &)> UpdateCallback
Definition
common.hpp:71
psync::MissingDataInfo
Definition
common.hpp:64
psync::MissingDataInfo::highSeq
uint64_t highSeq
Definition
common.hpp:67
psync::MissingDataInfo::incomingFace
uint64_t incomingFace
Definition
common.hpp:68
psync::MissingDataInfo::lowSeq
uint64_t lowSeq
Definition
common.hpp:66
psync::MissingDataInfo::prefix
ndn::Name prefix
Definition
common.hpp:65
PSync
common.hpp
Generated by
1.9.8