List Info

Thread: C encapsulation




C encapsulation
country flaguser name
United States
2008-02-29 07:28:04

Hi all,

I want to use C structs within Eiffel (for testing C structs persistence in db4o), but don't know how to do it. For example, I have

typedef struct point {
int x;
int y;
} Point;

in header.h, the question is how to create an instance of Point in Eiffel.

Regards,
Ruihua

__________________________________________________________
Looking for last minute shopping deals?
Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping

[Non-text portions of this message have been removed]

__._,_.___
.

__,_._,___
Re: C encapsulation
country flaguser name
United States
2008-02-29 07:43:29

You should first wrap the C struct into an Eiffel class. For a good
and simple example, please see class WEL_GDIP_RECT.

--- In eiffel_software%40yahoogroups.com">eiffel_softwareyahoogroups.com, Ruihua Jin <jin.ruihua...> wrote:
&gt;
> Hi all,
>;
> I want to use C structs within Eiffel (for testing C structs
persistence in db4o), but don't know how to do it. For example, I have
>;
> typedef struct point {
> int x;
> int y;
> } Point;
&gt;
> in header.h, the question is how to create an instance of Point in
Eiffel.
>
> Regards,
> Ruihua
&gt;
>
>
>
>
__________________________________________________________
> Looking for last minute shopping deals?
> Find them fast with Yahoo! Search.
http://tools.search.yahoo.com/newsearch/category.php?category=shopping
>
> [Non-text portions of this message have been removed]
>

__._,_.___
.

__,_._,___
RE: C encapsulation
user name
2008-02-29 09:04:51

Note that using what Larry gave you is not going to work properly for
persistence as you will be storing a pointer (the pointer to the struct), so
for persistence you also need to create an Eiffel corresponding attribute
for each field of the C structure.

Manu

> -----Original Message-----
> From: eiffel_software%40yahoogroups.com">eiffel_softwareyahoogroups.com
> [mailto: eiffel_software%40yahoogroups.com">eiffel_softwareyahoogroups.com] On Behalf Of Ruihua Jin
> Sent: Friday, February 29, 2008 5:28 AM
> To: eiffel_software%40yahoogroups.com">eiffel_softwareyahoogroups.com
> Subject: [eiffel_software] C encapsulation
>
> Hi all,
>;
> I want to use C structs within Eiffel (for testing C structs
> persistence in db4o), but don't know how to do it. For example, I have
>;
> typedef struct point {
> int x;
> int y;
> } Point;
&gt;
> in header.h, the question is how to create an instance of
> Point in Eiffel.
>
> Regards,
> Ruihua
&gt;
>
>
>
>
> __________________________________________________________
> ______________________
> Looking for last minute shopping deals?
> Find them fast with Yahoo! Search.
> http://tools.search.yahoo.com/newsearch/category.php?category=shopping
>
> [Non-text portions of this message have been removed]
>
>
>
>
> Yahoo! Groups Links
&gt;
>
>
>

__._,_.___
.

__,_._,___
RE: C encapsulation
country flaguser name
Canada
2008-03-01 04:24:08

Hi Ruihua

I had attempted to make some use of db4o from Eiffel but failed. I'm hoping
you may be willing to help get me started.

Regards

Chris Saunders

evas%40mountaincable.net">evasmountaincable.net

From: eiffel_software%40yahoogroups.com">eiffel_softwareyahoogroups.com
[mailto: eiffel_software%40yahoogroups.com">eiffel_softwareyahoogroups.com] On Behalf Of Ruihua Jin
Sent: Friday, February 29, 2008 8:28 AM
To: eiffel_software%40yahoogroups.com">eiffel_softwareyahoogroups.com
Subject: [eiffel_software] C encapsulation

Hi all,

I want to use C structs within Eiffel (for testing C structs persistence in
db4o), but don't know how to do it. For example, I have

typedef struct point {
int x;
int y;
} Point;

in header.h, the question is how to create an instance of Point in Eiffel.

Regards,
Ruihua

__________________________________________________________
Looking for last minute shopping deals?
Find them fast with Yahoo! Search.
http://tools.search.yahoo.com/newsearch/category.php?category=shopping

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]

__._,_.___
.

__,_._,___
[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )