Kernel SDK Developer's Guide > Creating Custom Commands
Creating Custom Commands

Kernel SDK allows host applications to create custom command objects and register them globally within the runtime environment. This allows an extension module to create commands that can be used by hosts.

Kernel maintains a global command stack of type OdEdCommandStack, that stores custom commands created by host applications. This command stack can be accessed via the odedRegCmds() function.

An OdEdCommandStack stores OdEdCommand objects. An OdEdCommand has a global name, local name, and group name. A global name is the non-localized version of the command name, while the local name represents the localized version. Group name is used as a mechanism to group sets of commands together within the stack, where they can be accessed by group using the OdEdCommandStack::newGroupIterator function. OdEdCommand also contains a virtual execute function, which is called to execute the command.

When a command is executed, it is passed an instance of OdEdCommandContext, which provides access to the current database, and to an I/O interface that can be used to implement interactive commands.

For more details, see the following topics:

Example of Creating a Custom Command

Registering a Custom Command

Invoking a Custom Command

Copyright © 2002 – 2020. Open Design Alliance. All rights reserved.