My Project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 350 of file template.cpp.

Constructor & Destructor Documentation

TemplateListConstIterator::TemplateListConstIterator ( const TemplateList l)
inline

Definition at line 353 of file template.cpp.

References m_index.

: m_list(l) { m_index=-1; }
virtual TemplateListConstIterator::~TemplateListConstIterator ( )
inlinevirtual

Definition at line 354 of file template.cpp.

{}

Member Function Documentation

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

Implements TemplateListIntf::ConstIterator.

Definition at line 385 of file template.cpp.

References m_it.

{
if (m_index<0 || m_it==m_list.p->elems.end())
{
return FALSE;
}
else
{
v = *m_it;
return TRUE;
}
}
virtual void TemplateListConstIterator::toFirst ( )
inlinevirtual

Moves iterator to the first element in the list

Implements TemplateListIntf::ConstIterator.

Definition at line 355 of file template.cpp.

References TemplateList::Private::elems, m_index, m_it, m_list, and TemplateList::p.

{
m_it = m_list.p->elems.begin();
}
virtual void TemplateListConstIterator::toLast ( )
inlinevirtual

Moves iterator to the last element in the list

Implements TemplateListIntf::ConstIterator.

Definition at line 360 of file template.cpp.

References TemplateList::count(), TemplateList::Private::elems, m_index, m_it, m_list, and TemplateList::p.

{
m_it = m_list.p->elems.fromLast();
}
virtual void TemplateListConstIterator::toNext ( )
inlinevirtual

Moves iterator to the next element in the list

Implements TemplateListIntf::ConstIterator.

Definition at line 365 of file template.cpp.

References TemplateList::Private::elems, m_index, m_it, m_list, and TemplateList::p.

{
if (m_it!=m_list.p->elems.end())
{
++m_it;
}
}
virtual void TemplateListConstIterator::toPrev ( )
inlinevirtual

Moves iterator to the previous element in the list

Implements TemplateListIntf::ConstIterator.

Definition at line 373 of file template.cpp.

References m_index, and m_it.

{
if (m_index>0)
{
--m_it;
}
else
{
m_index=-1;
}
}

Member Data Documentation

int TemplateListConstIterator::m_index
private

Definition at line 401 of file template.cpp.

Referenced by TemplateListConstIterator(), toFirst(), toLast(), toNext(), and toPrev().

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

Definition at line 400 of file template.cpp.

Referenced by current(), toFirst(), toLast(), toNext(), and toPrev().

const TemplateList& TemplateListConstIterator::m_list
private

Definition at line 399 of file template.cpp.

Referenced by toFirst(), toLast(), and toNext().


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