comp.lang.ada
 help / color / mirror / Atom feed
From: "Lucretia" <lucretia9@lycos.co.uk>
Subject: Re: Strange factory for wxAda
Date: 24 Oct 2005 06:09:30 -0700
Date: 2005-10-24T06:09:30-07:00	[thread overview]
Message-ID: <1130159370.271992.266400@g47g2000cwa.googlegroups.com> (raw)
In-Reply-To: <SbudnctNQq9i8MjeRVn-jA@megapath.net>

> > At the moment, I'm not even thinking about tasking, this will have to
> > be thought about later, when I turn my event handler into some sort of
> > protected object, which will be tricky considering that that is called
> > from C++ :-/
>
> Careful. You really need to think about tasking early on, because it is
> extremely hard to graft it on afterwards. Now, you may decide that it simply
> isn't worth it, and decide to restrict the uses to one task (as GWindows
> does, for instance), but it's best to decide on the approach right away.

Yeah, I know it would be difficult to stick in later, but seeing as
wxAda is in very early stages at the moment, e.g. code rearranging,
getting a very basic app working, etc. to find out what raelly needs to
be done to make a usable library.

Basically, at this moment in time, it would be easy to rearrange the
code I do have to fit it around any major changes.

I also do want to be able to use the tasking features of Ada, this way
I don't need to wrap wxThread, wxMutex, etc. I haven't touched tasking
for a long time (not since university!) so I'd need to get all that
sorted inside my own head (again). I have a question about this, but I
need to think about it some more with the code I have in wxAda for
handling the events from the C++ side to the Ada side, so I'll sort
that out and bring it over later or tomorrow.

> That's what I meant. If you want to do the allocation yourself, you really
> don't want any dangling references. So you might want to do whatever it
> takes to avoid them (that means making the type limited and not using any
> access types in your client interface).

Yeah, I have a smart pointer type in my 3D engine code (I think), I can
nab that ;-D

Currently the wxAda type is derived from Limited_Controlled so yu
cannot copy them, but you can grab the addresses, and after some of
your advice, I changed the code so that the access types are grabbed
inside wxAda. I suppose I could wrap these in my smart pointer type and
store them, that might make sense.

> In any case, this seems like a tough problem, which I'm glad I don't need to
> solve. :-)

Yeah, lucky you! ;-D

Thanks,
Luke.




      reply	other threads:[~2005-10-24 13:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-17 15:59 Strange factory for wxAda Lucretia
2005-10-18  0:36 ` Randy Brukardt
2005-10-18 16:28   ` Lucretia
2005-10-18 21:53     ` Randy Brukardt
2005-10-24 13:09       ` Lucretia [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox