Its pretty close to this:
http://minorfs.wordpress.com/2013/01/18/raiicap-pattern-injected-singleton-alternative-for-c/
Basically if you consider a reference to an object of well designed class to be provide the
access control you need to implement any access control policy that actually makes sense, applying this pattern to anything other than the constructor does not seem to make that much sense.
So as the article states, if you use this key in conjunction with those constructors for what
access control might make sense, objects that represent significant parts of scares resources, that in C++ would generally be implemented as RAII objects, than the name RAIICap or RAII-Capability would indeed make sense.
http://www.eros-os.org/essays/capintro.html
Alternatively you could refer to it with a more general name like construct authority.
The implementation in the article is a bit to much main centered, that is, main needs to create all the authority keys. You can extend on it and make it more flexible by adding an additional public constructor for the key itself:
template <typename T>
class construct_authority {
public:
construct_authority(construct_authority<void> const&)
friend int main(int,char **);
private:
construct_authority(){}
};
That way main could delegate the key creation to other parts of the program.
Personally I think the RAIICap name is quite appropriate for the useful part of this pattern.
A while ago I proposed that this simple template above could be added to the standard library.
https://groups.google.com/a/isocpp.org/forum/#!topic/std-proposals/p_v-aYIvO1E
Unfortunately there are issues with the idea that there can be one main fingerprint that constitutes a computational root, so something like this apparently can't have a place in the standard library. Having said this, at least for the use with the constructor of RAII classes, this pattern seems to be quite useful.
Foo
to be able to delegate access to other classes (of course, delegation might be useful, depending on the circumstances). – Pillsbury