DABC (Data Acquisition Backbone Core)  2.9.9
Public Member Functions | Protected Member Functions | Protected Attributes | Friends
dabc::Pointer Class Reference

Manipulator with dabc::Buffer class. More...

#include <dabc/Pointer.h>

Public Member Functions

Buffer buf ()
 
float consumed_size () const
 Returns ratio between filled size and buffer size, 0 when exmpy. More...
 
BufferSize_t copyfrom (const Pointer &src, BufferSize_t sz=0) throw ()
 Returns actual size copied. More...
 
BufferSize_t copyfrom (const void *src, BufferSize_t sz)
 
BufferSize_t copyfrom_shift (const Pointer &src, BufferSize_t sz=0) throw ()
 Returns actual size copied and shifted. More...
 
BufferSize_t copyfrom_shift (const void *src, BufferSize_t sz) throw ()
 
BufferSize_t copyfromstr (const char *str, unsigned len=0) throw ()
 
BufferSize_t copyto (Pointer &src, BufferSize_t sz) const throw ()
 
BufferSize_t copyto (void *tgt, BufferSize_t sz) const throw ()
 
BufferSize_t copyto_shift (Pointer &src, BufferSize_t sz) throw ()
 
BufferSize_t copyto_shift (void *tgt, BufferSize_t sz) throw ()
 
int distance_to (const Pointer &child) const
 
int distance_to_ownbuf () const
 
BufferSize_t fullsize () const
 
bool is_same_buf (const Pointer &ptr) const
 
bool null () const
 
void * operator() () const
 
void operator+= (BufferSize_t sz) throw ()
 
Pointeroperator= (const Buffer &src)
 
Pointeroperator= (const Pointer &src)
 
 Pointer ()
 
 Pointer (const Buffer &buf, unsigned pos=0, unsigned len=0)
 
 Pointer (const Pointer &src, BufferSize_t pos=0, BufferSize_t fullsz=0)
 
 Pointer (const void *buf, BufferSize_t sz)
 
void * ptr () const
 
BufferSize_t rawsize () const
 
void reset ()
 
void reset (const Buffer &src, BufferSize_t pos=0, BufferSize_t fullsz=0)
 
void reset (const Pointer &src, BufferSize_t pos=0, BufferSize_t fullsz=0)
 
void reset (void *buf, BufferSize_t sz)
 
unsigned segmid () const
 
void setfullsize (BufferSize_t sz)
 
BufferSize_t shift (BufferSize_t sz) throw ()
 

Protected Member Functions

void long_shift (BufferSize_t sz)
 

Protected Attributes

Buffer fBuf
 we keep reference on the buffer, could be only used in same thread More...
 
BufferSize_t fFullSize
 full size of memory from pointer till the end More...
 
unsigned char * fPtr
 pointer on the raw buffer More...
 
BufferSize_t fRawSize
 size of contiguous memory, pointed by fPtr More...
 
unsigned fSegm
 segment id More...
 

Friends

class Buffer
 

Detailed Description

Manipulator with dabc::Buffer class.

dabc::Buffer can contain segmented lists of memory regions. dabc::Pointer class provides method which let work with such segmented memory as with contiguous region.

Definition at line 34 of file Pointer.h.

Constructor & Destructor Documentation

◆ Pointer() [1/4]

dabc::Pointer::Pointer ( )
inline

Definition at line 48 of file Pointer.h.

◆ Pointer() [2/4]

dabc::Pointer::Pointer ( const void *  buf,
BufferSize_t  sz 
)
inline

Definition at line 57 of file Pointer.h.

◆ Pointer() [3/4]

dabc::Pointer::Pointer ( const Pointer src,
BufferSize_t  pos = 0,
BufferSize_t  fullsz = 0 
)
inline

Definition at line 66 of file Pointer.h.

◆ Pointer() [4/4]

dabc::Pointer::Pointer ( const Buffer buf,
unsigned  pos = 0,
unsigned  len = 0 
)
inline

Definition at line 77 of file Pointer.h.

Member Function Documentation

◆ long_shift()

void dabc::Pointer::long_shift ( BufferSize_t  sz)
protected

Definition at line 25 of file Pointer.cxx.

◆ operator=() [1/2]

Pointer& dabc::Pointer::operator= ( const Pointer src)
inline

Definition at line 87 of file Pointer.h.

◆ operator=() [2/2]

Pointer& dabc::Pointer::operator= ( const Buffer src)
inline

Definition at line 93 of file Pointer.h.

◆ reset() [1/4]

void dabc::Pointer::reset ( void *  buf,
BufferSize_t  sz 
)
inline

Definition at line 99 of file Pointer.h.

◆ reset() [2/4]

void dabc::Pointer::reset ( const Pointer src,
BufferSize_t  pos = 0,
BufferSize_t  fullsz = 0 
)
inline

Definition at line 108 of file Pointer.h.

◆ reset() [3/4]

void dabc::Pointer::reset ( const Buffer src,
BufferSize_t  pos = 0,
BufferSize_t  fullsz = 0 
)
inline

Definition at line 119 of file Pointer.h.

◆ reset() [4/4]

void dabc::Pointer::reset ( )
inline

Definition at line 136 of file Pointer.h.

◆ operator()()

void* dabc::Pointer::operator() ( ) const
inline

Definition at line 145 of file Pointer.h.

◆ ptr()

void* dabc::Pointer::ptr ( ) const
inline

Definition at line 146 of file Pointer.h.

◆ null()

bool dabc::Pointer::null ( ) const
inline

Definition at line 147 of file Pointer.h.

◆ rawsize()

BufferSize_t dabc::Pointer::rawsize ( ) const
inline

Definition at line 148 of file Pointer.h.

◆ fullsize()

BufferSize_t dabc::Pointer::fullsize ( ) const
inline

Definition at line 149 of file Pointer.h.

◆ buf()

Buffer dabc::Pointer::buf ( )
inline

Definition at line 151 of file Pointer.h.

◆ shift()

BufferSize_t dabc::Pointer::shift ( BufferSize_t  sz)
throw (
)
inline

Definition at line 153 of file Pointer.h.

◆ setfullsize()

void dabc::Pointer::setfullsize ( BufferSize_t  sz)
inline

Definition at line 168 of file Pointer.h.

◆ operator+=()

void dabc::Pointer::operator+= ( BufferSize_t  sz)
throw (
)
inline

Definition at line 176 of file Pointer.h.

◆ copyto() [1/2]

dabc::BufferSize_t dabc::Pointer::copyto ( void *  tgt,
BufferSize_t  sz 
) const
throw (
)

Definition at line 98 of file Pointer.cxx.

◆ copyto_shift() [1/2]

BufferSize_t dabc::Pointer::copyto_shift ( void *  tgt,
BufferSize_t  sz 
)
throw (
)
inline

Definition at line 180 of file Pointer.h.

◆ copyto() [2/2]

dabc::BufferSize_t dabc::Pointer::copyto ( Pointer src,
BufferSize_t  sz 
) const
throw (
)

Definition at line 93 of file Pointer.cxx.

◆ copyto_shift() [2/2]

BufferSize_t dabc::Pointer::copyto_shift ( Pointer src,
BufferSize_t  sz 
)
throw (
)
inline

Definition at line 185 of file Pointer.h.

◆ copyfrom() [1/2]

dabc::BufferSize_t dabc::Pointer::copyfrom ( const Pointer src,
BufferSize_t  sz = 0 
)
throw (
)

Returns actual size copied.

Definition at line 54 of file Pointer.cxx.

◆ copyfrom_shift() [1/2]

BufferSize_t dabc::Pointer::copyfrom_shift ( const Pointer src,
BufferSize_t  sz = 0 
)
throw (
)
inline

Returns actual size copied and shifted.

Definition at line 192 of file Pointer.h.

◆ copyfrom() [2/2]

dabc::BufferSize_t dabc::Pointer::copyfrom ( const void *  src,
BufferSize_t  sz 
)

Definition at line 110 of file Pointer.cxx.

◆ copyfrom_shift() [2/2]

BufferSize_t dabc::Pointer::copyfrom_shift ( const void *  src,
BufferSize_t  sz 
)
throw (
)
inline

Definition at line 197 of file Pointer.h.

◆ copyfromstr()

dabc::BufferSize_t dabc::Pointer::copyfromstr ( const char *  str,
unsigned  len = 0 
)
throw (
)

Definition at line 129 of file Pointer.cxx.

◆ distance_to()

int dabc::Pointer::distance_to ( const Pointer child) const

Definition at line 134 of file Pointer.cxx.

◆ distance_to_ownbuf()

int dabc::Pointer::distance_to_ownbuf ( ) const
inline

Definition at line 204 of file Pointer.h.

◆ consumed_size()

float dabc::Pointer::consumed_size ( ) const

Returns ratio between filled size and buffer size, 0 when exmpy.

Definition at line 155 of file Pointer.cxx.

◆ is_same_buf()

bool dabc::Pointer::is_same_buf ( const Pointer ptr) const
inline

Definition at line 209 of file Pointer.h.

◆ segmid()

unsigned dabc::Pointer::segmid ( ) const
inline

Definition at line 211 of file Pointer.h.

Friends And Related Function Documentation

◆ Buffer

friend class Buffer
friend

Definition at line 36 of file Pointer.h.

Field Documentation

◆ fBuf

Buffer dabc::Pointer::fBuf
protected

we keep reference on the buffer, could be only used in same thread

Definition at line 39 of file Pointer.h.

◆ fSegm

unsigned dabc::Pointer::fSegm
protected

segment id

Definition at line 40 of file Pointer.h.

◆ fPtr

unsigned char* dabc::Pointer::fPtr
protected

pointer on the raw buffer

Definition at line 41 of file Pointer.h.

◆ fRawSize

BufferSize_t dabc::Pointer::fRawSize
protected

size of contiguous memory, pointed by fPtr

Definition at line 42 of file Pointer.h.

◆ fFullSize

BufferSize_t dabc::Pointer::fFullSize
protected

full size of memory from pointer till the end

Definition at line 43 of file Pointer.h.


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