cdr is a data structure for storage of heterogenous values:
- String
- Double
- Integer
- Datetime
- Array of CDRs (nested CDRs)
It is used within the Front-OfficeSDK as a common object format for all protocols.
To compile the installation:
$ git submodule update --init --recursive
$ mkdir build
$ cd build
$ cmake -DTESTS=ON ../
$ make
$ make install
Language bindings can be enabled by passing -DJAVA=on, -DCSHARP=on, -DPYTHON=on to CMake. It is possible to build all bindings in the same build.
The only external dependency is SWIG, and is only required when building the Java, C# or Python bindings. For information on installing SWIG please visit the SWIG website. All other dependencies are managed through git submodules.
The following code displays example usage of the CDR.
#include "cdr.h"
#include <stdint.h>
#include <iostream>
using namespace std;
using namespace neueda;
int main ()
{
cdr d;
d.setInteger (1, 100);
d.setString (2, "hello");
int intVal;
if (d.getInteger (1, intVal))
cout << "integer: " << intVal << endl;
string val;
if (d.getString (2, val))
cout << "string: " << val << endl;
cout << "cdr: " << d.toString () << endl;
}
Examples have been provided in each language within the examples folder.
To run the unit tests:
$ make test