ASN1C C/C++ Common Runtime
ASN1C v7.6.x
|
#include <ASN1CSeqOfList.h>
Public Member Functions | |
EXTRTMETHOD | ASN1CSeqOfList (OSRTMessageBufferIF &msgBuf, OSRTDList &lst, OSBOOL initBeforeUse=TRUE) |
EXTRTMETHOD | ASN1CSeqOfList (OSRTMessageBufferIF &msgBuf) |
EXTRTMETHOD | ASN1CSeqOfList (ASN1CType &ccobj) |
EXTRTMETHOD | ASN1CSeqOfList (OSRTMessageBufferIF &msgBuf, ASN1TSeqOfList &lst) |
EXTRTMETHOD | ASN1CSeqOfList (ASN1CType &ccobj, ASN1TSeqOfList &lst) |
EXTRTMETHOD | ASN1CSeqOfList (OSRTMessageBufferIF &msgBuf, ASN1TPDUSeqOfList &lst) |
EXTRTMETHOD | ASN1CSeqOfList (OSRTContext &ctxt, OSRTDList &lst, OSBOOL initBeforeUse=TRUE) |
EXTRTMETHOD | ASN1CSeqOfList (OSRTContext &ctxt) |
EXTRTMETHOD | ASN1CSeqOfList (OSRTContext &ctxt, ASN1TSeqOfList &lst) |
EXTRTMETHOD | ASN1CSeqOfList (OSRTContext &ctxt, ASN1TPDUSeqOfList &lst) |
EXTRTMETHOD void | append (void *data) |
EXTRTMETHOD void | appendArray (const void *data, OSSIZE numElems, OSSIZE elemSize) |
EXTRTMETHOD void | appendArrayCopy (const void *data, OSSIZE numElems, OSSIZE elemSize) |
void | init () |
EXTRTMETHOD void | insert (int index, void *data) |
EXTRTMETHOD void | remove (int index) |
EXTRTMETHOD void | remove (void *data) |
void | removeFirst () |
void | removeLast () |
EXTRTMETHOD int | indexOf (void *data) const |
OSBOOL | contains (void *data) const |
EXTRTMETHOD void * | getFirst () |
EXTRTMETHOD void * | getLast () |
EXTRTMETHOD void * | get (int index) const |
EXTRTMETHOD void * | set (int index, void *data) |
EXTRTMETHOD void | clear () |
virtual void | freeMemory () |
EXTRTMETHOD OSBOOL | isEmpty () const |
EXTRTMETHOD OSSIZE | size () const |
EXTRTMETHOD ASN1CSeqOfListIterator * | iterator () |
EXTRTMETHOD ASN1CSeqOfListIterator * | iteratorFromLast () |
EXTRTMETHOD ASN1CSeqOfListIterator * | iteratorFrom (void *data) |
EXTRTMETHOD void * | toArray (OSSIZE elemSize) |
EXTRTMETHOD void * | toArray (void *pArray, OSSIZE elemSize, OSSIZE allocatedElems) |
void * | operator[] (int index) const |
operator OSRTDList * () | |
Public Member Functions inherited from ASN1CType | |
EXTRTMETHOD | ASN1CType (OSRTMessageBufferIF &msgBuf) |
EXTRTMETHOD | ASN1CType (const ASN1CType &orig) |
virtual | ~ASN1CType () |
void | append (OSRTDList &llist, void *pdata) |
OSRTCtxtPtr | getContext () |
OSCTXT * | getCtxtPtr () |
char * | getErrorText (char *textbuf=(char *) 0, OSSIZE bufsize=0) |
int | getStatus () const |
void * | memAlloc (OSSIZE numocts) |
void * | memAllocZ (OSSIZE numocts) |
void | memFreeAll () |
void * | memRealloc (void *ptr, OSSIZE numocts) |
void | memReset () |
void | memFreePtr (void *ptr) |
void | printErrorInfo () |
void | resetError () |
OSBOOL | setDiag (OSBOOL value) |
virtual EXTRTMETHOD int | Encode () |
virtual EXTRTMETHOD int | Decode (OSBOOL free=FALSE) |
virtual int | EncodeTo (OSRTMessageBufferIF &) |
virtual int | DecodeFrom (OSRTMessageBufferIF &, OSBOOL free=TRUE) |
virtual void | MemFree () |
Protected Member Functions | |
EXTRTMETHOD | ASN1CSeqOfList (OSRTDList &lst) |
EXTRTMETHOD | ASN1CSeqOfList (ASN1TSeqOfList &lst) |
EXTRTMETHOD | ASN1CSeqOfList (ASN1TPDUSeqOfList &lst) |
EXTRTMETHOD void | remove (OSRTDListNode *node) |
EXTRTMETHOD void | insertBefore (void *data, OSRTDListNode *node) |
EXTRTMETHOD void | insertAfter (void *data, OSRTDListNode *node) |
Protected Member Functions inherited from ASN1CType | |
EXTRTMETHOD | ASN1CType () |
EXTRTMETHOD | ASN1CType (OSRTContext &ctxt) |
EXTRTMETHOD int | setMsgBuf (OSRTMessageBufferIF &msgBuf, OSBOOL initBuf=FALSE) |
EXTRTMETHOD int | setRunTimeKey (const OSOCTET *key, OSSIZE keylen) |
Protected Attributes | |
OSRTDList * | pList |
volatile int | modCount |
OSBOOL | wasAssigned |
Protected Attributes inherited from ASN1CType | |
OSRTCtxtPtr | mpContext |
OSRTMessageBufferIF * | mpMsgBuf |
Doubly-linked list implementation. This class provides all functionality necessary for linked list operations. It is the base class for ASN1C compiler-generated ASN1C_ control classes for SEQUENCE OF and SET OF PDU types.
EXTRTMETHOD ASN1CSeqOfList::ASN1CSeqOfList | ( | OSRTMessageBufferIF & | msgBuf, |
OSRTDList & | lst, | ||
OSBOOL | initBeforeUse = TRUE |
||
) |
This constructor creates a linked list using the OSRTDList argument. The constructor does not deep-copy the variable; it assigns a reference to it to an external variable.
The object will then directly operate on the given list variable.
msgBuf | Reference to an ASN1Message buffer derived object (for example, an ASN1BEREncodeBuffer). |
lst | Reference to a linked list structure. |
initBeforeUse | Set to TRUE if the passed linked list needs to be initialized (rtxDListInit to be called). |
EXTRTMETHOD ASN1CSeqOfList::ASN1CSeqOfList | ( | OSRTMessageBufferIF & | msgBuf | ) |
This constructor creates an empty linked list.
msgBuf | Reference to an ASN1Message buffer derived object (for example, an ASN1BEREncodeBuffer). |
EXTRTMETHOD ASN1CSeqOfList::ASN1CSeqOfList | ( | ASN1CType & | ccobj | ) |
This constructor creates an empty linked list.
ccobj | Reference to a control class object (for example, any generated ASN1C_ class object). |
EXTRTMETHOD ASN1CSeqOfList::ASN1CSeqOfList | ( | OSRTMessageBufferIF & | msgBuf, |
ASN1TSeqOfList & | lst | ||
) |
This constructor creates a linked list using the ASN1TSeqOfList (holder of OSRTDList) argument.
The construction does not deep-copy the variable, it assigns a reference to it to an internal variable. The object will then directly operate on the given list variable. This constructor is used with a compiler-generated linked list variable.
msgBuf | Reference to an ASN1Message buffer derived object (for example, an ASN1BEREncodeBuffer). |
lst | Reference to a linked list holder. |
EXTRTMETHOD ASN1CSeqOfList::ASN1CSeqOfList | ( | ASN1CType & | ccobj, |
ASN1TSeqOfList & | lst | ||
) |
This constructor creates a linked list using the ASN1TSeqOfList (holder of OSRTDList) argument.
The construction does not deep-copy the variable, it assigns a reference to it to an internal variable. The object will then directly operate on the given list variable. This constructor is used with a compiler-generated linked list variable.
ccobj | Reference to a control class object (for example, any generated ASN1C_ class object). |
lst | Reference to a linked list holder. |
EXTRTMETHOD ASN1CSeqOfList::ASN1CSeqOfList | ( | OSRTMessageBufferIF & | msgBuf, |
ASN1TPDUSeqOfList & | lst | ||
) |
This constructor creates a linked list using the ASN1TPDUSeqOfList argument.
The construction does not deep-copy the variable, it assigns a reference to it to an internal variable. The object will then directly operate on the given list variable. This constructor is used with a compiler-generated linked list variable.
msgBuf | Reference to an ASN1Message buffer derived object (for example, an ASN1BEREncodeBuffer). |
lst | Reference to a linked list holder. |
EXTRTMETHOD void ASN1CSeqOfList::append | ( | void * | data | ) |
This method appends an item to the linked list.
This item is represented by a void pointer that can point to an object of any type. The rtxMemAlloc function is used to allocate memory for the list node structure, therefore, all internal list memory will be released whenever rtxMemFree is called.
data | Pointer to a data item to be appended to the list. |
EXTRTMETHOD void ASN1CSeqOfList::appendArray | ( | const void * | data, |
OSSIZE | numElems, | ||
OSSIZE | elemSize | ||
) |
This method appends array items' pointers to a doubly linked list.
The rtxMemAlloc function is used to allocate memory for the list node structure, therefore all internal list memory will be released whenever the rtxMemFree is called. The data is not copied; it is just assigned to the node.
data | Pointer to source array to be appended to the list. |
numElems | The number of elements in the source array. |
elemSize | The size of one element in the array. Use the sizeof() operator to pass this parameter. |
EXTRTMETHOD void ASN1CSeqOfList::appendArrayCopy | ( | const void * | data, |
OSSIZE | numElems, | ||
OSSIZE | elemSize | ||
) |
This method appends array items into a doubly linked list.
The rtxMemAlloc function is used to allocate memory for the list node structure; therefore all internal list memory will be released whenever rtxMemFree is called. The data will be copied; the memory will be allocated using rtxMemAlloc.
data | Pointer to source array to be appended to the list. |
numElems | The number of elements in the source array. |
elemSize | The size of one element in the array. Use the sizeof() operator to pass this parameter. |
EXTRTMETHOD void ASN1CSeqOfList::clear | ( | ) |
This method removes all items from the list.
|
inline |
This method returns TRUE if this list contains the specified pointer. Note that a match is not done on the contents of each data item (i.e. what is pointed at by the pointer), only the pointer values.
data | - Pointer to data item. |
|
virtual |
This method removes all items from the list and frees the associated memory.
EXTRTMETHOD void* ASN1CSeqOfList::get | ( | int | index | ) | const |
This method returns the item at the specified position in the list.
index | Index of the item to be returned. |
EXTRTMETHOD void* ASN1CSeqOfList::getFirst | ( | ) |
This method returns the first item from the list or null if there are no elements in the list.
EXTRTMETHOD void* ASN1CSeqOfList::getLast | ( | ) |
This method returns the last item from the list or null if there are no elements in the list.
EXTRTMETHOD int ASN1CSeqOfList::indexOf | ( | void * | data | ) | const |
This method returns the index in this list of the first occurrence of the specified item, or -1 if the list does not contain the time.
data | - Pointer to data item to searched. |
|
inline |
This method initializes the linked list structure.
References ASN1CSeqOfListIterator::insert(), and rtxDListInit().
EXTRTMETHOD void ASN1CSeqOfList::insert | ( | int | index, |
void * | data | ||
) |
This method inserts an item into the linked list structure.
The item is represented by a void pointer that can point to an object of any type. The rtxMemAlloc function is used to allocate memory for the list node structure. All internal list memory will be released when the rtxMemFree function is called.
index | Index at which the specified item is to be inserted. |
data | Pointer to data item to be appended to the list. |
Referenced by ASN1CSeqOfListIterator::hasPrev().
EXTRTMETHOD OSBOOL ASN1CSeqOfList::isEmpty | ( | ) | const |
This method returns TRUE if the list is empty.
EXTRTMETHOD ASN1CSeqOfListIterator* ASN1CSeqOfList::iterator | ( | ) |
This method returns an iterator over the elements in the linked list in the sequence from the fist to the last.
EXTRTMETHOD ASN1CSeqOfListIterator* ASN1CSeqOfList::iteratorFrom | ( | void * | data | ) |
This method runs an iterator over the elements in this linked list starting from the specified item in the list.
data | The item of the list to be iterated first. |
EXTRTMETHOD ASN1CSeqOfListIterator* ASN1CSeqOfList::iteratorFromLast | ( | ) |
This method creates a reverse iterator over the elements in this linked list in the sequence from last to first.
- | none |
|
inline |
This method is the overloaded operator[].
It returns the item at the specified position in the list.
EXTRTMETHOD void ASN1CSeqOfList::remove | ( | int | index | ) |
This method removed a node at the specified index from the linked list structure.
The rtxMemAlloc function was used to allocate the memory for the list node structure, therefore, all internal list memory will be released whenever the rtxMemFree is called.
index | Index of the item to be removed. |
EXTRTMETHOD void ASN1CSeqOfList::remove | ( | void * | data | ) |
This method removes the first occurrence of the node with specified data from the linked list structure.
The rtxMemAlloc function was used to allocate the memory for the list node structure, therefore, all internal list memory will be released whenever the rtxMemFree function is called.
data | - Pointer to the data item to be appended to the list. |
|
inline |
This method removes the first node (head) from the linked list structure.
- | none |
References OSRTDList::head.
|
inline |
This method removes the last node (tail) from the linked list structure.
- | none |
References OSRTDList::tail.
EXTRTMETHOD void* ASN1CSeqOfList::set | ( | int | index, |
void * | data | ||
) |
This method replaces the item at the specified index in this list with the specified item.
index | The index of the item to be replaced. |
data | The item to be stored at the specified index. |
EXTRTMETHOD OSSIZE ASN1CSeqOfList::size | ( | ) | const |
This method returns the number of nodes in the list.
EXTRTMETHOD void* ASN1CSeqOfList::toArray | ( | OSSIZE | elemSize | ) |
This method converts the linked list into a new array.
The rtxMemAlloc function is used to allocate memory for an array.
elemSize | The size of one element in the array. Use the sizeof() operator to pass this parameter. |
EXTRTMETHOD void* ASN1CSeqOfList::toArray | ( | void * | pArray, |
OSSIZE | elemSize, | ||
OSSIZE | allocatedElems | ||
) |
This method converts the linked list into an array.
The rtxMemAlloc function is used to allocate memory for the array if the capacity of the specified array is exceeded.
pArray | Pointer to destination array. |
elemSize | The size of one element in the array. Use the sizeof() operator to pass this parameter. |
allocatedElems | The number of elements already allocated in the array. If this number is less than the number of nodes in the list, then a new array is allocated and returned. Memory is allocated using rtxMemAlloc function. |