Feathercoin  0.5.0
P2P Digital Currency
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
Public Types | Public Member Functions | Public Attributes | Protected Types | Protected Attributes | Friends | List of all members
CDataStream Class Reference

Double ended buffer combining vector and stream-like interfaces. More...

#include <serialize.h>

Public Types

typedef vector_type::allocator_type allocator_type
 
typedef vector_type::size_type size_type
 
typedef
vector_type::difference_type 
difference_type
 
typedef vector_type::reference reference
 
typedef
vector_type::const_reference 
const_reference
 
typedef vector_type::value_type value_type
 
typedef vector_type::iterator iterator
 
typedef vector_type::const_iterator const_iterator
 
typedef
vector_type::reverse_iterator 
reverse_iterator
 

Public Member Functions

 CDataStream (int nTypeIn, int nVersionIn)
 
 CDataStream (const_iterator pbegin, const_iterator pend, int nTypeIn, int nVersionIn)
 
 CDataStream (const char *pbegin, const char *pend, int nTypeIn, int nVersionIn)
 
 CDataStream (const vector_type &vchIn, int nTypeIn, int nVersionIn)
 
 CDataStream (const std::vector< char > &vchIn, int nTypeIn, int nVersionIn)
 
 CDataStream (const std::vector< unsigned char > &vchIn, int nTypeIn, int nVersionIn)
 
void Init (int nTypeIn, int nVersionIn)
 
CDataStreamoperator+= (const CDataStream &b)
 
std::string str () const
 
const_iterator begin () const
 
iterator begin ()
 
const_iterator end () const
 
iterator end ()
 
size_type size () const
 
bool empty () const
 
void resize (size_type n, value_type c=0)
 
void reserve (size_type n)
 
const_reference operator[] (size_type pos) const
 
reference operator[] (size_type pos)
 
void clear ()
 
iterator insert (iterator it, const char &x=char())
 
void insert (iterator it, size_type n, const char &x)
 
void insert (iterator it, std::vector< char >::const_iterator first, std::vector< char >::const_iterator last)
 
void insert (iterator it, const char *first, const char *last)
 
iterator erase (iterator it)
 
iterator erase (iterator first, iterator last)
 
void Compact ()
 
bool Rewind (size_type n)
 
void setstate (short bits, const char *psz)
 
bool eof () const
 
bool fail () const
 
bool good () const
 
void clear (short n)
 
short exceptions ()
 
short exceptions (short mask)
 
CDataStreamrdbuf ()
 
int in_avail ()
 
void SetType (int n)
 
int GetType ()
 
void SetVersion (int n)
 
int GetVersion ()
 
void ReadVersion ()
 
void WriteVersion ()
 
CDataStreamread (char *pch, int nSize)
 
CDataStreamignore (int nSize)
 
CDataStreamwrite (const char *pch, int nSize)
 
template<typename Stream >
void Serialize (Stream &s, int nType, int nVersion) const
 
template<typename T >
unsigned int GetSerializeSize (const T &obj)
 
template<typename T >
CDataStreamoperator<< (const T &obj)
 
template<typename T >
CDataStreamoperator>> (T &obj)
 
void GetAndClear (CSerializeData &data)
 

Public Attributes

int nType
 
int nVersion
 

Protected Types

typedef CSerializeData vector_type
 

Protected Attributes

vector_type vch
 
unsigned int nReadPos
 
short state
 
short exceptmask
 

Friends

CDataStream operator+ (const CDataStream &a, const CDataStream &b)
 

Detailed Description

Double ended buffer combining vector and stream-like interfaces.

and << read and write unformatted data using the above serialization templates.

Fills with data in linear time; some stringstream implementations take N^2 time.

Definition at line 799 of file serialize.h.

Member Typedef Documentation

typedef vector_type::allocator_type CDataStream::allocator_type

Definition at line 811 of file serialize.h.

typedef vector_type::const_iterator CDataStream::const_iterator

Definition at line 818 of file serialize.h.

typedef vector_type::const_reference CDataStream::const_reference

Definition at line 815 of file serialize.h.

typedef vector_type::difference_type CDataStream::difference_type

Definition at line 813 of file serialize.h.

typedef vector_type::iterator CDataStream::iterator

Definition at line 817 of file serialize.h.

typedef vector_type::reference CDataStream::reference

Definition at line 814 of file serialize.h.

typedef vector_type::reverse_iterator CDataStream::reverse_iterator

Definition at line 819 of file serialize.h.

typedef vector_type::size_type CDataStream::size_type

Definition at line 812 of file serialize.h.

typedef vector_type::value_type CDataStream::value_type

Definition at line 816 of file serialize.h.

Definition at line 802 of file serialize.h.

Constructor & Destructor Documentation

CDataStream::CDataStream ( int  nTypeIn,
int  nVersionIn 
)
inlineexplicit

Definition at line 821 of file serialize.h.

CDataStream::CDataStream ( const_iterator  pbegin,
const_iterator  pend,
int  nTypeIn,
int  nVersionIn 
)
inline

Definition at line 826 of file serialize.h.

CDataStream::CDataStream ( const char *  pbegin,
const char *  pend,
int  nTypeIn,
int  nVersionIn 
)
inline

Definition at line 832 of file serialize.h.

CDataStream::CDataStream ( const vector_type vchIn,
int  nTypeIn,
int  nVersionIn 
)
inline

Definition at line 838 of file serialize.h.

CDataStream::CDataStream ( const std::vector< char > &  vchIn,
int  nTypeIn,
int  nVersionIn 
)
inline

Definition at line 843 of file serialize.h.

CDataStream::CDataStream ( const std::vector< unsigned char > &  vchIn,
int  nTypeIn,
int  nVersionIn 
)
inline

