c++ library for reactive programming. Based on streamulus.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
CMakeLists.txt
README
cell.hpp
main.cpp
math_funcs.hpp
operators.hpp
spreadsheet.hpp

README

spreadsheet is a C++ library that enables "spreadsheet-programming", i.e., setting up variables ('cells') where each cell is assigned an expression that can contain the values of other cells. Changes are propagated to all dependent cells, as in a spreadsheet.

You create a new cell as follows:

    Cell<double> a = sheet.NewCell<double>("a");

And you assign an expression to a cell as follows:

    Cell<double> a = sheet.NewCell<double>("a");
    Cell<double> b = sheet.NewCell<double>("b");

    a.Set( SQRT(2 * b()) );
    b.Set(18.3);

You get the current value of a cell with:

    a.Value()

See main.cpp for a complete program with a simple usage example. 

Spreadsheet was developed to demonstrate the use of streamulus. There are currently a few limitations, which will be removed if there is interest in this library for its own sake:

* Cyclic dependencies are not detected. You will be rewarded with the infinite loop you deserve. 
* Note that in the code above, we needed to write "b()" in the expression assigned to a, rather than just "b". This is unfortunate, and with some proto-trickery can be fixed. 

See also:

Blog post at http://streamulus.blogspot.co.uk/2012/08/spreadsheet-programming-in-c.html

Building:

spreadsheet is a header-only library. It uses boost and streamulus. So put these three libraries in your include path. That's all.