SecByteBlock Class Reference

SecByteBlock is a SecBlock<byte> typedef. More...

Inheritance diagram for SecByteBlock:
SecBlock< byte >

List of all members.

Public Types

typedef AllocatorWithCleanup
< byte >::value_type 
value_type
typedef AllocatorWithCleanup
< byte >::pointer 
iterator
typedef AllocatorWithCleanup
< byte >::const_pointer 
const_iterator
typedef AllocatorWithCleanup
< byte >::size_type 
size_type

Public Member Functions

 operator const void * () const
 operator void * ()
 operator const byte * () const
 operator byte * ()
iterator begin ()
 Provides an iterator pointing to the first element in the memory block.
const_iterator begin () const
 Provides a constant iterator pointing to the first element in the memory block.
iterator end ()
 Provides an iterator pointing beyond the last element in the memory block.
const_iterator end () const
 Provides a constant iterator pointing beyond the last element in the memory block.
AllocatorWithCleanup< byte >
::pointer 
data ()
 Provides a pointer to the first element in the memory block.
AllocatorWithCleanup< byte >
::const_pointer 
data () const
 Provides a pointer to the first element in the memory block.
size_type size () const
 Provides the count of elements in the SecBlock.
bool empty () const
 Determines if the SecBlock is empty.
byte * BytePtr ()
 Provides a byte pointer to the first element in the memory block.
const byte * BytePtr () const
 Return a byte pointer to the first element in the memory block.
size_type SizeInBytes () const
 Provides the number of bytes in the SecBlock.
void Assign (const byte *ptr, size_type len)
 Set contents and size from an array.
void Assign (const SecBlock< byte, AllocatorWithCleanup< byte > > &t)
 Copy contents from another SecBlock.
SecBlock< byte,
AllocatorWithCleanup< byte > > & 
operator+= (const SecBlock< byte, AllocatorWithCleanup< byte > > &t)
 Append contents from another SecBlock.
SecBlock< byte,
AllocatorWithCleanup< byte > > 
operator+ (const SecBlock< byte, AllocatorWithCleanup< byte > > &t)
 Concatenate contents from another SecBlock.
bool operator== (const SecBlock< byte, AllocatorWithCleanup< byte > > &t) const
 Bitwise compare two SecBlocks.
bool operator!= (const SecBlock< byte, AllocatorWithCleanup< byte > > &t) const
 Bitwise compare two SecBlocks.
void New (size_type newSize)
 Change size without preserving contents.
void CleanNew (size_type newSize)
 Change size without preserving contents.
void Grow (size_type newSize)
 Change size and preserve contents.
void CleanGrow (size_type newSize)
 Change size and preserve contents.
void resize (size_type newSize)
 Change size and preserve contents.
void swap (SecBlock< byte, AllocatorWithCleanup< byte > > &b)
 Swap contents with another SecBlock.

Public Attributes

AllocatorWithCleanup< byte > m_alloc
size_type m_size
byte * m_ptr

Detailed Description

SecByteBlock is a SecBlock<byte> typedef.

Definition at line 722 of file secblock.h.


Member Function Documentation

iterator SecBlock< byte , AllocatorWithCleanup<byte > >::begin (  )  [inline, inherited]

Provides an iterator pointing to the first element in the memory block.

Returns:
iterator pointing to the first element in the memory block

Definition at line 487 of file secblock.h.

const_iterator SecBlock< byte , AllocatorWithCleanup<byte > >::begin (  )  const [inline, inherited]

Provides a constant iterator pointing to the first element in the memory block.

Returns:
constant iterator pointing to the first element in the memory block

Definition at line 491 of file secblock.h.

iterator SecBlock< byte , AllocatorWithCleanup<byte > >::end (  )  [inline, inherited]

Provides an iterator pointing beyond the last element in the memory block.

Returns:
iterator pointing beyond the last element in the memory block

Definition at line 495 of file secblock.h.

const_iterator SecBlock< byte , AllocatorWithCleanup<byte > >::end (  )  const [inline, inherited]

Provides a constant iterator pointing beyond the last element in the memory block.

Returns:
constant iterator pointing beyond the last element in the memory block

Definition at line 499 of file secblock.h.

AllocatorWithCleanup<byte > ::pointer SecBlock< byte , AllocatorWithCleanup<byte > >::data (  )  [inline, inherited]

Provides a pointer to the first element in the memory block.

Returns:
pointer to the first element in the memory block

Definition at line 504 of file secblock.h.

AllocatorWithCleanup<byte > ::const_pointer SecBlock< byte , AllocatorWithCleanup<byte > >::data (  )  const [inline, inherited]

Provides a pointer to the first element in the memory block.

Returns:
constant pointer to the first element in the memory block

Definition at line 507 of file secblock.h.

size_type SecBlock< byte , AllocatorWithCleanup<byte > >::size (  )  const [inline, inherited]

Provides the count of elements in the SecBlock.

Returns:
number of elements in the memory block
Note:
the return value is the count of elements, and not the number of bytes

Definition at line 512 of file secblock.h.

bool SecBlock< byte , AllocatorWithCleanup<byte > >::empty (  )  const [inline, inherited]

Determines if the SecBlock is empty.

Returns:
true if number of elements in the memory block is 0, false otherwise

Definition at line 515 of file secblock.h.

byte* SecBlock< byte , AllocatorWithCleanup<byte > >::BytePtr (  )  [inline, inherited]

Provides a byte pointer to the first element in the memory block.

Returns:
byte pointer to the first element in the memory block

Definition at line 519 of file secblock.h.

const byte* SecBlock< byte , AllocatorWithCleanup<byte > >::BytePtr (  )  const [inline, inherited]

Return a byte pointer to the first element in the memory block.

Returns:
constant byte pointer to the first element in the memory block

Definition at line 522 of file secblock.h.

size_type SecBlock< byte , AllocatorWithCleanup<byte > >::SizeInBytes (  )  const [inline, inherited]

Provides the number of bytes in the SecBlock.

Returns:
the number of bytes in the memory block
Note:
the return value is the number of bytes, and not count of elements.

Definition at line 526 of file secblock.h.

void SecBlock< byte , AllocatorWithCleanup<byte > >::Assign ( const byte *  ptr,
size_type  len 
) [inline, inherited]

Set contents and size from an array.

Parameters:
ptr a pointer to an array of T
len the number of elements in the memory block

If the memory block is reduced in size, then the unused area is set to 0.

Definition at line 532 of file secblock.h.

void SecBlock< byte , AllocatorWithCleanup<byte > >::Assign ( const SecBlock< byte , AllocatorWithCleanup<byte > > &  t  )  [inline, inherited]

Copy contents from another SecBlock.

Parameters:
t the other SecBlock

Assign checks for self assignment.

If the memory block is reduced in size, then the unused area is set to 0.

Definition at line 543 of file secblock.h.

SecBlock<byte , AllocatorWithCleanup<byte > >& SecBlock< byte , AllocatorWithCleanup<byte > >::operator+= ( const SecBlock< byte , AllocatorWithCleanup<byte > > &  t  )  [inline, inherited]

Append contents from another SecBlock.

Parameters:
t the other SecBlock

Internally, this SecBlock calls Grow and then copies the new content.

If the memory block is reduced in size, then the unused area is set to 0.

Definition at line 568 of file secblock.h.

SecBlock<byte , AllocatorWithCleanup<byte > > SecBlock< byte , AllocatorWithCleanup<byte > >::operator+ ( const SecBlock< byte , AllocatorWithCleanup<byte > > &  t  )  [inline, inherited]

Concatenate contents from another SecBlock.

Parameters:
t the other SecBlock
Returns:
a newly constructed SecBlock that is a conacentation of this and t

Internally, a temporary SecBlock is created and the content from this SecBlock and the other SecBlock are concatenated. The temporary SecBlock is returned to the caller.

Definition at line 589 of file secblock.h.

bool SecBlock< byte , AllocatorWithCleanup<byte > >::operator== ( const SecBlock< byte , AllocatorWithCleanup<byte > > &  t  )  const [inline, inherited]

