Advertisement
Guest User

Untitled

a guest
Sep 2nd, 2015
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. //This allows black box modules to easily specify a pipeline latency by intializing their queues
  2. template <typename T>
  3. constexpr std::deque<T> func(int n)
  4. {
  5. std::deque<T> ret;
  6. for(int i=0; i < n; i++)
  7. ret.push_back(T());
  8. return ret;
  9. }
  10.  
  11. #define PIPELINE(T,x) \
  12. static std::deque<__typeof__(T)> deq_##T = func<__typeof__(T)>(x); \
  13. deq_##T.push_back(T); \
  14. T = deq_##T.front(); \
  15. deq_##T.pop_front();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement