Clara-Doc - Programmer Reference

Module: CTBUFFLST

Methods

MethodDescription
CTBUFFLST_BuffLengthReturns the size in bytes of the buffer held at a specific index location within the buffer list.
CTBUFFLST_ClearRemoves all buffers from the list.
CTBUFFLST_ConstructorCreates an instance of type CTBUFFLST.
CTBUFFLST_CountReturns the number of buffers held in the list.
CTBUFFLST_DestructorReleases the resources allocated by a CTBUFFLST instance and the CTBUFFLST instance itself.
CTBUFFLST_GetBufferRetrieves a buffer at a specified location into a CTBUFF instance.
CTBUFFLST_GetValueRetrieves a buffer at a specified location.
CTBUFFLST_InsertBufferInserts a buffer in the list from a CTBUFF instance.
CTBUFFLST_InsertValueInserts a buffer in the list.
CTBUFFLST_RemoveRemoves a buffer from the list.
CTBUFFLST_SetBufferUpdates the value of a buffer at a specified location within the list from a CTBUFF instance..
CTBUFFLST_SetValueUpdates the value of a buffer at a specified location within the list.



Description

The CTBUFFLST class inplements a linked list of byte buffers. Individual byte buffers can be retrieved either as CTBUFF instances or in a caller-supplied buffer. Byte buffers can also be inserted from CTBUFF instances or from caller-supplied buffers.
Creating and disposing CTBUFFLST instances
Before using a CTBUFFLST, a CTBUFFLST instance has to be created (constructed). This is done by calling the CTBUFFLST_Constructor method. A pointer to a CTBUFFLST instance will be returned to the caller. This pointer will be used in calls to other CTBUFFLST methods. Every time CTBUFFLST_Constructor is called, a new CTBUFFLST instance is created and accessible through the pointer that is returned. This allows for several CTBUFFLST instances within the same porgram. Be sure to pass the appropriate pointer when calling CTBUFFLST methods. Once a CTBUFFLST instance is no longer needed, its resources have to be reclaimed via a call the the CTBUFFLST_Destructor method (you must pass the pointer to the CTBUFFLST instance that will be garbage collected). Call the CTBUFFLST_Constructor method on every CTBUFFLST instance once they are no longer needed. In between calls to the constructor and the destructor for a given CTBUFFLST instance, you may call any CTBUFFLST method on that CTBUFFLST instance.
                                       
 /INCLUDE QINCSRC,CTBASE               
                                       
DRc               S             10I 0  
DpList            S               *    
                                       
 /Free                                 
                                       
    pList = CTBUFFLST_Constructor();      
                     
                     
    // Use CTBUFFLST instance via methods by using the pList pointer                                   
    //
    // ...
    
    
    // We are done and need to gargabe collect CTBUFFLST resources
    
    CTBUFFLST_Destructor(pList);          
                                       
    *InLR = *On;                       
    Return;                            
                                       
 /End-Free