Bitwise compare two SecBlocks.

Parameters:
t the other SecBlock
Returns:
true if the size and bits are equal, false otherwise

Uses a constant time compare if the arrays are equal size. The constant time compare is VerifyBufsEqual() found in misc.h.

See also:
operator!=()

Definition at line 607 of file secblock.h.

bool SecBlock< byte , AllocatorWithCleanup<byte > >::operator!= ( const SecBlock< byte , AllocatorWithCleanup<byte > > &  t  )  const [inline, inherited]

Bitwise compare two SecBlocks.

Parameters:
t the other SecBlock
Returns:
true if the size and bits are equal, false otherwise

Uses a constant time compare if the arrays are equal size. The constant time compare is VerifyBufsEqual() found in misc.h.

Internally, operator!=() returns the inverse of operator==().

See also:
operator==()

Definition at line 619 of file secblock.h.

void SecBlock< byte , AllocatorWithCleanup<byte > >::New ( size_type  newSize  )  [inline, inherited]

Change size without preserving contents.

Parameters:
newSize the new size of the memory block

Old content is not preserved. If the memory block is reduced in size, then the unused content is set to 0. If the memory block grows in size, then all content is uninitialized.

Internally, this SecBlock calls reallocate().

See also:
New(), CleanNew(), Grow(), CleanGrow(), resize()

Definition at line 631 of file secblock.h.

void SecBlock< byte , AllocatorWithCleanup<byte > >::CleanNew ( size_type  newSize  )  [inline, inherited]

Change size without preserving contents.

Parameters:
newSize the new size of the memory block

Old content is not preserved. If the memory block is reduced in size, then the unused content is set to 0. Existing and new content is set to 0.

Internally, this SecBlock calls reallocate().

See also:
New(), CleanNew(), Grow(), CleanGrow(), resize()

Definition at line 643 of file secblock.h.

void SecBlock< byte , AllocatorWithCleanup<byte > >::Grow ( size_type  newSize  )  [inline, inherited]

Change size and preserve contents.

Parameters:
newSize the new size of the memory block

Old content is preserved. If the memory block grows in size, then all content is uninitialized.

Internally, this SecBlock calls reallocate().

Note:
reallocate() is called if the size increases. If the size does not increase, then Grow does not take action. If the size must change, then use resize().
See also:
New(), CleanNew(), Grow(), CleanGrow(), resize()

Definition at line 658 of file secblock.h.

void SecBlock< byte , AllocatorWithCleanup<byte > >::CleanGrow ( size_type  newSize  )  [inline, inherited]

Change size and preserve contents.

Parameters:
newSize the new size of the memory block

Old content is preserved. If the memory block is reduced in size, then the unused content is set to 0. If the memory block grows in size, then the new content is uninitialized.

Internally, this SecBlock calls reallocate().

Note:
reallocate() is called if the size increases. If the size does not increase, then Grow does not take action. If the size must change, then use resize().
See also:
New(), CleanNew(), Grow(), CleanGrow(), resize()

Definition at line 677 of file secblock.h.

void SecBlock< byte , AllocatorWithCleanup<byte > >::resize ( size_type  newSize  )  [inline, inherited]

Change size and preserve contents.

Parameters:
newSize the new size of the memory block

Old content is preserved. If the memory block grows in size, then all content is uninitialized.

Internally, this SecBlock calls reallocate().

Note:
reallocate() is called if the size increases. If the size does not increase, then Grow does not take action. If the size must change, then use resize().
See also:
New(), CleanNew(), Grow(), CleanGrow(), resize()

Definition at line 696 of file secblock.h.

void SecBlock< byte , AllocatorWithCleanup<byte > >::swap ( SecBlock< byte , AllocatorWithCleanup<byte > > &  b  )  [inline, inherited]

Swap contents with another SecBlock.

Parameters:
b the other SecBlock

Internally, std::swap() is called on m_alloc, m_size and m_ptr.

Definition at line 705 of file secblock.h.


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

Generated on 24 Mar 2016 for Crypto++ by  doxygen 1.6.1