blu-corner / cdr

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PROJECT MOVED TO Version1 Org/cdr. THIS REPOSITORY WILL NO LONGER BE MAINTAINED.

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

About

License:MIT License


Languages

Language:C++ 62.8%Language:SWIG 16.4%Language:CMake 16.3%Language:Python 3.2%Language:C 1.3%