SNode.C
Loading...
Searching...
No Matches
ControlPacketFactory.h
Go to the documentation of this file.
1/*
2 * SNode.C - a slim toolkit for network communication
3 * Copyright (C) Volker Christian <me@vchrist.at>
4 * 2020, 2021, 2022, 2023, 2024, 2025
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as published
8 * by the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef IOT_MQTTFAST_CONTROLPACKETFACTORY_H
21#define IOT_MQTTFAST_CONTROLPACKETFACTORY_H
22
23#include "iot/mqtt-fast/types/Binary.h"
24#include "iot/mqtt-fast/types/Int_1.h"
25#include "iot/mqtt-fast/types/Int_V.h"
26
27namespace core::socket {
28 class SocketContext;
29}
30
31#ifndef DOXYGEN_SHOULD_SKIP_THIS
32
33#include <cstddef>
34#include <cstdint>
35
36#endif // DOXYGEN_SHOULD_SKIP_THIS
37
38namespace iot::mqtt_fast {
39
41 public:
42 explicit ControlPacketFactory(core::socket::SocketContext* socketContext);
43
44 std::size_t construct();
45 bool isComplete() const;
46 bool isError() const;
48 uint8_t getPacketType();
49 uint8_t getPacketFlags();
50 uint64_t getRemainingLength();
51
52 void reset();
53
54 private:
55 bool completed = false;
56 bool error = false;
57 int state = 0;
58
62 };
63
64} // namespace iot::mqtt_fast
65
66#endif // IOT_MQTTFAST_CONTROLPACKETFACTORY_H
iot::mqtt_fast::types::Binary data
ControlPacketFactory(core::socket::SocketContext *socketContext)
iot::mqtt_fast::types::Int_V remainingLength
iot::mqtt_fast::types::Binary & getPacket()
iot::mqtt_fast::types::Int_1 typeFlags
std::size_t construct() override
Definition Int_1.cpp:32
void reset() override
Definition Int_1.cpp:45
Int_1(core::socket::SocketContext *socketContext=nullptr)
Definition Int_1.cpp:28
uint32_t getValue() const
Definition Int_V.cpp:55
void reset() override
Definition Int_V.cpp:59
std::size_t construct() override
Definition Int_V.cpp:32
Int_V(core::socket::SocketContext *socketContext=nullptr)
Definition Int_V.cpp:28