Minetest 5.10.0-dev
 
Loading...
Searching...
No Matches
Buffer< T > Class Template Reference

#include <pointer.h>

Public Member Functions

 Buffer ()
 
 Buffer (unsigned int size)
 
 Buffer (const Buffer &)=delete
 
Bufferoperator= (const Buffer &)=delete
 
 Buffer (Buffer &&buffer)
 
 Buffer (const T *t, unsigned int size)
 
 ~Buffer ()
 
Bufferoperator= (Buffer &&buffer)
 
void copyTo (Buffer &buffer) const
 
T & operator[] (unsigned int i) const
 
T * operator* () const
 
unsigned int getSize () const
 
 operator std::string_view () const
 

Private Member Functions

void drop ()
 

Private Attributes

T * data
 
unsigned int m_size
 

Constructor & Destructor Documentation

◆ Buffer() [1/5]

template<typename T >
Buffer< T >::Buffer ( )
inline

◆ Buffer() [2/5]

template<typename T >
Buffer< T >::Buffer ( unsigned int size)
inline

◆ Buffer() [3/5]

template<typename T >
Buffer< T >::Buffer ( const Buffer< T > & )
delete

◆ Buffer() [4/5]

template<typename T >
Buffer< T >::Buffer ( Buffer< T > && buffer)
inline

◆ Buffer() [5/5]

template<typename T >
Buffer< T >::Buffer ( const T * t,
unsigned int size )
inline

◆ ~Buffer()

template<typename T >
Buffer< T >::~Buffer ( )
inline

References Buffer< T >::drop().

+ Here is the call graph for this function:

Member Function Documentation

◆ copyTo()

template<typename T >
void Buffer< T >::copyTo ( Buffer< T > & buffer) const
inline

References Buffer< T >::data, Buffer< T >::drop(), and Buffer< T >::m_size.

Referenced by con::ConnectionCommand::ack(), con::ConnectionCommand::createPeer(), and con::ConnectionEvent::dataReceived().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ drop()

template<typename T >
void Buffer< T >::drop ( )
inlineprivate

References Buffer< T >::data.

Referenced by Buffer< T >::~Buffer(), Buffer< T >::copyTo(), and Buffer< T >::operator=().

+ Here is the caller graph for this function:

◆ getSize()

template<typename T >
unsigned int Buffer< T >::getSize ( ) const
inline

References Buffer< T >::m_size.

Referenced by SharedBuffer< T >::SharedBuffer(), con::Connection::ReceiveTimeoutMs(), MapBlock::serialize(), TestConnection::testConnectSendReceive(), TestCompression::testRLECompression(), and TestCompression::testZlibCompression().

+ Here is the caller graph for this function:

◆ operator std::string_view()

template<typename T >
Buffer< T >::operator std::string_view ( ) const
inline

◆ operator*()

template<typename T >
T * Buffer< T >::operator* ( ) const
inline

References Buffer< T >::data.

◆ operator=() [1/2]

template<typename T >
Buffer & Buffer< T >::operator= ( Buffer< T > && buffer)
inline

References Buffer< T >::data, Buffer< T >::drop(), and Buffer< T >::m_size.

+ Here is the call graph for this function:

◆ operator=() [2/2]

template<typename T >
Buffer & Buffer< T >::operator= ( const Buffer< T > & )
delete

◆ operator[]()

template<typename T >
T & Buffer< T >::operator[] ( unsigned int i) const
inline

References Buffer< T >::data.

Member Data Documentation

◆ data

◆ m_size


The documentation for this class was generated from the following file: