Skip to content

RipcordSoftware/libscriptobject

Folders and files

NameName
Last commit message
Last commit date

Latest commit

8d30722 · Oct 10, 2018
Nov 29, 2016
Nov 18, 2016
May 27, 2016
Jan 12, 2017
Mar 24, 2015
Nov 15, 2016
Nov 16, 2015
Oct 3, 2016
Nov 4, 2016
Mar 23, 2015
Oct 10, 2018
Oct 19, 2016
Nov 26, 2015
Mar 27, 2015

Repository files navigation

Build Status Coverage Status License

libscriptobject

A C++ 11 library implementing scriptable/serializable objects for big-data map-reduce data stores.

This library handles complex object, array and value hierarchies in a memory efficient and performant data structure. For example the following JS structure can easily be expressed:

{ hello: "world", pi: 3.14159, the_answer: 42, child: { lorem: "ipsum" }, bored: true }

The library uses the standard libc memory allocator with std::shared_ptr<> for object and array reference counting. In this example the object b refers to something declared in the scope of object a:

var a = { great_rock_years: [ 1970, 1971, 1972, 1973, 1974, 1975, 1976, 1977, 1978, 1979 ] };
var b = { old_man_music_years: a.great_rock_years };

Since we are using malloc/free for all objects there is no garbage collector. This is critical for big-data stores where the number of objects count in the hundreds of millions and multi-second collections are not acceptable.

Features:

  • A single allocated memory block per object
  • Fast member lookup (log N)
  • Native type storage
  • Support for arrays and nested objects
  • Repeated string caching (TODO)
  • Shared object definitions
  • Script language agnostic - integrates with JavaScript, Python, etc.

Building

Requires:

  • GCC 4.9+ or CLANG 3.5+
  • GNU Make
  • lcov, Ruby, python, python-pip (for test coverage)
  • valgrind (for memory analysis)

To build type:

$ make

To build tests with coverage:

$ make test

To create a coverage report:

$ ./coverage.sh

To analyze memory:

$ ./grind.sh

About

A C++ 11 library implementing scriptable/serializable objects

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published