Commit Graph
19 Commits
Author SHA1 Message Date
Davide Pesavento 2e481fc28d common: stop importing std::{bind,ref,cref} into namespace ndn
And reduce the usage of std::bind() throughout the codebase.
C++14 lambdas are easier to understand for humans and more
likely to be optimized by the compiler.

Change-Id: Ia59fad34539710f8801c52914896ce426fb7e538
2021-07-31 19:29:06 -04:00
Zhiyi Zhang 8b0344d4bc examples: fix "CanBePrefix unset" warning and general cleanup
refs: #4581
Change-Id: Ia1955e1c1eb746221adc88bfde093d5eadbd88e5
2019-06-28 11:36:19 -04:00
Junxiao Shi a5f233e103 util: rename Scheduler::scheduleEvent to schedule
Deprecate Scheduler::scheduleEvent and Scheduler::cancelEvent

refs #4883

Change-Id: I2bb16922aff04300d92dfd276dd436958a96929a
2019-03-18 09:39:22 -06:00
Davide Pesavento 1944281719 Rename 'src' directory to 'ndn-cxx'
Change-Id: I14394023680901a86977313ca87fb017333614dd
Refs: #3084
2018-11-23 18:27:19 -05:00
Davide Pesavento 0f8308012b util: add literal operators for duration types
Change-Id: I007fa61c80e535c6e4b12e85a32eeeee62fecc3c
Refs: #4468
2018-01-18 21:23:05 -05:00
Davide Pesavento 4d0d096b2e Fix compilation with boost 1.66.0
Change-Id: Ibf2883a974c834a5281c39a551e6d467d4454501
2017-12-19 22:37:15 -05:00
Davide Pesavento cdcde90588 Fix compilation with Boost 1.65.0
Change-Id: I6f56d6bf135d9c862b04cb086340301ee98ef0ed
Refs: #4256
2017-08-23 22:24:40 -04:00
Weiwei Liu ab9aad0d48 examples: handle Nack in consumer
refs #3701
Change-Id: Ia6cfcefcf5a9541b09a50d1e5edaa55227908191
2016-10-11 16:42:08 -07:00
Steve DiBenedetto 9fcc24fd75 docs: improve example applications
refs: #1976

Change-Id: I82e719ac497d3cb4eab74c1c6d02bcaa050388eb
2015-01-16 14:59:49 -08:00
Alexander Afanasyev b6783065ae examples: Do not use /localhost prefix in examples
This change is to avoid a common problem of running examples on separate
machines.  The use of /localhost prefix, due to name-based scoping,
restricts the example programs to run on a single machine.

Change-Id: Id9f753fb7d097411b77b6227c6518679849d4411
2014-06-13 13:03:25 -07:00
Alexander Afanasyev c169a81a5c src: Switching to LGPL 3.0 license
Change-Id: Iabc3356c332be7c37ecbf5f0902328054b79f177
Refs: #1628
2014-05-23 17:32:08 -07:00
Alexander Afanasyev b67090ad35 build+tests: Fixing c++11 mode compilation and correcting integrated test with faces
Change-Id: I32e34d6b2ee8cfd85ec83f62323dd7a51f2238d6
2014-04-30 16:03:27 -07:00
Alexander Afanasyev dfa52c4400 docs: Updating documentation and license boilerplates in all files
Change-Id: I321fb0d85aaddf9150ed496fe03ee0e4dc738761
2014-04-25 09:22:29 -07:00
Alexander Afanasyev 766cea7931 ====== Renaming library to ndn-cxx ======
Dependent applications should perform the following changes:

* all includes should be changed from <ndn-cpp-dev/...> to <ndn-cxx/...>
* documentation files/comments referring to ndn-cpp-dev should be
  updated and refer to ndn-cxx
* if the app uses pkgconfig for dependency detection, 'libndn-cpp-dev'
  should be replaced with 'libndn-cxx'.  Example for waf users:

    conf.check_cfg(package = 'libndn-cxx', args = ['--cflags', '--libs'],
                   uselib_store = 'NDN_CXX', mandatory = True)

Change-Id: I92d9ec7ff176b9fe8b4352bf04bbb32aa810422d
Refs: #1491
2014-04-24 22:49:51 -07:00
Alexander Afanasyev 151a855a1a docs: Extending documentation and manpages
Refs: #1462

Change-Id: If33a0f3c623daf3502ed301bcdc63892779463e3
2014-04-16 16:20:41 -07:00
Alexander Afanasyev aa0e7dad62 all: Refactoring work with time using boost::chrono
Now the library has two clocks: time::steady_clock and
time::system_clock, following (boost|std)::chrono.  In addition to
standard now() method, the library contains several helpers to convert
to/from UnixTimestamp (microsecond resolution) and IsoString (optional
microsecond resolution).  The IsoString conversions use
boost::posix_time routines, since boost::chrono supports extended IO
support only starting boost version 1.52 (Boost Chrono V2).

This commit breaks compatibility with previous API.  All time-related
Data/Interest calls must explicitly use time units to specify
FreshnessPeriod/InterestLifetime.

Brief usage/conversion guide:

- creation of time units does not support double/float types.  If
  necessary to create time unit from double, ``ndn::duration<double>`` (for
  seconds) needs to be used instead.  In some cases, this would also
  require ``ndn::duration_cast``, if the target is not ``ndn::nanoseconds``.
- ndn::getNow, ndn::ndn_getNowMilliseconds, ndn::time::now are all
  removed in favor of the now() method in a specific clock:

    * time::system_clock::now();
    * time::steady_clock::now();

- When necessary to convert system_clock::TimePoint to unix timestamp,
  ``time::toUnixTimestamp`` can be used.  This method return number of
  milliseconds since UNIX epoch as ``ndn::time::milliseconds`` type.
  Use count() method to obtain number as an integral value.

Change-Id: Icd688bc6766e008d60c3d2888173627874526e47
Refs: #1152
2014-03-18 16:19:53 -07:00
Alexander Afanasyev 29e5c3dc77 encoding: Fixing Block (and as a result Name) encoding bugs
As of this commit, all non-const operations on Block will call resetWire
to remove all references to the wire, so it will be recreated next time
"encode" method is called.  Also, all getter methods now have only const
versions and non-const access to the internal data structure is
prohibited.

Change-Id: If4b485dd62541d9d4d168a44490068e4deff56c1
2014-02-11 00:01:10 -08:00
Alexander Afanasyev 0222fba8b7 api: Major API change. OnInterest/OnData callbacks now use just references, not shared pointers
If shared pointer is necessary, it can be obtained using
.shared_from_this() on Interest or Data object.

This commit also corrects all internal uses of expressInterest/setIntersetFilter.

Change-Id: I20207a5789fd189902f2c6e3827260b6b27a2514
2014-02-09 23:21:54 -08:00
Alexander Afanasyev f6468892d3 util: Importing scheduler, originally implemented in NFD
The scheduler uses monotonic clock whenever available.

This commit also includes an example to show how to work with the
scheduler.

Change-Id: I006bcc6afddd33caa8d1ec9575c0596234315411
2014-01-29 11:15:04 -08:00