LSSTApplications  11.0-13-gbb96280,12.1+18,12.1+7,12.1-1-g14f38d3+72,12.1-1-g16c0db7+5,12.1-1-g5961e7a+84,12.1-1-ge22e12b+23,12.1-11-g06625e2+4,12.1-11-g0d7f63b+4,12.1-19-gd507bfc,12.1-2-g7dda0ab+38,12.1-2-gc0bc6ab+81,12.1-21-g6ffe579+2,12.1-21-gbdb6c2a+4,12.1-24-g941c398+5,12.1-3-g57f6835+7,12.1-3-gf0736f3,12.1-37-g3ddd237,12.1-4-gf46015e+5,12.1-5-g06c326c+20,12.1-5-g648ee80+3,12.1-5-gc2189d7+4,12.1-6-ga608fc0+1,12.1-7-g3349e2a+5,12.1-7-gfd75620+9,12.1-9-g577b946+5,12.1-9-gc4df26a+10
LSSTDataManagementBasePackage
IdFactory.h
Go to the documentation of this file.
1 // -*- lsst-c++ -*-
2 #ifndef AFW_TABLE_IdFactory_h_INCLUDED
3 #define AFW_TABLE_IdFactory_h_INCLUDED
4 
5 #include <memory>
6 
7 #include "lsst/base.h"
8 #include "lsst/afw/table/misc.h"
9 
10 namespace lsst { namespace afw { namespace table {
11 
19 class IdFactory {
20 public:
21 
23  virtual RecordId operator()() = 0;
24 
26  virtual void notify(RecordId id) = 0;
27 
29  virtual PTR(IdFactory) clone() const = 0;
30 
36  static PTR(IdFactory) makeSimple();
37 
49  static PTR(IdFactory) makeSource(RecordId expId, int reserved);
50 
51  virtual ~IdFactory() {}
52 
53 private:
54 
55  // Protected to prevent slicing.
56  void operator=(IdFactory const & other) {}
57 
58 };
59 
60 }}} // namespace lsst::afw::table
61 
62 #endif // !AFW_TABLE_IdFactory_h_INCLUDED
static boost::shared_ptr< IdFactory > makeSimple()
Return a simple IdFactory that simply counts from 1.
std::int64_t RecordId
Type used for unique IDs for records.
Definition: misc.h:20
void operator=(IdFactory const &other)
Definition: IdFactory.h:56
virtual boost::shared_ptr< IdFactory > clone() const =0
Deep-copy the IdFactory.
A polymorphic functor base class for generating record IDs for a table.
Definition: IdFactory.h:19
virtual void notify(RecordId id)=0
Notify the IdFactory that the given ID has been used and must not be returned by operator().
#define PTR(...)
Definition: base.h:41
Basic LSST definitions.
static boost::shared_ptr< IdFactory > makeSource(RecordId expId, int reserved)
Return an IdFactory that includes another, fixed ID in the higher-order bits.
virtual RecordId operator()()=0
Return a new unique RecordId.