Mercurial > hg > svcore
comparison base/ById.h @ 1753:d954dfccd922 by-id
Comments
author | Chris Cannam |
---|---|
date | Fri, 05 Jul 2019 16:55:20 +0100 |
parents | 6d09d68165a4 |
children | 0678bf772f82 |
comparison
equal
deleted
inserted
replaced
1752:6d09d68165a4 | 1753:d954dfccd922 |
---|---|
29 | 29 |
30 //!!! todo: docs | 30 //!!! todo: docs |
31 | 31 |
32 //!!! further possibilities: | 32 //!!! further possibilities: |
33 // | 33 // |
34 // - id can only be queried when an object is added to ById (maybe | |
35 // add() returns the id, and there is a ById::idOf, but the | |
36 // object has no public getId()) | |
37 // | |
38 // - get() returns a pointer wrapper that cannot be shared/copied | 34 // - get() returns a pointer wrapper that cannot be shared/copied |
39 // again by the caller (except by the usual C++ trickery) | 35 // again by the caller (except by the usual C++ trickery) |
40 // | 36 // |
41 // also to do: review how often we are calling getAs<...> when we | 37 // also to do: review how often we are calling getAs<...> when we |
42 // could just be using get | 38 // could just be using get |
39 | |
40 //!!! NB we still haven't solved the problem of what to do for a | |
41 //!!! user-initiated cancel of a transform | |
43 | 42 |
44 struct IdAlloc { | 43 struct IdAlloc { |
45 | 44 |
46 // The value NO_ID (-1) is never allocated | 45 // The value NO_ID (-1) is never allocated |
47 static const int NO_ID = -1; | 46 static const int NO_ID = -1; |