Go to the SVN repository for this file.
1 #ifndef UTIL_SIMPLE_BUFFER__HPP 2 #define UTIL_SIMPLE_BUFFER__HPP 44 size_trequested_size)
45{
returnrequested_size; }
52 size_trequested_size)
54 size_tnew_size = requested_size + requested_size / 2;
57 if(new_size < requested_size)
69 size_tnew_size = required_size * 2;
71 if(new_size < required_size)
82 template<
typename T=
unsignedchar,
169 size_tnew_capacity =
170ResizeStrategy::GetNewCapacity(
m_Capacity,new_size);
192 size_tnew_capacity = ResizeStrategy::GetNewCapacity(
m_Capacity,new_size);
static size_t GetNewCapacity(size_t, size_t requested_size)
static size_t GetNewCapacity(size_t, size_t required_size)
Reallocable memory buffer (no memory copy overhead) Mimics vector<>, without the overhead of explicit...
const value_type * data() const
value_type * x_Allocate(size_t elem)
CSimpleBufferT & append(const void *buf, size_t len)
const value_type & operator[](size_type i) const
void resize_mem(size_type new_size)
Resize the buffer. No data preservation.
void resize(size_type new_size)
CSimpleBufferT(size_type new_size=0)
void swap(CSimpleBufferT< T > &other)
void reserve_mem(size_type new_size)
Reserve memory. No data preservation guarantees.
void reserve(size_type new_size)
value_type & operator[](size_type i)
CSimpleBufferT(const CSimpleBufferT &sb)
CSimpleBufferT & operator=(const CSimpleBufferT &sb)
size_type capacity() const
void x_Fill(value_type *buffer, int value, size_t elem)
static size_t GetNewCapacity(size_t, size_t requested_size)
Include a standard set of the NCBI C++ Toolkit most basic headers.
void swap(NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair1, NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair2)
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
const GenericPointer< typename T::ValueType > T2 value
CSimpleBufferT CSimpleBuffer
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4