ASN1C C/C++ Common Runtime  ASN1C v7.7.x
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ASN1CSeqOfList Class Reference

#include <ASN1CSeqOfList.h>

Inheritance diagram for ASN1CSeqOfList:
ASN1CType

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 ASN1CSeqOfListIteratoriterator ()
 
EXTRTMETHOD ASN1CSeqOfListIteratoriteratorFromLast ()
 
EXTRTMETHOD ASN1CSeqOfListIteratoriteratorFrom (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 ()
 
OSCTXTgetCtxtPtr ()
 
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

OSRTDListpList
 
volatile int modCount
 
OSBOOL wasAssigned
 
- Protected Attributes inherited from ASN1CType
OSRTCtxtPtr mpContext
 
OSRTMessageBufferIF * mpMsgBuf
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ASN1CSeqOfList() [1/6]

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.

Parameters
msgBufReference to an ASN1Message buffer derived object (for example, an ASN1BEREncodeBuffer).
lstReference to a linked list structure.
initBeforeUseSet to TRUE if the passed linked list needs to be initialized (rtxDListInit to be called).

◆ ASN1CSeqOfList() [2/6]

EXTRTMETHOD ASN1CSeqOfList::ASN1CSeqOfList ( OSRTMessageBufferIF &  msgBuf)

This constructor creates an empty linked list.

Parameters
msgBufReference to an ASN1Message buffer derived object (for example, an ASN1BEREncodeBuffer).

◆ ASN1CSeqOfList() [3/6]

EXTRTMETHOD ASN1CSeqOfList::ASN1CSeqOfList ( ASN1CType ccobj)

This constructor creates an empty linked list.

Parameters
ccobjReference to a control class object (for example, any generated ASN1C_ class object).

◆ ASN1CSeqOfList() [4/6]

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.

Parameters
msgBufReference to an ASN1Message buffer derived object (for example, an ASN1BEREncodeBuffer).
lstReference to a linked list holder.

◆ ASN1CSeqOfList() [5/6]

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.

Parameters
ccobjReference to a control class object (for example, any generated ASN1C_ class object).
lstReference to a linked list holder.

◆ ASN1CSeqOfList() [6/6]

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.

Parameters
msgBufReference to an ASN1Message buffer derived object (for example, an ASN1BEREncodeBuffer).
lstReference to a linked list holder.

Member Function Documentation

◆ append()

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.

Parameters
dataPointer to a data item to be appended to the list.
Returns
- none

◆ appendArray()

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.

Parameters
dataPointer to source array to be appended to the list.
numElemsThe number of elements in the source array.
elemSizeThe size of one element in the array. Use the sizeof() operator to pass this parameter.
Returns
- none

◆ appendArrayCopy()

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.

Parameters
dataPointer to source array to be appended to the list.
numElemsThe number of elements in the source array.
elemSizeThe size of one element in the array. Use the sizeof() operator to pass this parameter.
Returns
- none

◆ clear()

EXTRTMETHOD void ASN1CSeqOfList::clear ( )

This method removes all items from the list.

◆ contains()

OSBOOL ASN1CSeqOfList::contains ( void *  data) const
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.

Parameters
data- Pointer to data item.
Returns
TRUE if this pointer value found in the list.

◆ freeMemory()

virtual void ASN1CSeqOfList::freeMemory ( )
virtual

This method removes all items from the list and frees the associated memory.

◆ get()

EXTRTMETHOD void* ASN1CSeqOfList::get ( int  index) const

This method returns the item at the specified position in the list.

Parameters
indexIndex of the item to be returned.
Returns
The item at the specified index in the list.

◆ getFirst()

EXTRTMETHOD void* ASN1CSeqOfList::getFirst ( )

This method returns the first item from the list or null if there are no elements in the list.

Returns
The first item of the list.

◆ getLast()

EXTRTMETHOD void* ASN1CSeqOfList::getLast ( )

This method returns the last item from the list or null if there are no elements in the list.

Returns
The last item in the list.

◆ indexOf()

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.

Parameters
data- Pointer to data item to searched.
Returns
The index in this list of the first occurrence of the specified item, or -1 if the list does not contain the item.

◆ init()

void ASN1CSeqOfList::init ( )
inline

This method initializes the linked list structure.

References ASN1CSeqOfListIterator::insert(), and rtxDListInit().

◆ insert()

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.

Parameters
indexIndex at which the specified item is to be inserted.
dataPointer to data item to be appended to the list.
Returns
- none

Referenced by ASN1CSeqOfListIterator::hasPrev().

◆ isEmpty()

EXTRTMETHOD OSBOOL ASN1CSeqOfList::isEmpty ( ) const

This method returns TRUE if the list is empty.

Returns
TRUE if this list is empty.

◆ iterator()

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.

Returns
The iterator over this linked list.

◆ iteratorFrom()

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.

Parameters
dataThe item of the list to be iterated first.
Returns
The iterator over this linked list.

◆ iteratorFromLast()

EXTRTMETHOD ASN1CSeqOfListIterator* ASN1CSeqOfList::iteratorFromLast ( )

This method creates a reverse iterator over the elements in this linked list in the sequence from last to first.

Parameters
-none
Returns
The reverse iterator over this linked list.

◆ operator[]()

void* ASN1CSeqOfList::operator[] ( int  index) const
inline

This method is the overloaded operator[].

It returns the item at the specified position in the list.

See also
get (int index)

◆ remove() [1/2]

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.

Parameters
indexIndex of the item to be removed.
Returns
- none

◆ remove() [2/2]

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.

Parameters
data- Pointer to the data item to be appended to the list.

◆ removeFirst()

void ASN1CSeqOfList::removeFirst ( )
inline

This method removes the first node (head) from the linked list structure.

Parameters
-none
Returns
- none

References OSRTDList::head.

◆ removeLast()

void ASN1CSeqOfList::removeLast ( )
inline

This method removes the last node (tail) from the linked list structure.

Parameters
-none
Returns
- none

References OSRTDList::tail.

◆ set()

EXTRTMETHOD void* ASN1CSeqOfList::set ( int  index,
void *  data 
)

This method replaces the item at the specified index in this list with the specified item.

Parameters
indexThe index of the item to be replaced.
dataThe item to be stored at the specified index.
Returns
The item previously at the specified position.

◆ size()

EXTRTMETHOD OSSIZE ASN1CSeqOfList::size ( ) const

This method returns the number of nodes in the list.

Returns
The number of items in this list.

◆ toArray() [1/2]

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.

Parameters
elemSizeThe size of one element in the array. Use the sizeof() operator to pass this parameter.
Returns
The point to converted array.

◆ toArray() [2/2]

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.

Parameters
pArrayPointer to destination array.
elemSizeThe size of one element in the array. Use the sizeof() operator to pass this parameter.
allocatedElemsThe 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.
Returns
The pointer to the converted array.

The documentation for this class was generated from the following file: