edbee - Qt Editor Library
Public Member Functions | Protected Attributes | List of all members
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 More...
 
int gapSize () const
 
int gapBegin () const
 
int gapEnd () const
 
int capacity () const
 
void clear ()
 clears the data More...
 
void replace (int offset, int length, const T *data, int newLength)
 this method replaces the given items More...
 
void fill (int offset, int length, const T &data, int newLength)
 this method replaces the given items with a single data item More...
 
void append (T t)
 convenient append method More...
 
void append (const T *t, int length)
 another append method More...
 
at (int offset) const
 This method returns the item at the given index. More...
 
void set (int offset, const T &value)
 This method sets an item at the given index. More...
 
T & operator[] (int offset)
 This method return an index. More...
 

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. More...
 

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 ( t)
inline

convenient append method

◆ append() [2/2]

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

another 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: