VkCmdRegistry(3x) VkCmdRegistry(3x)
VkCmdRegistry - registry for named command classes
VkBase
#include <Vk/VkCmdRegistry.h>
A central location in which to register classes by name, for later
use by VkCmdManager or VkCmdFactory objects. See VkCmd for more
details.
Commands can be executed by name, provided the command registers
itself with the VkCmdRegistry, a globally available list that links
unique names to a mechanism for creating command objects. Once
registered, a command can be invoked by the VkCmdManager by name:
cmdManager->run("CutCommand");
To participate in this scheme, commands must register themselves.
This is made easy by two macros. The class record should include the
line:
VK_CMD_DECLARE;
in the public portion of the class record, and also include the
line:
VK_CMD_IMPLEMENT(ClassName, "ClassName");
somewhere in the source file. The first argument is the class name,
while the second is a unique identifier for this command, which is
usually the class name as well.
Before the first time the class is used, the program must call:
Page 1
VkCmdRegistry(3x) VkCmdRegistry(3x)
ClassName::initClass();
where ClassName is the same of the class. In the future, the should
be a class that is able to extract and invoke the initClass() method
from a DSO, allowing for "plugin" commands.
/usr/share/src/ViewKit/Commands/ByName/
/usr/share/src/ViewKit/Commands/Factories/
/usr/share/src/ViewKit/Commands/Factory/
VkCmd, VkCmdManager
ViewKit Programmer's Guide
The X Window System, DEC Press, Bob Sheifler and Jim Gettys
The X Window System Toolkit, DEC Press, Paul Asente and Ralph Swick
The OSF/Motif Programmers Reference, Prentice Hall, OSF
PPPPaaaaggggeeee 2222 [ Back ]
|