GRASS GIS 7 Programmer's Manual  7.9.dev(2021)-e5379bbd7
im_buffer< T > Class Template Reference

#include <imbuffer.h>

Public Member Functions

 im_buffer (long n)
 
 im_buffer (const im_buffer &b)
 
 ~im_buffer ()
 
bool insert (T &x)
 
unsigned long insert (T *x, unsigned long n)
 
void sort ()
 
unsigned long get_buf_maxlen () const
 
unsigned long get_buf_len () const
 
bool is_full () const
 
bool is_empty () const
 
get_item (unsigned long i) const
 
T * get_array () const
 
AMI_STREAM< T > * save2str () const
 
void set_item (unsigned long i, T &item)
 
void reset ()
 
void clear ()
 
void reset (unsigned long start, unsigned long n)
 
void shift_left (unsigned long n)
 
void print_range () const
 
void print () const
 

Friends

ostream & operator<< (ostream &s, const im_buffer &b)
 

Detailed Description

template<class T>
class im_buffer< T >

Definition at line 80 of file imbuffer.h.

Constructor & Destructor Documentation

◆ im_buffer() [1/2]

template<class T>
im_buffer< T >::im_buffer ( long  n)
inline

Definition at line 98 of file imbuffer.h.

References assert, b, and MEMORY_LOG().

◆ im_buffer() [2/2]

template<class T >
im_buffer< T >::im_buffer ( const im_buffer< T > &  b)

Definition at line 209 of file imbuffer.h.

References assert, and MEMORY_LOG().

◆ ~im_buffer()

template<class T>
im_buffer< T >::~im_buffer ( )
inline

Definition at line 113 of file imbuffer.h.

References im_buffer< T >::insert(), im_buffer< T >::sort(), and x.

Member Function Documentation

◆ clear()

template<class T>
void im_buffer< T >::clear ( )
inline

Definition at line 169 of file imbuffer.h.

References im_buffer< T >::reset(), and im_buffer< T >::shift_left().

◆ get_array()

template<class T>
T* im_buffer< T >::get_array ( ) const
inline

Definition at line 146 of file imbuffer.h.

References im_buffer< T >::save2str().

◆ get_buf_len()

template<class T>
unsigned long im_buffer< T >::get_buf_len ( ) const
inline

Definition at line 131 of file imbuffer.h.

◆ get_buf_maxlen()

template<class T>
unsigned long im_buffer< T >::get_buf_maxlen ( ) const
inline

Definition at line 128 of file imbuffer.h.

◆ get_item()

template<class T>
T im_buffer< T >::get_item ( unsigned long  i) const
inline

Definition at line 140 of file imbuffer.h.

References assert.

Referenced by im_buffer< T >::sort().

◆ insert() [1/2]

template<class T >
bool im_buffer< T >::insert ( T &  x)

Definition at line 226 of file imbuffer.h.

References assert, and x.

Referenced by im_buffer< T >::insert(), and im_buffer< T >::~im_buffer().

◆ insert() [2/2]

template<class T >
unsigned long im_buffer< T >::insert ( T *  x,
unsigned long  n 
)

Definition at line 248 of file imbuffer.h.

References assert, and im_buffer< T >::insert().

◆ is_empty()

template<class T>
bool im_buffer< T >::is_empty ( ) const
inline

Definition at line 137 of file imbuffer.h.

Referenced by im_buffer< T >::sort().

◆ is_full()

template<class T>
bool im_buffer< T >::is_full ( ) const
inline

Definition at line 134 of file imbuffer.h.

◆ print()

template<class T >
void im_buffer< T >::print ( ) const

Definition at line 403 of file imbuffer.h.

◆ print_range()

template<class T >
void im_buffer< T >::print_range ( ) const

Definition at line 362 of file imbuffer.h.

References assert, max, and min.

◆ reset() [1/2]

template<class T>
void im_buffer< T >::reset ( )
inline

Definition at line 159 of file imbuffer.h.

References NULL.

Referenced by im_buffer< T >::clear().

◆ reset() [2/2]

template<class T >
void im_buffer< T >::reset ( unsigned long  start,
unsigned long  n 
)

Definition at line 328 of file imbuffer.h.

References assert.

◆ save2str()

template<class T >
AMI_STREAM< T > * im_buffer< T >::save2str ( ) const

Definition at line 417 of file imbuffer.h.

References AMI_ERROR_NO_ERROR, assert, and AMI_STREAM< T >::write_item().

Referenced by im_buffer< T >::get_array().

◆ set_item()

template<class T>
void im_buffer< T >::set_item ( unsigned long  i,
T &  item 
)
inline

Definition at line 152 of file imbuffer.h.

References assert.

Referenced by im_buffer< T >::sort().

◆ shift_left()

template<class T >
void im_buffer< T >::shift_left ( unsigned long  n)

Definition at line 349 of file imbuffer.h.

References assert.

Referenced by im_buffer< T >::clear().

◆ sort()

template<class T >
void im_buffer< T >::sort ( )

Friends And Related Function Documentation

◆ operator<<

template<class T>
ostream& operator<< ( ostream &  s,
const im_buffer< T > &  b 
)
friend

Definition at line 181 of file imbuffer.h.


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