llarp::OwnedBuffer

Public Classes

Name
struct destroyer

Public Types

Name
using std::pmr::polymorphic_allocator< byte_t > alloc_t
using std::unique_ptr< byte_t[], destroyer > bufptr_t

Public Functions

Name
OwnedBuffer(std::pmr::memory_resource * res, size_t sz)
OwnedBuffer(const byte_t * ptr, size_t sz, std::pmr::memory_resource * res =std::pmr::get_default_resource())
OwnedBuffer(const OwnedBuffer & ) =delete
OwnedBuffer & operator=(const OwnedBuffer & ) =delete
OwnedBuffer(OwnedBuffer && ) =default
OwnedBuffer & operator=(OwnedBuffer && ) =delete
operator llarp_buffer_t()
std::vector< byte_t > copy() const
copy everything in this owned buffer into a vector
OwnedBuffer copy_from(const llarp_buffer_t & b)
OwnedBuffer copy_used(const llarp_buffer_t & b)

Public Attributes

Name
alloc_t _alloc
bufptr_t buf
size_t sz

Public Types Documentation

using alloc_t

using llarp::OwnedBuffer::alloc_t =  std::pmr::polymorphic_allocator<byte_t>;

using bufptr_t

using llarp::OwnedBuffer::bufptr_t =  std::unique_ptr<byte_t[], destroyer>;

Public Functions Documentation

function OwnedBuffer

inline explicit OwnedBuffer(
    std::pmr::memory_resource * res,
    size_t sz
)

function OwnedBuffer

inline explicit OwnedBuffer(
    const byte_t * ptr,
    size_t sz,
    std::pmr::memory_resource * res =std::pmr::get_default_resource()
)

function OwnedBuffer

OwnedBuffer(
    const OwnedBuffer & 
) =delete

function operator=

OwnedBuffer & operator=(
    const OwnedBuffer & 
) =delete

function OwnedBuffer

OwnedBuffer(
    OwnedBuffer && 
) =default

function operator=

OwnedBuffer & operator=(
    OwnedBuffer && 
) =delete

function operator llarp_buffer_t

inline operator llarp_buffer_t()

function copy

std::vector< byte_t > copy() const

copy everything in this owned buffer into a vector

function copy_from

static OwnedBuffer copy_from(
    const llarp_buffer_t & b
)

function copy_used

static OwnedBuffer copy_used(
    const llarp_buffer_t & b
)

Public Attributes Documentation

variable _alloc

alloc_t _alloc;

variable buf

bufptr_t buf;

variable sz

size_t sz;

Updated on 2026-01-10 at 22:49:45 +0000