Loading system/gd/common/bidi_queue.h +20 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,10 @@ namespace bluetooth { namespace common { // // Interface for one context to send and receive data over // a pair of queues (|BidiQueue|). // template <typename TENQUEUE, typename TDEQUEUE> class BidiQueueEnd : public ::bluetooth::os::IQueueEnqueue<TENQUEUE>, public ::bluetooth::os::IQueueDequeue<TDEQUEUE> { Loading Loading @@ -54,6 +58,22 @@ private: ::bluetooth::os::IQueueDequeue<TDEQUEUE>* rx_; }; // // Interface managing a pair of queues shared between two contexts // (typically layers of the stack). // // The up queue can be used for data to indicate up to bluetooth host and // the down queue can be used for data to sent to bluetooth controller. // Each context uses its |BidiQueueEnd| to manage their data operations: // // The up end: // - Receives data indicated from the down end. // - Sends data to the down end. // // The down end: // - Receives data sent from the up end. // - Indicates data to the up end. // template <typename TUP, typename TDOWN> class BidiQueue { public: Loading system/gd/os/queue.h +14 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,20 @@ public: virtual std::unique_ptr<T> TryDequeue() = 0; }; // // An interface facilitating flow-controlled and non-blocking queue operations. // // This Queue uses separate semaphores and callbacks for enqueue end (producer) // and dequeue end (consumer) to manage data flow efficiently: // // Enqueue end (producer): // - Registers an EnqueueCallback when producer has data to send. // - Unregisters the EnqueueCallback when no data is available. // // Dequeue end (consumer): // - Registers a DequeueCallback when consumer is ready to process data. // - Unregisters the DequeueCallback when no longer ready. // template <typename T> class Queue : public IQueueEnqueue<T>, public IQueueDequeue<T> { public: Loading Loading
system/gd/common/bidi_queue.h +20 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,10 @@ namespace bluetooth { namespace common { // // Interface for one context to send and receive data over // a pair of queues (|BidiQueue|). // template <typename TENQUEUE, typename TDEQUEUE> class BidiQueueEnd : public ::bluetooth::os::IQueueEnqueue<TENQUEUE>, public ::bluetooth::os::IQueueDequeue<TDEQUEUE> { Loading Loading @@ -54,6 +58,22 @@ private: ::bluetooth::os::IQueueDequeue<TDEQUEUE>* rx_; }; // // Interface managing a pair of queues shared between two contexts // (typically layers of the stack). // // The up queue can be used for data to indicate up to bluetooth host and // the down queue can be used for data to sent to bluetooth controller. // Each context uses its |BidiQueueEnd| to manage their data operations: // // The up end: // - Receives data indicated from the down end. // - Sends data to the down end. // // The down end: // - Receives data sent from the up end. // - Indicates data to the up end. // template <typename TUP, typename TDOWN> class BidiQueue { public: Loading
system/gd/os/queue.h +14 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,20 @@ public: virtual std::unique_ptr<T> TryDequeue() = 0; }; // // An interface facilitating flow-controlled and non-blocking queue operations. // // This Queue uses separate semaphores and callbacks for enqueue end (producer) // and dequeue end (consumer) to manage data flow efficiently: // // Enqueue end (producer): // - Registers an EnqueueCallback when producer has data to send. // - Unregisters the EnqueueCallback when no data is available. // // Dequeue end (consumer): // - Registers a DequeueCallback when consumer is ready to process data. // - Unregisters the DequeueCallback when no longer ready. // template <typename T> class Queue : public IQueueEnqueue<T>, public IQueueDequeue<T> { public: Loading