June 2018
Intermediate to advanced
348 pages
8h 45m
English
In this section, the Stream item is a user-defined type to represent an employee, and the code is intended to group the input Stream based on the roles and salaries of employees:
#include "rxcpp/rx.hpp"
namespace Rx {
using namespace rxcpp;
using namespace rxcpp::sources;
using namespace rxcpp::subjects;
using namespace rxcpp::util;
}
using namespace std;
struct Employee {
string name;
string role;
int salary;
};
The libraries and namespaces required in the code are included, and the data structure to represent an Employee is declared. The Employee type is a simple structure, with data items such as name, role, and salary. We have treated the salary field as an integer:
int main() { Rx::subject<Employee> ...Read now
Unlock full access