Public Member Functions | Private Attributes | List of all members
TemplateListConstIterator Class Reference
Inheritance diagram for TemplateListConstIterator:
TemplateListIntf::ConstIterator

Public Member Functions

 TemplateListConstIterator (const TemplateList &l)
 
virtual ~TemplateListConstIterator ()
 
virtual void toFirst ()
 
virtual void toLast ()
 
virtual void toNext ()
 
virtual void toPrev ()
 
virtual bool current (TemplateVariant &v) const
 
- Public Member Functions inherited from TemplateListIntf::ConstIterator
virtual ~ConstIterator ()
 

Private Attributes

const TemplateListm_list
 
QValueList< TemplateVariant >::ConstIterator m_it
 
int m_index
 

Detailed Description

Definition at line 349 of file template.cpp.

Constructor & Destructor Documentation

TemplateListConstIterator::TemplateListConstIterator ( const TemplateList l)
inline

Definition at line 352 of file template.cpp.

352 : m_list(l) { m_index=-1; }
const TemplateList & m_list
Definition: template.cpp:398
virtual TemplateListConstIterator::~TemplateListConstIterator ( )
inlinevirtual

Definition at line 353 of file template.cpp.

353 {}

Member Function Documentation

virtual bool TemplateListConstIterator::current ( TemplateVariant v) const
inlinevirtual

Implements TemplateListIntf::ConstIterator.

Definition at line 384 of file template.cpp.

385  {
386  if (m_index<0 || m_it==m_list.p->elems.end())
387  {
388  v = TemplateVariant();
389  return FALSE;
390  }
391  else
392  {
393  v = *m_it;
394  return TRUE;
395  }
396  }
const bool FALSE
Definition: qglobal.h:370
QValueList< TemplateVariant >::ConstIterator m_it
Definition: template.cpp:399
Variant type which can hold one value of a fixed set of types.
Definition: template.h:90
const bool TRUE
Definition: qglobal.h:371
virtual void TemplateListConstIterator::toFirst ( )
inlinevirtual

Moves iterator to the first element in the list

Implements TemplateListIntf::ConstIterator.

Definition at line 354 of file template.cpp.

355  {
356  m_it = m_list.p->elems.begin();
357  m_index=0;
358  }
Private * p
Definition: template.h:399
QValueList< TemplateVariant > elems
Definition: template.cpp:307
QValueList< TemplateVariant >::ConstIterator m_it
Definition: template.cpp:399
Iterator begin()
Definition: qvaluelist.h:361
const TemplateList & m_list
Definition: template.cpp:398
virtual void TemplateListConstIterator::toLast ( )
inlinevirtual

Moves iterator to the last element in the list

Implements TemplateListIntf::ConstIterator.

Definition at line 359 of file template.cpp.

360  {
361  m_it = m_list.p->elems.fromLast();
362  m_index=m_list.count()-1;
363  }
Private * p
Definition: template.h:399
virtual int count() const
Definition: template.cpp:338
Iterator fromLast()
Definition: qvaluelist.h:365
QValueList< TemplateVariant > elems
Definition: template.cpp:307
QValueList< TemplateVariant >::ConstIterator m_it
Definition: template.cpp:399
const TemplateList & m_list
Definition: template.cpp:398
virtual void TemplateListConstIterator::toNext ( )
inlinevirtual

Moves iterator to the next element in the list

Implements TemplateListIntf::ConstIterator.

Definition at line 364 of file template.cpp.

365  {
366  if (m_it!=m_list.p->elems.end())
367  {
368  ++m_it;
369  ++m_index;
370  }
371  }
Private * p
Definition: template.h:399
Iterator end()
Definition: qvaluelist.h:363
QValueList< TemplateVariant > elems
Definition: template.cpp:307
QValueList< TemplateVariant >::ConstIterator m_it
Definition: template.cpp:399
const TemplateList & m_list
Definition: template.cpp:398
virtual void TemplateListConstIterator::toPrev ( )
inlinevirtual

Moves iterator to the previous element in the list

Implements TemplateListIntf::ConstIterator.

Definition at line 372 of file template.cpp.

373  {
374  if (m_index>0)
375  {
376  --m_it;
377  --m_index;
378  }
379  else
380  {
381  m_index=-1;
382  }
383  }
QValueList< TemplateVariant >::ConstIterator m_it
Definition: template.cpp:399

Member Data Documentation

int TemplateListConstIterator::m_index
private

Definition at line 400 of file template.cpp.

QValueList<TemplateVariant>::ConstIterator TemplateListConstIterator::m_it
private

Definition at line 399 of file template.cpp.

const TemplateList& TemplateListConstIterator::m_list
private

Definition at line 398 of file template.cpp.


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