tetengo 1.8.2
A multipurpose library set
Loading...
Searching...
No Matches
channel.hpp
Go to the documentation of this file.
1
7#if !defined(TETENGO_JSON_CHANNEL_HPP)
8#define TETENGO_JSON_CHANNEL_HPP
9
10#include <cstddef>
11#include <exception>
12#include <memory>
13
14#include <boost/core/noncopyable.hpp>
15
16
17namespace tetengo::json
18{
19 class element;
20
21
25 class channel : private boost::noncopyable
26 {
27 public:
28 // constructors and destructor
29
37 explicit channel(std::size_t capacity);
38
43
44
45 // functions
46
54 void insert(element element_);
55
63 void insert(std::exception_ptr&& p_exception);
64
73 [[nodiscard]] const element& peek() const;
74
80 void take();
81
88 [[nodiscard]] bool closed() const;
89
93 void close();
94
95
96 private:
97 // types
98
99 class impl;
100
101
102 // variables
103
104 const std::unique_ptr<impl> m_p_impl;
105 };
106
107
108}
109
110
111#endif
A channel.
Definition channel.hpp:26
channel(std::size_t capacity)
Creates a channel.
bool closed() const
Returns true the channel is closed.
void take()
Takes an element.
~channel()
Destroys the JSON parser.
void insert(element element_)
Inserts an element.
const element & peek() const
Returns the front element.
void insert(std::exception_ptr &&p_exception)
Inserts an exception.
void close()
Closes the channel.
An element.
Definition element.hpp:22
A JSON library.