Definition at line 848 of file serialize.h.

Member Function Documentation

const_iterator CDataStream::begin ( ) const
inline

Definition at line 884 of file serialize.h.

iterator CDataStream::begin ( )
inline

Definition at line 885 of file serialize.h.

void CDataStream::clear ( )
inline

Definition at line 894 of file serialize.h.

void CDataStream::clear ( short  n)
inline

Definition at line 992 of file serialize.h.

void CDataStream::Compact ( )
inline

Definition at line 963 of file serialize.h.

bool CDataStream::empty ( ) const
inline

Definition at line 889 of file serialize.h.

const_iterator CDataStream::end ( ) const
inline

Definition at line 886 of file serialize.h.

iterator CDataStream::end ( )
inline

Definition at line 887 of file serialize.h.

bool CDataStream::eof ( ) const
inline

Definition at line 989 of file serialize.h.

iterator CDataStream::erase ( iterator  it)
inline

Definition at line 926 of file serialize.h.

iterator CDataStream::erase ( iterator  first,
iterator  last 
)
inline

Definition at line 943 of file serialize.h.

short CDataStream::exceptions ( )
inline

Definition at line 993 of file serialize.h.

short CDataStream::exceptions ( short  mask)
inline

Definition at line 994 of file serialize.h.

bool CDataStream::fail ( ) const
inline

Definition at line 990 of file serialize.h.

void CDataStream::GetAndClear ( CSerializeData data)
inline

Definition at line 1087 of file serialize.h.

template<typename T >
unsigned int CDataStream::GetSerializeSize ( const T &  obj)
inline

Definition at line 1065 of file serialize.h.

int CDataStream::GetType ( )
inline

Definition at line 999 of file serialize.h.

int CDataStream::GetVersion ( )
inline

Definition at line 1001 of file serialize.h.

bool CDataStream::good ( ) const
inline

Definition at line 991 of file serialize.h.

CDataStream& CDataStream::ignore ( int  nSize)
inline

Definition at line 1028 of file serialize.h.

int CDataStream::in_avail ( )
inline

Definition at line 996 of file serialize.h.

void CDataStream::Init ( int  nTypeIn,
int  nVersionIn 
)
inline

Definition at line 853 of file serialize.h.

iterator CDataStream::insert ( iterator  it,
const char &  x = char() 
)
inline

Definition at line 895 of file serialize.h.

void CDataStream::insert ( iterator  it,
size_type  n,
const char &  x 
)
inline

Definition at line 896 of file serialize.h.

void CDataStream::insert ( iterator  it,
std::vector< char >::const_iterator  first,
std::vector< char >::const_iterator  last 
)
inline

Definition at line 898 of file serialize.h.

void CDataStream::insert ( iterator  it,
const char *  first,
const char *  last 
)
inline

Definition at line 912 of file serialize.h.

CDataStream& CDataStream::operator+= ( const CDataStream b)
inline

Definition at line 862 of file serialize.h.

template<typename T >
CDataStream& CDataStream::operator<< ( const T &  obj)
inline

Definition at line 1072 of file serialize.h.

template<typename T >
CDataStream& CDataStream::operator>> ( T &  obj)
inline

Definition at line 1080 of file serialize.h.

const_reference CDataStream::operator[] ( size_type  pos) const
inline

Definition at line 892 of file serialize.h.

reference CDataStream::operator[] ( size_type  pos)
inline

Definition at line 893 of file serialize.h.

CDataStream* CDataStream::rdbuf ( )
inline

Definition at line 995 of file serialize.h.

CDataStream& CDataStream::read ( char *  pch,
int  nSize 
)
inline

Definition at line 1005 of file serialize.h.

void CDataStream::ReadVersion ( )
inline

Definition at line 1002 of file serialize.h.

void CDataStream::reserve ( size_type  n)
inline

Definition at line 891 of file serialize.h.

void CDataStream::resize ( size_type  n,
value_type  c = 0 
)
inline

Definition at line 890 of file serialize.h.

bool CDataStream::Rewind ( size_type  n)
inline

Definition at line 969 of file serialize.h.

template<typename Stream >
void CDataStream::Serialize ( Stream &  s,
int  nType,
int  nVersion 
) const
inline

Definition at line 1057 of file serialize.h.

void CDataStream::setstate ( short  bits,
const char *  psz 
)
inline

Definition at line 982 of file serialize.h.

void CDataStream::SetType ( int  n)
inline

Definition at line 998 of file serialize.h.

void CDataStream::SetVersion ( int  n)
inline

Definition at line 1000 of file serialize.h.

size_type CDataStream::size ( ) const
inline

Definition at line 888 of file serialize.h.

std::string CDataStream::str ( ) const
inline

Definition at line 875 of file serialize.h.

CDataStream& CDataStream::write ( const char *  pch,
int  nSize 
)
inline

Definition at line 1048 of file serialize.h.

void CDataStream::WriteVersion ( )
inline

Definition at line 1003 of file serialize.h.

Friends And Related Function Documentation

CDataStream operator+ ( const CDataStream a,
const CDataStream b 
)
friend

Definition at line 868 of file serialize.h.

Member Data Documentation

short CDataStream::exceptmask
protected

Definition at line 806 of file serialize.h.

unsigned int CDataStream::nReadPos
protected

Definition at line 804 of file serialize.h.

int CDataStream::nType

Definition at line 808 of file serialize.h.

int CDataStream::nVersion

Definition at line 809 of file serialize.h.

short CDataStream::state
protected

Definition at line 805 of file serialize.h.

vector_type CDataStream::vch
protected

Definition at line 803 of file serialize.h.


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