Boost logo

Boost :

Subject: [boost] [data_binding] Lets bind data
From: Kasra (kasra_n500_at_[hidden])
Date: 2009-04-08 11:10:18


Hi,

I am looking for interest in data_binding techniques in C++. The idea is
to have a class that could bind to a list of data and when ever any of them
is changed the value of the binder is changed too:

data_bindee<mpz_class> x;
data_bindee<mpz_class> y;

typedef tuple<mpz_class,mpz_class> my_bind_tuple_type;
struct my_bind_pred_type
{
  template<typename BinderT>
  void operator(BinderT& me, my_bind_tuple_typeT t) {
    me.x = get<0>(t);
    me.y = 2 * get<0>(t);
  }
};

data_binder<struct { mpz_class x,y; },
my_bind_tuple_type, my_bind_pred_type> point(x, y);

// when ever data of x and y is changed the value of point
// is updated too.

Any suggestions??

Kasra

With Best Regards

-- Kasra Nassiri

      


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