Lines Matching refs:aMessage
106 void MessagePool::Free(Message *aMessage) in Free() argument
108 OT_ASSERT(aMessage->Next() == nullptr && aMessage->Prev() == nullptr); in Free()
110 FreeBuffers(static_cast<Buffer *>(aMessage)); in Free()
415 Error Message::AppendBytesFromMessage(const Message &aMessage, uint16_t aOffset, uint16_t aLength) in AppendBytesFromMessage() argument
421 VerifyOrExit(aMessage.GetLength() >= aOffset + aLength, error = kErrorParse); in AppendBytesFromMessage()
424 aMessage.GetFirstChunk(aOffset, aLength, chunk); in AppendBytesFromMessage()
430 aMessage.GetNextChunk(aLength, chunk); in AppendBytesFromMessage()
718 const Message &aMessage, in WriteBytesFromMessage() argument
722 if ((&aMessage != this) || (aReadOffset >= aWriteOffset)) in WriteBytesFromMessage()
726 aMessage.GetFirstChunk(aReadOffset, aLength, chunk); in WriteBytesFromMessage()
732 aMessage.GetNextChunk(aLength, chunk); in WriteBytesFromMessage()
878 void MessageQueue::Enqueue(Message &aMessage, QueuePosition aPosition) in Enqueue() argument
880 OT_ASSERT(!aMessage.IsInAQueue()); in Enqueue()
881 OT_ASSERT((aMessage.Next() == nullptr) && (aMessage.Prev() == nullptr)); in Enqueue()
883 aMessage.SetMessageQueue(this); in Enqueue()
887 aMessage.Next() = &aMessage; in Enqueue()
888 aMessage.Prev() = &aMessage; in Enqueue()
890 SetTail(&aMessage); in Enqueue()
896 aMessage.Next() = head; in Enqueue()
897 aMessage.Prev() = GetTail(); in Enqueue()
899 head->Prev() = &aMessage; in Enqueue()
900 GetTail()->Next() = &aMessage; in Enqueue()
904 SetTail(&aMessage); in Enqueue()
909 void MessageQueue::Dequeue(Message &aMessage) in Dequeue() argument
911 OT_ASSERT(aMessage.GetMessageQueue() == this); in Dequeue()
912 OT_ASSERT((aMessage.Next() != nullptr) && (aMessage.Prev() != nullptr)); in Dequeue()
914 if (&aMessage == GetTail()) in Dequeue()
918 if (&aMessage == GetTail()) in Dequeue()
924 aMessage.Prev()->Next() = aMessage.Next(); in Dequeue()
925 aMessage.Next()->Prev() = aMessage.Prev(); in Dequeue()
927 aMessage.Prev() = nullptr; in Dequeue()
928 aMessage.Next() = nullptr; in Dequeue()
930 aMessage.SetMessageQueue(nullptr); in Dequeue()
933 void MessageQueue::DequeueAndFree(Message &aMessage) in DequeueAndFree() argument
935 Dequeue(aMessage); in DequeueAndFree()
936 aMessage.Free(); in DequeueAndFree()
1019 void PriorityQueue::Enqueue(Message &aMessage) in Enqueue() argument
1025 OT_ASSERT(!aMessage.IsInAQueue()); in Enqueue()
1027 aMessage.SetPriorityQueue(this); in Enqueue()
1029 priority = aMessage.GetPriority(); in Enqueue()
1037 aMessage.Next() = next; in Enqueue()
1038 aMessage.Prev() = tail; in Enqueue()
1039 next->Prev() = &aMessage; in Enqueue()
1040 tail->Next() = &aMessage; in Enqueue()
1044 aMessage.Next() = &aMessage; in Enqueue()
1045 aMessage.Prev() = &aMessage; in Enqueue()
1048 mTails[priority] = &aMessage; in Enqueue()
1051 void PriorityQueue::Dequeue(Message &aMessage) in Dequeue() argument
1056 OT_ASSERT(aMessage.GetPriorityQueue() == this); in Dequeue()
1058 priority = aMessage.GetPriority(); in Dequeue()
1062 if (&aMessage == tail) in Dequeue()
1066 if ((&aMessage == tail) || (tail->GetPriority() != priority)) in Dequeue()
1074 aMessage.Next()->Prev() = aMessage.Prev(); in Dequeue()
1075 aMessage.Prev()->Next() = aMessage.Next(); in Dequeue()
1076 aMessage.Next() = nullptr; in Dequeue()
1077 aMessage.Prev() = nullptr; in Dequeue()
1079 aMessage.SetPriorityQueue(nullptr); in Dequeue()
1082 void PriorityQueue::DequeueAndFree(Message &aMessage) in DequeueAndFree() argument
1084 Dequeue(aMessage); in DequeueAndFree()
1085 aMessage.Free(); in DequeueAndFree()