|
![](/i/fill.gif) |
In article <3ea7fc66$1@news.povray.org>,
"Thorsten Froehlich" <tho### [at] trf de> wrote:
> > What do you need the STL for? Reference counting is trivial to
> > implement.
>
> Yes, reinvent the wheel.
Reference counting is extremely simple...in my opinion, it doesn't come
under "reinventing the wheel". And if there is no widespread standard
implementation, rolling your own is better than not doing it at all.
> And then try to add it in a clean manner in POV-Ray.
This is a bit more difficult...what I'd really like is to dump the
current file handling completely and start over again, with a new syntax
and more functionality. To get something I'd call "clean" would require
pretty extensive changes...something I'd rather start from scratch than
try to refactor and redesign so much code.
> The problem of not being able to use "real" classes as members of
> most data structures makes it a real hassle. It is about getting a clean
> well-working implementation. It isn't about "Reference counting is trivial
> to implement." at all.
Are you talking about problems with allocating instances of those
classes? Something that causes trouble with the vtables?
It should not be difficult to create a simple reference-counted pointer
class that hides all the difficulties of using C++ objects in the data
structures, and which itself doesn't have any problems.
> It could be closed, couldn't it? So what happens if you close it inside the
> macro and the try to use it after the macro returns? You run into tons of
> problems due to the current structure of the code, and you should have an
> idea how many there are given that you have had a look at the source code
> before...
I would not use reference counting for that. Closing the file would set
some validity flag...having a reference does not mean having an open
file. Attempting to use the file would then give some kind of error.
--
Christopher James Huff <cja### [at] earthlink net>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tag povray org
http://tag.povray.org/
Post a reply to this message
|
![](/i/fill.gif) |