Skip to content

Commit

Permalink
Port code to C++11, using override
Browse files Browse the repository at this point in the history
  • Loading branch information
rtmeng committed Apr 18, 2024
1 parent 1e5094f commit 9a56376
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Pcap++/header/DpdkDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -754,12 +754,12 @@ namespace pcpp
* @return True if the device was opened successfully, false if device is already opened, if RX/TX queues configuration failed or of DPDK port
* configuration and startup failed
*/
bool open() { return openMultiQueues(1, 1); };
bool open() override { return openMultiQueues(1, 1); };

/**
* Close the DpdkDevice. When device is closed it's not possible work with it
*/
void close();
void close() override;

private:

Expand Down
2 changes: 1 addition & 1 deletion Pcap++/header/MBufRawPacket.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ namespace pcpp
/**
* @return MBufRawPacket object type
*/
virtual inline uint8_t getObjectType() const { return MBUFRAWPACKET_OBJECT_TYPE; }
inline uint8_t getObjectType() const override { return MBUFRAWPACKET_OBJECT_TYPE; }

/**
* An assignment operator for this class. Copies the data from the mbuf attached to the other MBufRawPacket to the mbuf
Expand Down
4 changes: 2 additions & 2 deletions Pcap++/header/PcapFileDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace pcpp
/**
* Close the file
*/
virtual void close();
void close() override;
};


Expand Down Expand Up @@ -433,7 +433,7 @@ namespace pcpp
* @return True if file was opened/created successfully or if file is already opened. False if opening the file failed for some reason
* (an error will be printed to log)
*/
virtual bool open();
bool open() override;

/**
* Same as open(), but enables to open the file in append mode in which packets will be appended to the file
Expand Down
8 changes: 4 additions & 4 deletions Pcap++/header/PcapLiveDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ namespace pcpp
/**
* A destructor for this class
*/
virtual ~PcapLiveDevice();
~PcapLiveDevice() override;

/**
* @return The type of the device (libPcap, WinPcap/Npcap or a remote device)
Expand Down Expand Up @@ -554,7 +554,7 @@ namespace pcpp
* @return True if the device was opened successfully, false otherwise. When opening the device fails an error will be printed to log
* as well
*/
bool open();
bool open() override;

/**
* Enables to open a device in a non-default configuration. Configuration has parameters like packet buffer timeout & size, open in
Expand All @@ -564,15 +564,15 @@ namespace pcpp
*/
bool open(const DeviceConfiguration& config);

void close();
void close() override;

/**
* Clones the current device class
* @return Pointer to the copied class
*/
PcapLiveDevice* clone();

virtual void getStatistics(IPcapDevice::PcapStats& stats) const;
void getStatistics(IPcapDevice::PcapStats& stats) const override;

protected:
pcap_t* doOpen(const DeviceConfiguration& config);
Expand Down
4 changes: 2 additions & 2 deletions Pcap++/header/RawSocketDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,12 @@ namespace pcpp
* Open the device by creating a raw socket and binding it to the network interface specified in the c'tor
* @return True if device was opened successfully, false otherwise with a corresponding error log message
*/
virtual bool open();
bool open() override;

/**
* Close the raw socket
*/
virtual void close();
void close() override;

private:

Expand Down

0 comments on commit 9a56376

Please sign in to comment.