2#ifndef TAMER_CHANNEL_HH
3#define TAMER_CHANNEL_HH 1
11 typedef typename std::deque<T>::size_type size_type;
15 inline size_type size()
const;
16 inline bool empty()
const;
18 inline size_type wait_size()
const;
19 inline bool wait_empty()
const;
21 inline void push_front(T x);
22 inline void push_back(T x);
23 inline void pop_front(tamer::event<T> e);
24 inline void pop_back(tamer::event<T> e);
28 std::deque<tamer::event<T> > waitq_;
33inline channel<T>::channel() {
37inline typename channel<T>::size_type channel<T>::size()
const {
42inline bool channel<T>::empty()
const {
47inline typename channel<T>::size_type channel<T>::wait_size()
const {
52inline bool channel<T>::wait_empty()
const {
53 return waitq_.empty();
57inline void channel<T>::push_front(T x) {
58 while (!waitq_.empty() && !waitq_.front())
60 if (!waitq_.empty()) {
61 waitq_.front()(TAMER_MOVE(x));
64 q_.push_front(TAMER_MOVE(x));
68inline void channel<T>::push_back(T x) {
69 while (!waitq_.empty() && !waitq_.front())
71 if (!waitq_.empty()) {
72 waitq_.front()(TAMER_MOVE(x));
75 q_.push_back(TAMER_MOVE(x));
79inline void channel<T>::pop_front(tamer::event<T> e) {
84 waitq_.push_back(TAMER_MOVE(e));
88inline void channel<T>::pop_back(tamer::event<T> e) {
93 waitq_.push_back(TAMER_MOVE(e));
The event template classes and helper functions.
Namespace containing public Tamer classes and functions for the Tamer core.
Definition adapter.hh:17