A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
bit-deserializer.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2020 Universita' di Firenze, Italy
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*
17
* Author: Tommaso Pecorella <tommaso.pecorella@unifi.it>
18
*/
19
20
#ifndef BITDESERIALIZER_H_
21
#define BITDESERIALIZER_H_
22
23
#include <cstdint>
24
#include <deque>
25
#include <vector>
26
27
namespace
ns3
28
{
29
43
class
BitDeserializer
44
{
45
public
:
46
BitDeserializer
();
47
52
void
PushBytes
(std::vector<uint8_t> bytes);
53
59
void
PushBytes
(uint8_t* bytes, uint32_t size);
60
65
void
PushByte
(uint8_t
byte
);
66
77
uint64_t
GetBits
(uint8_t size);
78
79
private
:
83
void
PrepareDeserialization
();
84
85
std::deque<bool>
m_blob
;
86
std::vector<uint8_t>
m_bytesBlob
;
87
bool
m_deserializing
;
88
};
89
90
}
// namespace ns3
91
92
#endif
/* BITDESERIALIZER_H_ */
ns3::BitDeserializer
Bit deserializer.
Definition:
bit-deserializer.h:44
ns3::BitDeserializer::PushBytes
void PushBytes(std::vector< uint8_t > bytes)
Pushes some bytes into the blob to be deserialized.
Definition:
bit-deserializer.cc:39
ns3::BitDeserializer::m_bytesBlob
std::vector< uint8_t > m_bytesBlob
Blob of bytes to be deserialized.
Definition:
bit-deserializer.h:86
ns3::BitDeserializer::PrepareDeserialization
void PrepareDeserialization()
Prepare the byte array to the deserialization.
Definition:
bit-deserializer.cc:85
ns3::BitDeserializer::PushByte
void PushByte(uint8_t byte)
Pushes one byte into the blob to be deserialized.
Definition:
bit-deserializer.cc:58
ns3::BitDeserializer::m_deserializing
bool m_deserializing
True if the deserialization did start already.
Definition:
bit-deserializer.h:87
ns3::BitDeserializer::m_blob
std::deque< bool > m_blob
Blob of bits ready to be deserialized.
Definition:
bit-deserializer.h:85
ns3::BitDeserializer::BitDeserializer
BitDeserializer()
Definition:
bit-deserializer.cc:32
ns3::BitDeserializer::GetBits
uint64_t GetBits(uint8_t size)
Pops a given number of bits from the blob front.
Definition:
bit-deserializer.cc:66
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
network
utils
bit-deserializer.h
Generated on Sun Mar 3 2024 17:11:06 for ns-3 by
1.9.1