Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C++ (http://www.velocityreviews.com/forums/f39-c.html)
-   -   Re: C++ properties Library Created (was Binding together Properties of Objects) (http://www.velocityreviews.com/forums/t285275-re-c-properties-library-created-was-binding-together-properties-of-objects.html)

Victor Porton 08-28-2004 07:14 PM

Re: C++ properties Library Created (was Binding together Properties of Objects)
 
Wavemaker <jabberdabber@BiteMeHotmail.com> wrote:
>> Wavemaker <jabberdabber@BiteMeHotmail.com> 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 (porton@ex-code.com) ==
# 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 #

Steven T. Hatton 08-29-2004 08:02 PM

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

> Wavemaker <jabberdabber@BiteMeHotmail.com> wrote:
>>> Wavemaker <jabberdabber@BiteMeHotmail.com> 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.



All times are GMT. The time now is 01:05 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.