LSSTApplications  11.0-13-gbb96280,12.1.rc1,12.1.rc1+1,12.1.rc1+2,12.1.rc1+5,12.1.rc1+8,12.1.rc1-1-g06d7636+1,12.1.rc1-1-g253890b+5,12.1.rc1-1-g3d31b68+7,12.1.rc1-1-g3db6b75+1,12.1.rc1-1-g5c1385a+3,12.1.rc1-1-g83b2247,12.1.rc1-1-g90cb4cf+6,12.1.rc1-1-g91da24b+3,12.1.rc1-2-g3521f8a,12.1.rc1-2-g39433dd+4,12.1.rc1-2-g486411b+2,12.1.rc1-2-g4c2be76,12.1.rc1-2-gc9c0491,12.1.rc1-2-gda2cd4f+6,12.1.rc1-3-g3391c73+2,12.1.rc1-3-g8c1bd6c+1,12.1.rc1-3-gcf4b6cb+2,12.1.rc1-4-g057223e+1,12.1.rc1-4-g19ed13b+2,12.1.rc1-4-g30492a7
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
std::int64_t RecordId
Type used for unique IDs for records.
Definition: misc.h:20
static boost::shared_ptr< IdFactory > makeSource(RecordId expId, int reserved)
Return an IdFactory that includes another, fixed ID in the higher-order bits.
static boost::shared_ptr< IdFactory > makeSimple()
Return a simple IdFactory that simply counts from 1.
virtual RecordId operator()()=0
Return a new unique RecordId.
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
#define PTR(...)
Definition: base.h:41
virtual void notify(RecordId id)=0
Notify the IdFactory that the given ID has been used and must not be returned by operator().