Avogadro  1.1.0
Public Member Functions
Avogadro::IDList Class Reference

List mapping primitives and unique ids. More...

#include <idlist.h>

List of all members.

Public Member Functions

 IDList ()
 IDList (const IDList &other)
 IDList (const QList< Primitive * > &other)
 IDList (const PrimitiveList &other)
IDListoperator= (const IDList &other)
IDListoperator= (const QList< Primitive * > &other)
IDListoperator= (const PrimitiveList &other)
 ~IDList ()
QList< unsigned long > subList (Primitive::Type type) const
bool contains (const Primitive *p) const
void append (Primitive *p)
void removeAll (Primitive *p)
int size () const
bool isEmpty () const
int count (Primitive::Type type) const
int count () const
void clear ()

Detailed Description

List mapping primitives and unique ids.

Author:
Donald Ephraim Curtis

The IDList class is designed to hold a set of Primitive objects and keep them organized by type allowing groups of them to be retrieved in constant time.


Constructor & Destructor Documentation

Constructor(s)

References Avogadro::Primitive::LastType.

Deconstructor


Member Function Documentation

Add a primitive to the queue.

Parameters:
pprimitive to add

References Avogadro::Primitive::id().

Removes every primitive from the queue.

bool Avogadro::IDList::contains ( const Primitive p) const
Parameters:
pthe primitive to check if it is in any list
Returns:
true or false depending on whether p is in this list

References Avogadro::Primitive::id().

Parameters:
typethe type of primitives we're interested in
Returns:
the number of primitives for the given type

References Avogadro::Primitive::LastType.

int Avogadro::IDList::count ( ) const

effectively the same as size()

See also:
size()

References size().

bool Avogadro::IDList::isEmpty ( ) const
Returns:
!size()

References size().

Remove a primitive from the queue. If the parameter does not exist in the queue, nothing is removed.

Parameters:
pprimitive to remove

References Avogadro::Primitive::id().

int Avogadro::IDList::size ( ) const
Returns:
the total number of primitives in this queue

Referenced by count(), and isEmpty().

QList< unsigned long > Avogadro::IDList::subList ( Primitive::Type  type) const

Returns a list of primitives for a given type.

Parameters:
typethe type of primitives to retrieve, one of Primitive::Type
Returns:
a QList of pointers to Primitive objects

References Avogadro::Primitive::LastType.


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