Regina Calculation Engine
Public Member Functions | List of all members
regina::NCensusHits Class Reference

Stores a list of "hits" indicating all the places in which a given triangulation has been located in Regina's various in-built census databases. More...

#include <census/ncensus.h>

Inheritance diagram for regina::NCensusHits:
regina::boost::noncopyable

Public Member Functions

 NCensusHits ()
 Constructs an empty set of hits. More...
 
 ~NCensusHits ()
 Destroys this object and all of the individual NCensusHit objects that it contains. More...
 
NCensusHitfirst () const
 Returns the first hit in this list. More...
 
size_t count () const
 Returns the total number of hits in this list. More...
 
bool empty () const
 Returns whether there are any hits at all. More...
 
void append (NCensusHit *hit)
 Appends a new hit to the end of this list. More...
 

Detailed Description

Stores a list of "hits" indicating all the places in which a given triangulation has been located in Regina's various in-built census databases.

A given triangulation might have several hits across Regina's databases (or even in the same database). The complete set of hits for a given triangulation is represented by a single NCensusHits object (which is essentially a linked list of individual NCensusHit objects). To iterate through this list, you begin by calling NCensusHits::first(), which will return the first hit (or 0 if there are no hits at all). Then, for each individual hit, you can call NCensusHit::next() to retrieve the next hit in the list (this will return 0 if no more hits were found).

Constructor & Destructor Documentation

regina::NCensusHits::NCensusHits ( )
inline

Constructs an empty set of hits.

regina::NCensusHits::~NCensusHits ( )
inline

Destroys this object and all of the individual NCensusHit objects that it contains.

Member Function Documentation

void regina::NCensusHits::append ( NCensusHit hit)
inline

Appends a new hit to the end of this list.

This list will take ownership of the given object.

Parameters
hitthe hit to append to this list.
size_t regina::NCensusHits::count ( ) const
inline

Returns the total number of hits in this list.

This routine is fast, since the number of hits is cached (it does not need to walk through the entire list to count).

Returns
the total number of hits.
bool regina::NCensusHits::empty ( ) const
inline

Returns whether there are any hits at all.

Returns
true if this list is empty (i.e., there are no hits), or false if the list is non-empty (i.e., there are one or more hits).
NCensusHit * regina::NCensusHits::first ( ) const
inline

Returns the first hit in this list.

To continue iterating, you can call NCensusHit::next() upon each individual hit to retrieve the next hit in the list.

Returns
the first hit, or 0 if there are no hits at all.

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

Copyright © 1999-2014, The Regina development team
This software is released under the GNU General Public License, with some additional permissions; see the source code for details.
For further information, or to submit a bug or other problem, please contact Ben Burton (bab@debian.org).