Ok, it can be a bit confusing...this is largely because the RexxQueue
class serves a dual role.  Originally, RexxQueue was the backing
implementation for the PUSH and QUEUE instructions and the entity
accessed by the RXQUEUE builtin function.  In this role, the name of
the queue backing the object needed to be switchable, and some of the
methods also needed names provided.  Thus BIFS such as
RxQueue("Create") will map directly to the create() method of
RexxQueue.

In the other role, you can use a RexxQueue as a sort of stream that
will allow you to access multiple named queues at one time as an
object instance.  Thus

q1 = .rexxqueue~new("Rick")
q2 = .rexxqueue~new("Jon")

q1~push("foo")
q2~push("bar")
say q1~pull q2~pull

This is the more typical direct usage of RexxQueue.   The two RFEs
would all you to do

q1~empty

to remove everything from the queue and

do line over q1
    say line
end

to iterate over everything in the queue.

Rick


On Tue, Aug 12, 2008 at 7:55 AM, Sahananda (Jon) Wolfers
<[EMAIL PROTECTED]> wrote:
> I have reverted to my former position.
>
> There is something I don't understand about the RexxQueue class.  It
> seems counterintuitive to me.
> Something in the area of the distinction between the name of the Queue
> and the instance of the class.
>
> The new method returns an instance that has a string value of the name
> of the queue, which you are then
> meant to supply as a handle to the other methods.
>
> It might help to know whether there is intended to be a 1->1
> relationship between instances of the RexxQueue class
> and named Rexx external queues. Some of the methods seem to suggest a
> 1->1 relationship, others a serial
> 1->many relationship or a concurrent 1->many relationship.
>
> Reading the above para I could make that clearer. is it that:
> a) A RexxQueue instance can manage one Rexx named external queue
> b) A RexxQueue instance can manage many Rexx named external queues,
> but only one at a time or
> c) A RexxQueue instance can manage many Rexx named external queues,
> all at the same time
>
> If someone could knock up a 10 line example of creating, populating,
> pulling and deleting a RexxQueue
> I could take it from there.
>
> The manual definitely needs an example as I'm sure we can find a few
> other users at least as
> dense and obtuse as I am.
>
> thanks,
>
> Jon
>
> 2008/8/11 Rick McGuire <[EMAIL PROTECTED]>:
>> busted!!!!!!  :-)
>>
>> Rick
>>
>> On Mon, Aug 11, 2008 at 6:53 AM, Sahananda (Jon) Wolfers
>> <[EMAIL PROTECTED]> wrote:
>>> Thanks Rick,
>>>
>>> I will look into it!  This is just a cunning way to show me that
>>> learning c++ would be fun isn't it.
>>>
>>> Jon
>>>
>>> 2008/8/11 Rick McGuire <[EMAIL PROTECTED]>:
>>>> John,
>>>>
>>>> Note that in 4.0, the clear method (probably should be "empty" to be
>>>> consistent with the other collection classes) would be best
>>>> implemented by C code using the RexxClearQueue() API I just added.
>>>> The file in question is interpreter/classes/RexxQueueMethods.cpp.  The
>>>> code would be basically this:
>>>>
>>>>
>>>>
>>>> /********************************************************************************************/
>>>> /* Rexx_clear_queue
>>>>                    */
>>>> /********************************************************************************************/
>>>> RexxMethod0(int, rexx_clear_queue)
>>>> {
>>>>
>>>>                                      /* get the queue name                
>>>> */
>>>>   RexxObjectPtr queue_name = context->GetObjectVariable("NAMED_QUEUE");
>>>>                                          /* pull a line
>>>>        */
>>>>   return RexxClearQueue(context->ObjectToStringValue(queue_name));
>>>> }
>>>>
>>>> You should be able to add that at the end of the RexxQueueMethods.cpp
>>>> file, then in the RexxQueue ooRexx code, you reference that using:
>>>>
>>>> ::METHOD empty         EXTERNAL 'LIBRARY REXX rexx_clear_queue'
>>>>
>>>> Rick
>>>>
>>>>
>>>> On Mon, Aug 11, 2008 at 1:58 AM, Sahananda (Jon) Wolfers
>>>> <[EMAIL PROTECTED]> wrote:
>>>>> I could take on the rfe's for the RexxQueue class.  Although the base
>>>>> methods are written in C++ it looks like I could add MareArray and Clear 
>>>>> in
>>>>> Rexx in STreamClasses.orx.
>>>>>
>>>>> Only drawback is that I don't know what a Rexx External Queue is.
>>>>>
>>>>> I understand Queues (ie: the Queue Collection class) and from my VM days I
>>>>> understand 'The Stack' which I use in oorexx by piping output to RxQueue 
>>>>> and
>>>>> retrieve using parse pull.
>>>>>
>>>>> I've looked in the manuals and googled a bit.  Can anyone give me a short
>>>>> easy code sample using the RexxQueue class please.
>>>>>
>>>>> thanks,
>>>>>
>>>>> Jon
>>>>>
>>>>> -------------------------------------------------------------------------
>>>>> This SF.Net email is sponsored by the Moblin Your Move Developer's 
>>>>> challenge
>>>>> Build the coolest Linux based applications with Moblin SDK & win great
>>>>> prizes
>>>>> Grand prize is a trip for two to an Open Source event anywhere in the 
>>>>> world
>>>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>>>> _______________________________________________
>>>>> Oorexx-devel mailing list
>>>>> Oorexx-devel@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/oorexx-devel
>>>>>
>>>>>
>>>>
>>>> -------------------------------------------------------------------------
>>>> This SF.Net email is sponsored by the Moblin Your Move Developer's 
>>>> challenge
>>>> Build the coolest Linux based applications with Moblin SDK & win great 
>>>> prizes
>>>> Grand prize is a trip for two to an Open Source event anywhere in the world
>>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>>> _______________________________________________
>>>> Oorexx-devel mailing list
>>>> Oorexx-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/oorexx-devel
>>>>
>>>
>>> -------------------------------------------------------------------------
>>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
>>> Build the coolest Linux based applications with Moblin SDK & win great 
>>> prizes
>>> Grand prize is a trip for two to an Open Source event anywhere in the world
>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>> _______________________________________________
>>> Oorexx-devel mailing list
>>> Oorexx-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/oorexx-devel
>>>
>>
>> -------------------------------------------------------------------------
>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
>> Build the coolest Linux based applications with Moblin SDK & win great prizes
>> Grand prize is a trip for two to an Open Source event anywhere in the world
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> _______________________________________________
>> Oorexx-devel mailing list
>> Oorexx-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/oorexx-devel
>>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Oorexx-devel mailing list
> Oorexx-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/oorexx-devel
>

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to