esp8266ndn
NDN Arduino library for ESP8266 and more
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
null.hpp
Go to the documentation of this file.
1 #ifndef NDNPH_PORT_QUEUE_NULL_HPP
2 #define NDNPH_PORT_QUEUE_NULL_HPP
3 
4 #include "../../core/common.hpp"
5 
6 namespace ndnph {
7 namespace port_queue_null {
8 
10 template<typename T, size_t capacity>
11 class SafeQueue {
12 public:
13  using Item = T;
14 
15  bool push(Item) {
16  return false;
17  }
18 
19  std::tuple<Item, bool> pop() {
20  return std::make_tuple(T(), false);
21  }
22 };
23 
24 } // namespace port_queue_null
25 
26 #ifdef NDNPH_PORT_QUEUE_NULL
27 namespace port {
28 template<typename T, size_t capacity>
29 using SafeQueue = port_queue_null::SafeQueue<T, capacity>;
30 } // namespace port
31 #endif
32 
33 } // namespace ndnph
34 
35 #endif // NDNPH_PORT_QUEUE_NULL_HPP
Generic thread-safe queue stub.
Definition: null.hpp:11
bool push(Item)
Definition: null.hpp:15
std::tuple< Item, bool > pop()
Definition: null.hpp:19
T Item
Definition: null.hpp:13
esp8266ndn::ndnph_port_freertos::SafeQueue< T, capacity > SafeQueue
Definition: queue-freertos.hpp:59
Definition: fs.hpp:33