Zero  0.1.0
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Static Protected Attributes | Private Member Functions | Friends | List of all members
cvec_t Class Reference

A constant vec_t (meaning things pointed to cannot be changed). More...

#include <vec_t.h>

Inheritance diagram for cvec_t:
VEC_t vec_t

Public Types

enum  dummy_enumid { max_small = MAX_SMALL_VEC_SIZE }
 

Public Member Functions

 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 Member Functions

static int cmp (const cvec_t &v1, const cvec_t &v2, size_t *common_size=0)
 

Static Public Attributes

static cvec_t pos_inf
 
static cvec_t neg_inf
 

Static Protected Attributes

static CADDR_T zero_location
 

Private Member Functions

 cvec_t (const cvec_t &v)
 
bool _is_large () const
 
int _max_cnt () const
 
void _grow (int total_cnt)
 
cvec_toperator= (cvec_t)
 
size_t recalc_size () const
 
bool check_size () const
 

Friends

class vec_t
 
bool operator< (const cvec_t &v1, const cvec_t &v2)
 
bool operator<= (const cvec_t &v1, const cvec_t &v2)
 
bool operator>= (const cvec_t &v1, const cvec_t &v2)
 
bool operator> (const cvec_t &v1, const cvec_t &v2)
 
bool operator== (const cvec_t &v1, const cvec_t &v2)
 
bool operator!= (const cvec_t &v1, const cvec_t &v2)
 
ostream & operator<< (ostream &, const cvec_t &v)
 
istream & operator>> (istream &, cvec_t &v)
 

Additional Inherited Members

- Protected Attributes inherited from VEC_t
int _cnt
 
size_t _size
 
vec_pair_t_base
 
vec_pair_t _pair [MAX_SMALL_VEC_SIZE]
 

Detailed Description

A constant vec_t (meaning things pointed to cannot be changed).

Member Enumeration Documentation

§ dummy_enumid

Enumerator
max_small 

Constructor & Destructor Documentation

§ cvec_t() [1/5]

cvec_t::cvec_t ( )
inline

§ cvec_t() [2/5]

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

§ cvec_t() [3/5]

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

§ cvec_t() [4/5]

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

§ ~cvec_t()

cvec_t::~cvec_t ( )

§ cvec_t() [5/5]

cvec_t::cvec_t ( const cvec_t v)
private

Member Function Documentation

§ _grow()

void cvec_t::_grow ( int  total_cnt)
private

§ _is_large()

bool cvec_t::_is_large ( ) const
inlineprivate

§ _max_cnt()

int cvec_t::_max_cnt ( ) const
inlineprivate

§ calc_kvl()

void cvec_t::calc_kvl ( uint32_t &  h) const

§ check_size()

bool cvec_t::check_size ( ) const
private

§ checksum()

int cvec_t::checksum ( ) const

§ cmp() [1/3]

int cvec_t::cmp ( const cvec_t v,
size_t *  common_size = 0 
) const

Return value : 0 if equal; common_size not set : <0 if this < v or v is longer than this, but equal in length of this. : >0 if this > v or this is longer than v, but equal in length of v.

§ cmp() [2/3]

int cvec_t::cmp ( const void *  s,
size_t  len 
) const

§ cmp() [3/3]

static int cvec_t::cmp ( const cvec_t v1,
const cvec_t v2,
size_t *  common_size = 0 
)
inlinestatic

§ copy_to() [1/2]

size_t cvec_t::copy_to ( void *  p,
size_t  limit = 0x7fffffff 
) const

Write from vector to p, no more than limit bytes.

§ copy_to() [2/2]

size_t cvec_t::copy_to ( std::basic_string< unsigned char > &  buffer,
size_t  limit = 0x7fffffff 
) const

Write from vector to std::string, no more than limit bytes.

§ count()

int cvec_t::count ( ) const
inline

return number of {p,l} pairs

§ delparts()

void cvec_t::delparts ( )
inline

§ init()

void cvec_t::init ( )
inline

§ is_neg_inf()

bool cvec_t::is_neg_inf ( ) const
inline

§ is_null()

bool cvec_t::is_null ( ) const
inline

§ is_pos_inf()

bool cvec_t::is_pos_inf ( ) const
inline

§ is_zvec()

bool cvec_t::is_zvec ( ) const
inline

§ operator=()

cvec_t& cvec_t::operator= ( cvec_t  )
private

§ put() [1/5]

cvec_t& cvec_t::put ( const cvec_t v,
size_t  offset,
size_t  nbytes 
)

append {p,l} pairs from vector v, (first ptr is v + offset), as needed to append at most nbytes

§ put() [2/5]

cvec_t& cvec_t::put ( const void *  p,
size_t  l 
)

append { p, l } pair to this vector.

§ put() [3/5]

cvec_t& cvec_t::put ( const cvec_t v)

append { p, l } pairs from v to this vector.

§ put() [4/5]

cvec_t& cvec_t::put ( const w_keystr_t keystr)

Add the key string WITH sign byte.

§ put() [5/5]

cvec_t& cvec_t::put ( const w_keystr_t keystr,
size_t  offset,
size_t  nbytes 
)

Add the key string WITH sign byte.

§ recalc_size()

size_t cvec_t::recalc_size ( ) const
private

§ reset()

cvec_t& cvec_t::reset ( )
inline

Clear this vector.

§ set() [1/4]

cvec_t& cvec_t::set ( const cvec_t v1,
const cvec_t v2 
)
inline

reset, then copy over all {p,l} pairs from v1 and v2

§ set() [2/4]

cvec_t& cvec_t::set ( const cvec_t v)
inline

reset, then copy over all {p,l} pairs from v

§ set() [3/4]

cvec_t& cvec_t::set ( const void *  p,
size_t  l 
)
inline

reset, then install {p,l} pair

§ set() [4/4]

cvec_t& cvec_t::set ( const cvec_t v,
size_t  offset,
size_t  limit 
)
inline

reset, then install {p,l} pairs as needed to capture limit bytes starting at v + offset

§ size()

size_t cvec_t::size ( ) const
inline

returns # bytes this vector references

§ split()

void cvec_t::split ( size_t  l1,
cvec_t v1,
cvec_t v2 
) const

§ vecdelparts()

void cvec_t::vecdelparts ( )
inline

Friends And Related Function Documentation

§ operator!=

bool operator!= ( const cvec_t v1,
const cvec_t v2 
)
friend

§ operator<

bool operator< ( const cvec_t v1,
const cvec_t v2 
)
friend

§ operator<<

ostream& operator<< ( ostream &  ,
const cvec_t v 
)
friend

§ operator<=

bool operator<= ( const cvec_t v1,
const cvec_t v2 
)
friend

§ operator==

bool operator== ( const cvec_t v1,
const cvec_t v2 
)
friend

§ operator>

bool operator> ( const cvec_t v1,
const cvec_t v2 
)
friend

§ operator>=

bool operator>= ( const cvec_t v1,
const cvec_t v2 
)
friend

§ operator>>

istream& operator>> ( istream &  ,
cvec_t v 
)
friend

§ vec_t

friend class vec_t
friend

Member Data Documentation

§ neg_inf

cvec_t cvec_t::neg_inf
static

§ pos_inf

cvec_t cvec_t::pos_inf
static

§ zero_location

CADDR_T cvec_t::zero_location
staticprotected

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