Skip to content
/ cdr Public

Data structure for storage of heterogenous values

License

Notifications You must be signed in to change notification settings

Version1/cdr

Repository files navigation

cdr (Common Data Representation) Build Status Quality Gate Status

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.

Getting Started

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.

Dependencies

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.

Example Usage

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.

Running the Tests

To run the unit tests:

$ make test