Re: C++ properties Library Created (was Binding together Properties of Objects)

Discussion in 'C++' started by Victor Porton, Aug 28, 2004.

  1. Wavemaker <> wrote:
    >> Wavemaker <> wrote:


    >> > someObject.SomeProperty = someValue;


    OK, I implemented this in a good way - http://ex-code.com/propcpp/

    #include <propc++/property.h>

    class Widget
    {
    ...
    Color get_color();
    void set_color(Color value);
    prop::property<Widget, Color, &Widget::set_color, &Widget::get_color>
    color;
    ...
    };

    ....

    widget.color = "red";

    Binding properties together
    (http://ex-code.com/articles/binding-properties.html) is not yet
    implemented in 0.1 (subscribe to news at
    http://ex-code.com/xml-files.html).

    You are welcomed to send patches! You are welcome to search for the most
    efficient impl of binding properties.

    > Last evening, I decided to take a stab at implementing
    > binding properties in C++. I came up with the following:


    No, not the best way. Instead extend libpropc++, the C++ properties library.
    Some parts of new library libpropc++ use libsigc++
    (http://libbsigc.sf.net), the C++ signalling library (an implementation of
    OO "Observer pattern").

    P.S. I added Followup-To: comp.lang.c++ as this is a C++ specific topic now.

    --
    == Victor Porton () ==
    # http://ex-code.com - software company, custom software for low price #
    # http://ex-code.com/~porton/ - Christian revelations, math discoveries #
    # http://ex-code.com/articles/ - original programming/XML articles #
     
    Victor Porton, Aug 28, 2004
    #1
    1. Advertising

  2. Victor Porton wrote:

    > Wavemaker <> wrote:
    >>> Wavemaker <> wrote:

    >
    >>> > someObject.SomeProperty = someValue;

    >
    > OK, I implemented this in a good way - http://ex-code.com/propcpp/
    >
    > #include <propc++/property.h>
    >
    > class Widget
    > {
    > ...
    > Color get_color();
    > void set_color(Color value);
    > prop::property<Widget, Color, &Widget::set_color, &Widget::get_color>
    > color;
    > ...
    > };
    >
    > ...
    >
    > widget.color = "red";
    >
    > Binding properties together
    > (http://ex-code.com/articles/binding-properties.html) is not yet
    > implemented in 0.1 (subscribe to news at
    > http://ex-code.com/xml-files.html).
    >
    > You are welcomed to send patches! You are welcome to search for the most
    > efficient impl of binding properties.
    >
    >> Last evening, I decided to take a stab at implementing
    >> binding properties in C++. I came up with the following:

    >
    > No, not the best way. Instead extend libpropc++, the C++ properties
    > library. Some parts of new library libpropc++ use libsigc++
    > (http://libbsigc.sf.net), the C++ signalling library (an implementation of
    > OO "Observer pattern").
    >
    > P.S. I added Followup-To: comp.lang.c++ as this is a C++ specific topic
    > now.
    >

    This looks kind of interesting to me. I've been trying to reimplement the
    wheel for the sake of experience. I believe what your properties code
    (template?) will do for me is make it easy for me to create a "property
    sheet" for any kind of object that can use such a collection. The downside
    of all this is that none of the links work.

    Oh wait! Now I got something. Oh well, I guess I don't have a legitimate
    excuse to post this. Other than to say, I think this is a good idea.
    --
    "[M]y dislike for the preprocessor is well known. Cpp is essential in C
    programming, and still important in conventional C++ implementations, but
    it is a hack, and so are most of the techniques that rely on it. ...I think
    the time has come to be serious about macro-free C++ programming." - B. S.
     
    Steven T. Hatton, Aug 29, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jimjim
    Replies:
    12
    Views:
    1,920
    Ron Natalie
    Jun 3, 2005
  2. Replies:
    2
    Views:
    443
  3. jason2k
    Replies:
    0
    Views:
    463
    jason2k
    Oct 31, 2006
  4. JcFx
    Replies:
    0
    Views:
    302
  5. Une Bévue

    binding selector/property together

    Une Bévue, Apr 15, 2008, in forum: Javascript
    Replies:
    0
    Views:
    98
    Une Bévue
    Apr 15, 2008
Loading...

Share This Page