LSSTApplications  1.1.2+25,10.0+13,10.0+132,10.0+133,10.0+224,10.0+41,10.0+8,10.0-1-g0f53050+14,10.0-1-g4b7b172+19,10.0-1-g61a5bae+98,10.0-1-g7408a83+3,10.0-1-gc1e0f5a+19,10.0-1-gdb4482e+14,10.0-11-g3947115+2,10.0-12-g8719d8b+2,10.0-15-ga3f480f+1,10.0-2-g4f67435,10.0-2-gcb4bc6c+26,10.0-28-gf7f57a9+1,10.0-3-g1bbe32c+14,10.0-3-g5b46d21,10.0-4-g027f45f+5,10.0-4-g86f66b5+2,10.0-4-gc4fccf3+24,10.0-40-g4349866+2,10.0-5-g766159b,10.0-5-gca2295e+25,10.0-6-g462a451+1
LSSTDataManagementBasePackage
Public Member Functions | List of all members
lsst::ap::detail::VisitTracker Class Reference

Tracks a set of visits. More...

#include <ChunkManagerImpl.h>

Inheritance diagram for lsst::ap::detail::VisitTracker:
lsst::ap::detail::HashedSet< Visit, MAX_VISITS_IN_FLIGHT >

Public Member Functions

bool isValid (int const visitId) const
 
void print (std::ostream &os) const
 
void print (int const visitId, std::ostream &os) const
 
- Public Member Functions inherited from lsst::ap::detail::HashedSet< Visit, MAX_VISITS_IN_FLIGHT >
 HashedSet ()
 
Visitfind (int const id)
 Returns a pointer to the entry with the given identifier, or null if there is no such entry. More...
 
Visitconst * find (int const id) const
 Returns a pointer to the entry with the given identifier, or null if there is no such entry. More...
 
Visitinsert (int const id)
 
std::pair< Visit *, bool > findOrInsert (int const id)
 
bool erase (int const id)
 
int size () const
 
int space () const
 
Visitbegin ()
 
Visitconst * begin () const
 
Visitend ()
 
Visitconst * end () const
 

Detailed Description

Tracks a set of visits.

Definition at line 205 of file ChunkManagerImpl.h.

Member Function Documentation

bool lsst::ap::detail::VisitTracker::isValid ( int const  visitId) const

Returns true if the given visit is being tracked by this VisitTracker and has not been marked as failed.

Definition at line 356 of file ChunkManagerImpl.cc.

356  {
357  Visit const * v = this->find(visitId);
358  if (v == 0) {
359  return false;
360  }
361  return !v->failed();
362 }
Visit * find(int const id)
Returns a pointer to the entry with the given identifier, or null if there is no such entry...
void lsst::ap::detail::VisitTracker::print ( std::ostream &  os) const

Definition at line 364 of file ChunkManagerImpl.cc.

364  {
365  std::vector<int> v;
366  v.reserve(size());
367  Visit const * const e = end();
368  for (Visit const * beg = begin(); beg != e; ++beg) {
369  int const id = beg->getId();
370  if (id >= 0) {
371  v.push_back(id);
372  }
373  }
374  if (v.empty()) {
375  os << " No visits being tracked";
376  } else {
377  std::sort(v.begin(), v.end());
378  boost::format fmt(" visit %1% %|32t|: %2%\n");
379  for (std::vector<int>::const_iterator i = v.begin(); i != v.end(); ++i) {
380  Visit const * v = find(*i);
381  os << fmt % v->getId() % (v->failed() ? "failed" : "in-flight");
382  }
383  }
384  os << std::endl;
385 }
Visit * find(int const id)
Returns a pointer to the entry with the given identifier, or null if there is no such entry...
void lsst::ap::detail::VisitTracker::print ( int const  visitId,
std::ostream &  os 
) const

Definition at line 387 of file ChunkManagerImpl.cc.

387  {
388  Visit const * v = find(visitId);
389  boost::format fmt(" visit %1% %|32t|: %2%\n");
390  fmt % visitId;
391  if (v == 0) {
392  os << fmt % "not being tracked";
393  } else {
394  os << fmt % (v->failed() ? "failed" : "in-flight");
395  }
396  os << std::endl;
397 }
Visit * find(int const id)
Returns a pointer to the entry with the given identifier, or null if there is no such entry...

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