Regina Calculation Engine
Public Member Functions | List of all members
regina::CensusHits 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/census.h>

Public Member Functions

 CensusHits ()
 Constructs an empty set of hits. More...
 
 ~CensusHits ()
 Destroys this object and all of the individual CensusHit objects that it contains. More...
 
const CensusHitfirst () 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...
 
CensusHitIterator begin () const
 Returns an iterator at the beginning of this list of hits. More...
 
CensusHitIterator end () const
 Returns an iterator beyond the end of this list of hits. More...
 
void append (CensusHit *hit)
 Appends a new hit to the end of this list. More...
 
 CensusHits (const CensusHits &)=delete
 
CensusHitsoperator= (const CensusHits &)=delete
 

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 CensusHits object (which is essentially a linked list of individual CensusHit objects).

The simplest way to iterate through this list is using a C++11 range-based for loop:

for (const CensusHit* h : *hits) { ... }

In Python, you can treat this list as an iterable object:

hits = Census.lookup(...)
for h in hits:
...

If you wish to iterate through this list manually, you can begin by calling CensusHits::first(), which will return the first hit (or null if there are no hits at all). Then, for each individual hit, you can call CensusHit::next() to retrieve the next hit in the list (this will return null if no more hits were found).


The documentation for this class was generated from the following file:
regina::Census::lookup
static CensusHits * lookup(const Triangulation< 3 > &tri)
Searches for the given triangulation through all of Regina's in-built census databases.
regina::CensusHits::CensusHits
CensusHits()
Constructs an empty set of hits.
Definition: census.h:625

Copyright © 1999-2018, 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@maths.uq.edu.au).