Phonon::PacketPool
#include <phonon/PacketPool>
Public Member Functions | |
PacketPool (const PacketPool &) | |
PacketPool (int packetSize, int numberOfPackets) | |
~PacketPool () | |
PacketPool & | operator= (const PacketPool &) |
int | packetSize () const |
int | poolSize () const |
int | unusedPackets () const |
Detailed Description
Class to preallocate memory.
- Note
- PacketPool and Packet are threadsafe.
Definition at line 37 of file packetpool.h.
Constructor & Destructor Documentation
◆ PacketPool() [1/2]
Phonon::PacketPool::PacketPool | ( | int | packetSize, |
int | numberOfPackets ) |
Allocates numberOfPackets
packets of packetSize
bytes each.
The memory can be accessed through Packet objects.
Definition at line 84 of file packetpool.cpp.
◆ PacketPool() [2/2]
Phonon::PacketPool::PacketPool | ( | const PacketPool & | rhs | ) |
Copy constructor.
Copying is fast since the class is explicitly shared.
Definition at line 90 of file packetpool.cpp.
◆ ~PacketPool()
Phonon::PacketPool::~PacketPool | ( | ) |
Destructs this object.
If this is the last reference to the pool the memory will be freed.
Definition at line 108 of file packetpool.cpp.
Member Function Documentation
◆ operator=()
PacketPool & Phonon::PacketPool::operator= | ( | const PacketPool & | rhs | ) |
Assignmen operator.
Copying is fast since the class is explicitly shared.
Definition at line 96 of file packetpool.cpp.
◆ packetSize()
int Phonon::PacketPool::packetSize | ( | ) | const |
Returns the packet size that was set in the constructor.
Definition at line 28 of file packetpool.cpp.
◆ poolSize()
int Phonon::PacketPool::poolSize | ( | ) | const |
Returns the number of packets that was requested in the constructor.
Definition at line 29 of file packetpool.cpp.
◆ unusedPackets()
int Phonon::PacketPool::unusedPackets | ( | ) | const |
Returns the number of packets that are still available for use.
Definition at line 30 of file packetpool.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:18:23 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.