Centralize/deduplicate some constants

Change-Id: I80c542abbf6d4978261c0f7e839bef2fb1fa3a91
This commit is contained in:
Davide Pesavento committed 2021-01-15 16:06:06 -05:00
1 parent 32b97d7654
commit eeca59e0c3
5 files changed
+14 -21

No files matched your search

+9 -1
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2020, The University of Memphis
* Copyright (c) 2014-2021, The University of Memphis
*
* This file is part of PSync.
* See AUTHORS.md for complete list of PSync authors and contributors.
@@ -23,6 +23,7 @@
#include "PSync/detail/config.hpp"
#include <ndn-cxx/name.hpp>
#include <ndn-cxx/util/time.hpp>
#include <cstddef>
#include <cstdint>
@@ -32,6 +33,13 @@
namespace psync {
using namespace ndn::time_literals;
const ndn::time::milliseconds HELLO_INTEREST_LIFETIME = 1_s;
const ndn::time::milliseconds HELLO_REPLY_FRESHNESS = 1_s;
const ndn::time::milliseconds SYNC_INTEREST_LIFETIME = 1_s;
const ndn::time::milliseconds SYNC_REPLY_FRESHNESS = 1_s;
enum class CompressionScheme {
NONE,
ZLIB,
+1 -7
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2020, The University of Memphis
* Copyright (c) 2014-2021, The University of Memphis
*
* This file is part of PSync.
* See AUTHORS.md for complete list of PSync authors and contributors.
@@ -28,19 +28,13 @@
#include <ndn-cxx/util/random.hpp>
#include <ndn-cxx/util/scheduler.hpp>
#include <ndn-cxx/util/segment-fetcher.hpp>
#include <ndn-cxx/util/time.hpp>
#include <map>
namespace psync {
using namespace ndn::time_literals;
using ReceiveHelloCallback = std::function<void(const std::map<ndn::Name, uint64_t>&)>;
const ndn::time::milliseconds HELLO_INTEREST_LIFETIME = 1_s;
const ndn::time::milliseconds SYNC_INTEREST_LIFETIME = 1_s;
/**
* @brief Consumer logic to subscribe to producer's data
*
+2 -4
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2020, The University of Memphis
* Copyright (c) 2014-2021, The University of Memphis
*
* This file is part of PSync.
* See AUTHORS.md for complete list of PSync authors and contributors.
@@ -29,8 +29,6 @@
namespace psync {
const ndn::time::milliseconds SYNC_INTEREST_LIFTIME = 1_s;
/**
* @brief Full sync logic to synchronize with other nodes
* where all nodes wants to get all names prefixes synced.
@@ -63,7 +61,7 @@ public:
const ndn::Name& syncPrefix,
const ndn::Name& userPrefix,
const UpdateCallback& onUpdateCallBack,
ndn::time::milliseconds syncInterestLifetime = SYNC_INTEREST_LIFTIME,
ndn::time::milliseconds syncInterestLifetime = SYNC_INTEREST_LIFETIME,
ndn::time::milliseconds syncReplyFreshness = SYNC_REPLY_FRESHNESS,
CompressionScheme ibltCompression = CompressionScheme::DEFAULT,
CompressionScheme contentCompression = CompressionScheme::DEFAULT);
+1 -4
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2020, The University of Memphis
* Copyright (c) 2014-2021, The University of Memphis
*
* This file is part of PSync.
* See AUTHORS.md for complete list of PSync authors and contributors.
@@ -28,12 +28,9 @@
#include <ndn-cxx/face.hpp>
#include <ndn-cxx/security/key-chain.hpp>
#include <ndn-cxx/util/scheduler.hpp>
#include <ndn-cxx/util/time.hpp>
namespace psync {
const ndn::time::milliseconds HELLO_REPLY_FRESHNESS = 1_s;
/**
* @brief Partial sync logic to publish data names
*
+1 -5
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2020, The University of Memphis
* Copyright (c) 2014-2021, The University of Memphis
*
* This file is part of PSync.
* See AUTHORS.md for complete list of PSync authors and contributors.
@@ -30,7 +30,6 @@
#include <ndn-cxx/security/validator-config.hpp>
#include <ndn-cxx/util/random.hpp>
#include <ndn-cxx/util/scheduler.hpp>
#include <ndn-cxx/util/time.hpp>
#include <boost/bimap/bimap.hpp>
#include <boost/bimap/unordered_set_of.hpp>
@@ -40,9 +39,6 @@
namespace psync {
namespace bm = boost::bimaps;
using namespace ndn::time_literals;
const ndn::time::milliseconds SYNC_REPLY_FRESHNESS = 1_s;
/**
* @brief Base class for PartialProducer and FullProducer