Boost logo

Boost :

Subject: [boost] first steps to submitting - boost :: observers
From: Robert McInnis (r_mcinnis_at_[hidden])
Date: 2016-09-17 14:10:50


G'afternoon,

 

This is my first time submitting to a public repo, please be gentle

 

I'd like to submit a series of classes I have been using since '90. The
initial set implements a thread safe subject/observer pattern. I have
included a handful of example programs, two fairly trivial and the third
more in-depth. All examples are single file examples to make compilation
trivial.

 

This is the first re-work of my original tools, making them more
boost-friendly. I expect to add more default observer templates and
observable objects, but that will come with time.

 

WHY?

--
The reason for these classes is to help insure the mathematical integrity of
your data model in relation to your business rules.  If at any time you were
to change one of your data elements without updating all those dependent on
it, then your data integrity would be compromised.  These classes look to
solve that.
 
As an example:
--
using namespace boost::observers ;
 
Numeric<long> x, y, z ;
 
//  rules:  y = x + 2;   z = y * 3 ;
 
x = 5 ;
printf( "%d \n", z ) ;
x = 1 ;
printf( "%d \n", z ) ;
--
 
Setting the rules properly, the classes allow for 'z' to be correct each
time it's printed using code almost exactly like this.  This will remove the
possibility of accidently forgetting to trigger the rule update.
 
WHERE?
--
The repo can be found here:    git clone
https://github.com/tiny/boost_observers.git
 
Any input on how to continue from this point would also be much appreciated.
I have skype and ventrilo servers available if that helps.
 
Thanks in advance,
 
Rob    
--
Robert McInnis
 
 

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk