// Initialisation method void DEReceiver_Init(struct DEReceiver* r) { Receiver_Init((struct Receiver*)r); r->typeReceiver = DERECEIVER; r->clear = DEReceiver_Clear; r->elementList = DEReceiver_ElementList; r->get = DEReceiver_Get; r->hasRoom = DEReceiver_HasRoom; r->hasRoom1 = DEReceiver_HasRoom1; r->hasToken = DEReceiver_HasToken; r->hasToken1 = DEReceiver_HasToken1; r->put = DEReceiver_Put; r->_tokens = pblListNewLinkedList(); r->_director = NULL; }
/** * Returns a pblLinkedList with a shallow copy of this collection instance. * * The elements themselves are not copied. * * This method has a memory and time complexity of O(N), * with N being the number of elements in the collection. * * @return PblList * retPtr != NULL: A pointer to the new list. * @return PblList * retPtr == NULL: An error, see pbl_errno: * * <BR>PBL_ERROR_OUT_OF_MEMORY - Out of memory. * <BR>PBL_ERROR_PARAM_COLLECTION - The collection cannot be iterated. * <BR>PBL_ERROR_CONCURRENT_MODIFICATION - The collection was modified concurrently. */ PblList * pblCollectionConvertToLinkedList( PblCollection * collection /** The collection to convert */ ) { PblList * list = pblListNewLinkedList(); if( !list ) { return NULL; } list->compare = collection->compare; if( pblListAddAll( list, collection ) < 0 ) { pblListFree( list ); return NULL; } return list; }