|
stmm-input-doc
0.17.0
|
Template used to register capability classes. More...
Public Member Functions | |
| RegisterClass (const char *const &p0CapabilityClassId) noexcept | |
| Class registration constructor. More... | |
| ~RegisterClass () noexcept | |
| const Class & | getCapabilityClass () noexcept |
| Get the class of the registered type. More... | |
Template used to register capability classes.
In a subclass of Capability you want to register define (i.e. KeysCapability):
class KeysCapability : public Capability {
public:
...
static const char* const s_sClassId;
static const Capability::Class& getClass() { return s_oInstall.getCapabilityClass(); }
private:
static RegisterClass<KeysCapability> s_oInstall;
...
}
with the instantiation
const char* const KeysCapability::s_sClassId = "KeysCapability"; // this instance registers the class! Capability::RegisterClass<KeysCapability> KeysCapability::s_oInstall(s_sClassId);
Beware! No registered class should be subclass of another registered class!
|
inlineexplicitnoexcept |
Class registration constructor.
The class id must be a statically defined unique ascii string with length > 0.
| p0CapabilityClassId | The class id. Can't be nullptr. |
|
inlinenoexcept |
|
inlinenoexcept |
Get the class of the registered type.
1.8.13