Perhaps for semantic reasons, you don't want folks removing items from
the queue other than in FIFO order? Of course, that same argument would apply
to the ACE_Unbounded_Stack (i.e. don't remove except in LIFO order).
But there *are* ACE_Unbounded_Stack::find and ACE_Unbounded_Stack::remove
methods. So much for that theory.
I'm looking at Containers_T.h in ACE version 4.6.4, but checked Doug's
workspace to see if they might have been added since. They have not.
Thanks.
Susan
--
===========================================================================
Susan Liebeskind (susan.li...@gtri.gatech.edu)
GTRI/ITTL/CSITD
347 Ferst St
Atlanta, GA 30332-0832 Phone 404-894-4266
>I'm curious if the lack of this functionality in ACE_Unbounded_Queue
>is an oversight or deliberate.
It's deliberate in the sense that we didn't have a need for these
functions, so we never put them in. However, there's no particular
reason they couldn't be added. If you need them, and would like to
add them and send us the changes, please do so.
Thanks,
Doug
--
Dr. Douglas C. Schmidt, Associate Professor
Department of Computer Science, Washington University
St. Louis, MO 63130. Work #: (314) 935-4215; FAX #: (314) 935-7302
sch...@cs.wustl.edu, www.cs.wustl.edu/~schmidt/
Since duplicates are allowed in ACE_Unbounded_Queue, find and
remove would need to work differently than the other containers it comes
bundled with. Instead of find, you prob. want find_first, find_next,
find_last, find_all, and similarly for remove (remove_first, remove_next,
and so on). I think if you really want a queue without duplicates, but with
find and remove facilities, you could make ACE_Unbounded_Set do what
you wanted.
FWIW, it did surprise me to see that ACE_Unbounded_Stack doesn't allow duplicate
entries whereas ACE_Unbounded_Queue does allow duplicate entries. I usually
think of those two ADTS as being nearly identical, differing only
in where new items come in. In the ACE case, they also differ on the policy
regarding duplicates, and on some other methods as well. Diff. strokes,
but it did take a couple moments to detect the subtle difference :-)
Later,
Susan
This was probably due to the needs of some higher level service
implemented in ACE, and not really a standard ADT design. Someone out
there will probably eventually take it upon themselves to strategize
the insertion and deletion properties of the containers, so that you
can have it both ways (or any way of your choosing). The someone is
probably not me :-).
--
James C. Hu <j...@cs.wustl.edu> Computer Science Doctoral Candidate
http://www.cs.wustl.edu/~jxh/ Washington University in Saint Louis
>>>>>>>>>>>>> I use *SpamBeGone* <URL:http://www.internz.com/SpamBeGone/>
> Actually, for what I need, the first cousin ACE_Unbounded_Set will
> suffice.
Great.
> I don't in fact want duplicate entries in the set (which
> ACE_Unbounded_Queue permits)
Right, which makes sense since its a queue and not a set...
> and ACE_Unbounded_Set has the find/remove methods I want.
Cool.
> Since duplicates are allowed in ACE_Unbounded_Queue, find and remove
> would need to work differently than the other containers it comes
> bundled with.
Right -- which is probably one reason they aren't there... ;-)
> Instead of find, you prob. want find_first, find_next, find_last,
> find_all, and similarly for remove (remove_first, remove_next, and
> so on). I think if you really want a queue without duplicates, but
> with find and remove facilities, you could make ACE_Unbounded_Set do
> what you wanted.
Yup.
> FWIW, it did surprise me to see that ACE_Unbounded_Stack doesn't
> allow duplicate entries whereas ACE_Unbounded_Queue does allow
> duplicate entries.
If you restrict yourself to normal Stack operations, i.e., push() and
pop(), then it doesn't check if there are duplicates or not...
> I usually think of those two ADTS as being nearly identical,
> differing only in where new items come in. In the ACE case, they
> also differ on the policy regarding duplicates, and on some other
> methods as well.
As James pointed out, the non-duplicate semantics for the
find()/insert()/remove() features were added at some point to support
other uses of the ACE_Unbounded_Stack. In particular, it's used in
the ACE_TSS implementation. In general, unless you really know what
you're doing you shouldn't use the insert()/remove() methods on the
ACE_Unbounded_Stack. I've updated the documentation to reflect this.