00001 /* 00002 * PROPRIETARY INFORMATION. This software is proprietary to 00003 * Side Effects Software Inc., and is not to be reproduced, 00004 * transmitted, or disclosed in any way without written permission. 00005 * 00006 * Produced by: 00007 * PROGRAMMER 00008 * Side Effects Software Inc. 00009 * 20 Maud St. 00010 * Toronto, Ontario, M5V 2M5 00011 * Canada 00012 * 416-366-4607 00013 * 00014 * NAME: Command Class for Command Library (C++) 00015 * 00016 * COMMENTS: This is the class for a general command. 00017 * Instansiating one of these will automatically install it 00018 * in the command manager. 00019 * The name, options, and help are not duplicated, so don't 00020 * pass in volatile data please. 00021 * 00022 */ 00023 00024 #ifndef __CMD_Command_H__ 00025 #define __CMD_Command_H__ 00026 00027 #include "CMD_API.h" 00028 class CMD_Args; 00029 00030 typedef void (*CMD_Callback)(CMD_Args &args); 00031 00032 class CMD_API CMD_Command { 00033 public: 00034 const char *getName() const { return myName; } 00035 const char *getOptions() const { return myOptions; } 00036 CMD_Callback &getCallback() { return myCallback; } 00037 00038 CMD_Command *getChainCommand() { return myChain; } 00039 const char *getDSOLocation() { return myDSOLocation; } 00040 bool isSafe() const { return myIsSafe; } 00041 protected: 00042 private: 00043 const char *myName; 00044 const char *myOptions; 00045 char *myDSOLocation; 00046 CMD_Callback myCallback; 00047 CMD_Command *myChain; 00048 int myIndex; // Index into command table 00049 bool myIsSafe; 00050 00051 CMD_Command(const char *n, const char *o, CMD_Callback c, bool is_safe); 00052 ~CMD_Command(); 00053 00054 friend class CMD_Manager; 00055 }; 00056 00057 CMD_API void CMDpythonCommandCallback(CMD_Args &args); 00058 00059 #endif
1.5.9