This project is read-only.




I am very keen to use Rx in my Cpp console application.

Is there any documentation? Install RxCpp, and Observer/Observables?

Here is my issue at the Reactive Extensions Forum.

Kind regards,



kirkshoop wrote Feb 2, 2014 at 4:39 AM

Hi! I looked at your forum post and replied there.

It would be great to spend some time making documentation specific to rxcpp. I have not invested in that yet. I have been trying to work on basic infrastructure and functionality.

MrDaniel wrote Feb 10, 2014 at 1:17 AM

Thank you for you help so far.

I would in fact like to implement 3 methods.

Buffer (I know you're keen for this one) and an OrderedBuffer and BufferByID. These two methods could in fact be one and the same.

Which operators would be the best template to start with, using existing operators?

Could you outline the steps you expect to have to make in order to do this?

Can I commit these back the project and get my name mentioned somewhere?



MrDaniel wrote Feb 10, 2014 at 3:44 AM

Just to note. I have implemented OrderedBuffer and BufferByID in C# without using the Buffer method available in that api. I'm hoping you will be able to give me enough information with which to complete this contribution.

MrDaniel wrote Feb 10, 2014 at 5:20 AM

One last thing.... this is the attempt i have so far to get what i want. Any tips would be good.

Any clues on this route.

std::vector<shared_ptr<Observable<NewClass>>> inputs;
auto merged = from(inputs[0]);
for( i=1 in inputs.size())
merged = merged.merge(inputs[i]);

//I want to group them by so i receive all of the NewClass objects of the same id.
function<NewClass,int> func = { return }
mainInput = GroupBy(merged, func, ??, inputs.size());

Unsure what to do with the value selector. :S

kirkshoop wrote Feb 11, 2014 at 12:12 AM

Contributions welcome!

You will need to have a CLA on file before the changes can be evaluated. You can do that here:

Once you have the CLA on file make some pull requests and we can get started!


MrDaniel wrote Feb 11, 2014 at 9:38 PM

Ok.... CLA - done. Repo cloned.

Now what is next....

kirkshoop wrote Feb 11, 2014 at 11:05 PM

Cool! I would suggest looking at rx.Net Buffer to see what the structure is for implementing that operator and then rxcpp Select to see how that structure should be mapped into rxcpp.

Once that is done then it should not be too difficult to take the rxcpp Buffer and transform it into each of the other operators you want to build.

Your name would at least appear as the author of the commits :) it can be added to AUTHORS as well, as a part of your pull request, (I haven't added myself to AUTHORS yet).

Here is my attempt to rxcpp-ify the code you posted.
typedef shared_ptr<Observable<NewClass>>Input;
std::vector<Input> inputs;
Input merged;
for(auto& i : inputs)
  if (!merged) {
    merged = observable(i);
  } else {
    merged = observable(from(merged).Merge(i));

 //I want to group them by so i receive all of the NewClass objects of the same id. 
mainInput = from(merged).GroupBy([](const NewClass& nc){return;});
The value selector should default to pass_through (the NewClass that goes in is returned)
The from & observeable noise should go away in the next major version of rxcpp.


MrDaniel wrote Feb 12, 2014 at 4:24 AM

Sweet. Are we ok to continue our communication on this thread? Or should i email you?

I'm using Visual Studio 2012. I've loaded up RxCpp but i can't find the operators. The solution file has projects for testbench and MfcTimeFliesLikeAnArrow. hpp files for Operators don't seem to be included in either the solution or the projects.

What steps do i need to take to edit RxCpp and use in testbench?

2) Git Security
I've started with Buffer.hpp, i was going to commit for you to review. I am not usually in the habit of committing broken untested code, it works in my mind's eye.... but that isn't ideal. :)

Should i have a username and password for the repo? Or is that associated with the CLA?

3) std::vector<Tin>
I'm using the std::vector instead of a List as the buffer's return, and i was hoping to ask your advice on this choice. For instance, once i have buffers are in place i'd like to replace the above code with an override for the merge function so that they can take a std::vector.

The next question is about what overrides are to be implemented. I'm going to do the ones i need and i will try and add others if it is straight forward enough. Perhaps not the complex timers etc.

MrDaniel wrote Feb 12, 2014 at 4:41 AM

Operators are defined included, but not visible in the solution. Still unsure how to get testbench to play with the buffer code now it is included correctly.

MrDaniel wrote Feb 12, 2014 at 11:33 PM

I've tried to implement the rx function with my code and it looks good except for these errors.

Error 37 error C2039: 'Merge' : is not a member of 'rxcpp::Binder<Obj>' c:\users\daniel\documents\visual studio 2012\projects\visionbase\visionbase\node.h 70 1 VisionBase

Error 38 error C2039: 'GroupBy' : is not a member of 'rxcpp::Binder<Obj>' c:\users\daniel\documents\visual studio 2012\projects\visionbase\visionbase\node.h 73 1 VisionBase

I've included rx.hpp and then i tried it with rx-opertors.hpp included.

MrDaniel wrote Feb 19, 2014 at 3:13 AM


kirkshoop wrote Feb 19, 2014 at 3:38 PM

Sorry. I was distracted by v2. :)

the binder uses lowercase names. So .merge and .group_by should work

kirkshoop wrote Feb 19, 2014 at 4:46 PM

I have added build steps here.

MrDaniel wrote Feb 19, 2014 at 8:30 PM

Thank you so much. :)

I hope i can make something of worth that can feature in v2. :)

kirkshoop wrote Feb 19, 2014 at 9:13 PM

Please do! Any operators added to v1 should be easily ported to v2 when it is ready.

MrDaniel wrote Feb 21, 2014 at 5:30 AM


Apologies for the delay. Seems VS2012 is not stable in my version of Windows. Currently downloading 2010 so will be up and running soon.