blob: ffb09477dd9a5c6de418a02d0fcdd43451eeb735 [file] [log] [blame] [view]
Jeff Thompsonfa306642013-06-17 15:06:57 -07001NDN.cxx: C++ NDN API (using CCNx C Library)
2===========================================
Alex Nano43578822013-06-17 10:06:07 -07003
Jeff Thompsonfa306642013-06-17 15:06:57 -07004People often feel confusing and tedious when using CCNx C library, and this is an attempt to make it easier to program NDN applications using C++.
5
6This API remotely resembles PyCCN API if you by any chance have already got yourself familiar with that.
7
8The functions included are be roughly devided into two categories: NDN operations and async operations.
9
101. NDN Operations
11------------------
12This is a set of functions that provide relative easier ways to perform NDN operations, including manipulating NDN names, content objects, interests, sending interests, callbacks (closure) for content objects, name prefix discovery, signature verifications, etc.. There is also a blocking API to fetch content object.
13
142. Async Operations
15-------------------
16Communications in NDN is mostly async. There is an event thread running NDN and processing the NDN events (e.g. interests received, expired, content received, etc..). As such, you don't really want to do a lot of processing in the NDN event thread (which blocks processing of that events). Hence we provide a simple executor API, which allows you to process the events in separate threads. We also provide a scheduler which allows you to scheduler various events as you wish. The scheduler is based on libevent C API.
17
183. Build and Install
19--------------------
20To see more options, use `./waf configure --help`.
21For default install, use
22```bash
23./waf configure
24./waf
25sudo ./waf install
26```
27
28### If you're using Mac OS X, Macport's g++ is not recommended. It may cause mysterious memory error with tinyxml. Use clang++ or Apple's g++ instead.
29
30Normally, default install goes to /usr/local.
31If you have added /usr/local/lib/pkgconfig to your `PKG_CONFIG_PATH`, then you can compile your code like this:
32```bash
33g++ code.cpp `pkg-config --cflags --libs libndn.cxx`
34```
35
364. Examples
37-----------
38
39example/ directory contains a fully working example of simple client and server applications written using NDN.cxx API.
40
41There is also an extensive usage of this library in [ChronoShare](https://github.com/named-data/ChronoShare).
42
43