Skip to content

Commit 6844091

Browse files
authored
Refactor: Add override specifier to MBufRawPacket virtual methods (#1968)
1 parent cf3ddb8 commit 6844091

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Pcap++/header/MBufRawPacket.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,14 +166,14 @@ namespace pcpp
166166
LinkLayerType layerType = LINKTYPE_ETHERNET, int frameLength = -1) override;
167167

168168
/// Clears the object and frees the mbuf
169-
void clear();
169+
void clear() override;
170170

171171
/// Append packet data at the end of current data. This method uses the same mbuf already allocated and tries to
172172
/// append more space and copy the data to it. If MBufRawPacket is not initialize (mbuf is nullptr) or mbuf
173173
/// append failed an error is printed to log
174174
/// @param[in] dataToAppend A pointer to the data to append
175175
/// @param[in] dataToAppendLen Length in bytes of dataToAppend
176-
void appendData(const uint8_t* dataToAppend, size_t dataToAppendLen);
176+
void appendData(const uint8_t* dataToAppend, size_t dataToAppendLen) override;
177177

178178
/// Insert raw data at some index of the current data and shift the remaining data to the end. This method uses
179179
/// the same mbuf already allocated and tries to append more space to it. Then it just copies dataToAppend at
@@ -182,7 +182,7 @@ namespace pcpp
182182
/// @param[in] atIndex The index to insert the new data to
183183
/// @param[in] dataToInsert A pointer to the new data to insert
184184
/// @param[in] dataToInsertLen Length in bytes of dataToInsert
185-
void insertData(int atIndex, const uint8_t* dataToInsert, size_t dataToInsertLen);
185+
void insertData(int atIndex, const uint8_t* dataToInsert, size_t dataToInsertLen) override;
186186

187187
/// Remove certain number of bytes from current raw data buffer. All data after the removed bytes will be
188188
/// shifted back. This method uses the mbuf already allocated and tries to trim space from it
@@ -191,14 +191,14 @@ namespace pcpp
191191
/// @return True if all bytes were removed successfully, or false if MBufRawPacket is not initialize (mbuf is
192192
/// nullptr), mbuf trim failed or logatIndex+numOfBytesToRemove is out-of-bounds of the raw data buffer. In all
193193
/// of these cases an error is printed to log
194-
bool removeData(int atIndex, size_t numOfBytesToRemove);
194+
bool removeData(int atIndex, size_t numOfBytesToRemove) override;
195195

196196
/// This overridden method,in contrast to its ancestor RawPacket#reallocateData() doesn't need to do anything
197197
/// because mbuf is already allocated to its maximum extent. So it only performs a check to verify the size
198198
/// after re-allocation doesn't exceed mbuf max size
199199
/// @param[in] newBufferLength The new buffer length as required by the user
200200
/// @return True if new size is larger than current size but smaller than mbuf max size, false otherwise
201-
bool reallocateData(size_t newBufferLength);
201+
bool reallocateData(size_t newBufferLength) override;
202202

203203
/// Set an indication whether to free the mbuf when done using it or not ("done using it" means setting another
204204
/// mbuf or class d'tor). Default value is true.

0 commit comments

Comments
 (0)