edbee - Qt Editor Library v0.11.1
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
edbee::NoGapVector< T > Class Template Reference

A special GapVector class that isn't a gapvector. It forwards it's request to a normal vector class (for debugging purposes) that isn't a gapv This class is only used for debugging issuess with the gapvector. More...

#include <gapvector.h>

+ Collaboration diagram for edbee::NoGapVector< T >:

Public Member Functions

 NoGapVector (int capacity=16)
 
 ~NoGapVector ()
 
int length () const
 returns the used length of the data
 
int gapSize () const
 
int gapBegin () const
 
int gapEnd () const
 
int capacity () const
 
void clear ()
 clears the data
 
void replace (int offset, int length, const T *data, int newLength)
 this method replaces the given items
 
void fill (int offset, int length, const T &data, int newLength)
 this method replaces the given items with a single data item
 
void append (T t)
 convenient append method
 
void append (const T *t, int length)
 another append method
 
at (int offset) const
 This method returns the item at the given index.
 
void set (int offset, const T &value)
 This method sets an item at the given index.
 
T & operator[] (int offset)
 This method return an index.
 

Protected Attributes

QVector< T > items_
 This method returns a direct pointer to the 0-terminated buffer This pointer is only valid as long as the buffer doesn't change WARNING, this method MOVES the gap! Which means this method should NOT be used for a lot of operations.
 

Detailed Description

template<typename T>
class edbee::NoGapVector< T >

A special GapVector class that isn't a gapvector. It forwards it's request to a normal vector class (for debugging purposes) that isn't a gapv This class is only used for debugging issuess with the gapvector.

Constructor & Destructor Documentation

◆ NoGapVector()

template<typename T>
edbee::NoGapVector< T >::NoGapVector ( int capacity = 16)
inline

◆ ~NoGapVector()

template<typename T>
edbee::NoGapVector< T >::~NoGapVector ( )
inline

Member Function Documentation

◆ append() [1/2]

template<typename T>
void edbee::NoGapVector< T >::append ( const T * t,
int length )
inline

another append method

◆ append() [2/2]

template<typename T>
void edbee::NoGapVector< T >::append ( T t)
inline

convenient append method

◆ at()

template<typename T>
T edbee::NoGapVector< T >::at ( int offset) const
inline

This method returns the item at the given index.

◆ capacity()

template<typename T>
int edbee::NoGapVector< T >::capacity ( ) const
inline

◆ clear()

template<typename T>
void edbee::NoGapVector< T >::clear ( )
inline

clears the data

◆ fill()

template<typename T>
void edbee::NoGapVector< T >::fill ( int offset,
int length,
const T & data,
int newLength )
inline

this method replaces the given items with a single data item

Parameters
offsetthe offset of the items to replace
lenththe number of items to replace
newLengththe number of times to repeat data

◆ gapBegin()

template<typename T>
int edbee::NoGapVector< T >::gapBegin ( ) const
inline

◆ gapEnd()

template<typename T>
int edbee::NoGapVector< T >::gapEnd ( ) const
inline

◆ gapSize()

template<typename T>
int edbee::NoGapVector< T >::gapSize ( ) const
inline

◆ length()

template<typename T>
int edbee::NoGapVector< T >::length ( ) const
inline

returns the used length of the data

◆ operator[]()

template<typename T>
T & edbee::NoGapVector< T >::operator[] ( int offset)
inline

This method return an index.

◆ replace()

template<typename T>
void edbee::NoGapVector< T >::replace ( int offset,
int length,
const T * data,
int newLength )
inline

this method replaces the given items

Parameters
offsetthe offset of the items to replace
lenththe number of items to replace
dataan array with new items
newLengththe number of items in the new array

◆ set()

template<typename T>
void edbee::NoGapVector< T >::set ( int offset,
const T & value )
inline

This method sets an item at the given index.

Member Data Documentation

◆ items_

template<typename T>
QVector<T> edbee::NoGapVector< T >::items_
protected

This method returns a direct pointer to the 0-terminated buffer This pointer is only valid as long as the buffer doesn't change WARNING, this method MOVES the gap! Which means this method should NOT be used for a lot of operations.


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