|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I want to have a container of objects which stores unique entities
like a set does, but instead of rejecting the insertion of duplicate
entries, they should be deleted. Subsequent attempts to insert an
already deleted object should be rejected. How should I go about it in
the most efficient way?
Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] vipbg
TAG e-mail : pet### [at] tagpovrayorg
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Peter Popov wrote in message ...
>I want to have a container of objects which stores unique entities
>like a set does, but instead of rejecting the insertion of duplicate
>entries, they should be deleted. Subsequent attempts to insert an
>already deleted object should be rejected. How should I go about it in
>the most efficient way?
If I understand you correctly, you want a data container that, when you add
something the first time, accepts it. If you add it a second time, it gets
deleted instead, and if you add it more times, it doesn't get added? If
this is correct, the easiest way to do this is to add a "deleted" flag to
each object when you add it. When you remove the object, it doesn't
actually get deleted, but instead gets marked as being deleted, so you can
see if it has already been added later.
--
Mark
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Mon, 17 Sep 2001 02:55:54 -0400, "Mark Wagner"
<mar### [at] gtenet> wrote:
>If I understand you correctly, you want a data container that, when you add
>something the first time, accepts it. If you add it a second time, it gets
>deleted instead, and if you add it more times, it doesn't get added? If
>this is correct, the easiest way to do this is to add a "deleted" flag to
>each object when you add it. When you remove the object, it doesn't
>actually get deleted, but instead gets marked as being deleted, so you can
>see if it has already been added later.
Maybe I can use a set of objects and a separate set of deleted objects
(or rather, their IDs), as an alternative. How does that look,
programming-wise?
Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] vipbg
TAG e-mail : pet### [at] tagpovrayorg
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Peter Popov wrote in message <6mkcqt4q61cicae18hqk10ocni39d3b6to@4ax.com>...
>Maybe I can use a set of objects and a separate set of deleted objects
>(or rather, their IDs), as an alternative. How does that look,
>programming-wise?
Sounds like a little more work, but probably easier to debug.
--
Mark
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|