Zero  0.1.0
Public Member Functions | Static Public Attributes | Private Member Functions | List of all members
vec_t Class Reference

Vector: a set of {pointer,length} pairs for memory manipulation. More...

#include <vec_t.h>

Inheritance diagram for vec_t:
cvec_t VEC_t

Public Member Functions

 vec_t ()
 Construct empty vector. More...
 
 vec_t (const cvec_t &v1, const cvec_t &v2)
 Construct a vector that combines two others. More...
 
 vec_t (const void *p, size_t l)
 Construct a vector from a memory location and a length. More...
 
 vec_t (const vec_t &v, size_t offset, size_t limit)
 Construct a vector from a memory location + offset and a length. More...
 
const vec_tcopy_from (const void *p, size_t limit, size_t offset=0) const
 Overwrites the data area to which the vector points. More...
 
vec_tcopy_from (const cvec_t &v)
 Overwrites the data area to which the vector points. More...
 
vec_tcopy_from (const cvec_t &v, size_t offset, size_t limit, size_t myoffset=0)
 Overwrites the data area to which the vector points. More...
 
CADDR_T ptr (int index) const
 Return the pointer from the {pointer, length} pair at the given index. More...
 
size_t len (int index) const
 Return the length from the {pointer, length} pair at the given index. More...
 
- Public Member Functions inherited from cvec_t
 cvec_t ()
 
 cvec_t (const cvec_t &v1, const cvec_t &v2)
 
 cvec_t (const void *p, size_t l)
 
 cvec_t (const cvec_t &v, size_t offset, size_t limit)
 
 ~cvec_t ()
 
void split (size_t l1, cvec_t &v1, cvec_t &v2) const
 
cvec_tput (const cvec_t &v, size_t offset, size_t nbytes)
 
cvec_tput (const void *p, size_t l)
 append { p, l } pair to this vector. More...
 
cvec_tput (const cvec_t &v)
 append { p, l } pairs from v to this vector. More...
 
cvec_tput (const w_keystr_t &keystr)
 
cvec_tput (const w_keystr_t &keystr, size_t offset, size_t nbytes)
 
cvec_treset ()
 Clear this vector. More...
 
cvec_tset (const cvec_t &v1, const cvec_t &v2)
 reset, then copy over all {p,l} pairs from v1 and v2 More...
 
cvec_tset (const cvec_t &v)
 reset, then copy over all {p,l} pairs from v More...
 
cvec_tset (const void *p, size_t l)
 reset, then install {p,l} pair More...
 
cvec_tset (const cvec_t &v, size_t offset, size_t limit)
 
size_t size () const
 returns # bytes this vector references More...
 
size_t copy_to (void *p, size_t limit=0x7fffffff) const
 
size_t copy_to (std::basic_string< unsigned char > &buffer, size_t limit=0x7fffffff) const
 
int cmp (const cvec_t &v, size_t *common_size=0) const
 
int cmp (const void *s, size_t len) const
 
int count () const
 return number of {p,l} pairs More...
 
int checksum () const
 
void calc_kvl (uint32_t &h) const
 
void init ()
 
void vecdelparts ()
 
void delparts ()
 
bool is_pos_inf () const
 
bool is_neg_inf () const
 
bool is_null () const
 
bool is_zvec () const
 

Static Public Attributes

static vec_tpos_inf
 A constant vector representing infinity. Used for key-value pairs, scans. More...
 
static vec_tneg_inf
 A constant vector representing negative infinity. Used for key-value pairs, scans. More...
 
- Static Public Attributes inherited from cvec_t
static cvec_t pos_inf
 
static cvec_t neg_inf
 

Private Member Functions

 vec_t (const vec_t &)
 
vec_toperator= (vec_t)
 

Additional Inherited Members

- Public Types inherited from cvec_t
enum  dummy_enumid { max_small = MAX_SMALL_VEC_SIZE }
 
- Static Public Member Functions inherited from cvec_t
static int cmp (const cvec_t &v1, const cvec_t &v2, size_t *common_size=0)
 
- Protected Attributes inherited from VEC_t
int _cnt
 
size_t _size
 
vec_pair_t_base
 
vec_pair_t _pair [MAX_SMALL_VEC_SIZE]
 
- Static Protected Attributes inherited from cvec_t
static CADDR_T zero_location
 

Detailed Description

Vector: a set of {pointer,length} pairs for memory manipulation.

This class is used throughout the storage manager and in its API for copy-in and copy-out.

Constructor & Destructor Documentation

§ vec_t() [1/5]

vec_t::vec_t ( )
inline

Construct empty vector.

§ vec_t() [2/5]

vec_t::vec_t ( const cvec_t v1,
const cvec_t v2 
)
inline

Construct a vector that combines two others.

§ vec_t() [3/5]

vec_t::vec_t ( const void *  p,
size_t  l 
)
inline

Construct a vector from a memory location and a length.

§ vec_t() [4/5]

vec_t::vec_t ( const vec_t v,
size_t  offset,
size_t  limit 
)
inline

Construct a vector from a memory location + offset and a length.

§ vec_t() [5/5]

vec_t::vec_t ( const vec_t )
inlineprivate

Member Function Documentation

§ copy_from() [1/3]

const vec_t& vec_t::copy_from ( const void *  p,
size_t  limit,
size_t  offset = 0 
) const

Overwrites the data area to which the vector points.

Scatter limit bytes of data from the location at p into the locations identified by this vector.

§ copy_from() [2/3]

vec_t& vec_t::copy_from ( const cvec_t v)

Overwrites the data area to which the vector points.

Write data from the vector v into the locations identified by this vector.

§ copy_from() [3/3]

vec_t& vec_t::copy_from ( const cvec_t v,
size_t  offset,
size_t  limit,
size_t  myoffset = 0 
)

Overwrites the data area to which the vector points.

Write data from the vector v, starting at the given offset from the start of vector v, into the locations identified by this vector.

§ len()

size_t vec_t::len ( int  index) const
inline

Return the length from the {pointer, length} pair at the given index.

§ operator=()

vec_t& vec_t::operator= ( vec_t  )
private

§ ptr()

CADDR_T vec_t::ptr ( int  index) const
inline

Return the pointer from the {pointer, length} pair at the given index.

Member Data Documentation

§ neg_inf

vec_t& vec_t::neg_inf
static

A constant vector representing negative infinity. Used for key-value pairs, scans.

§ pos_inf

vec_t& vec_t::pos_inf
static

A constant vector representing infinity. Used for key-value pairs, scans.

skip


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