June 2018
Intermediate to advanced
348 pages
8h 45m
English
The Streamulus library, from Irit Katiel, is a library that makes the programming of event Streams easier with a programming model, which implements domain-specific embedded language (DSEL). To understand the programming model, let's inspect a program that Streams data into a class that aggregates received data:
#include "Streamulus.h"
#include <ioStream>
using namespace std;
using namespace Streamulus;
struct print {
static double temp;
print() { }
template<typename T>
T operator()(const T& value) const {
print::temp += value;
std::cout << print::temp << std::endl; return value;
}
};
double print::temp = 0;
The preceding functor just accumulates the value passed into a static variable. For ...