forked from dniklaus/debug-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDbgCliCommand.h
More file actions
48 lines (41 loc) · 1.65 KB
/
DbgCliCommand.h
File metadata and controls
48 lines (41 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
* DbgCliCommand.h
*
* Created on: 11.02.2015
* Author: niklausd
*/
#ifndef PLAT_DEBUG_CLI_DBGCLICOMMAND_H_
#define PLAT_DEBUG_CLI_DBGCLICOMMAND_H_
#include "DbgCliNode.h"
/**
* Composite Pattern: Abstract Command Class, acts as the leaf node of the tree, has to be implemented by the client.
*/
class DbgCli_Command: public DbgCli_Node
{
public: // abstract class - constructor must not be accessible
/**
* Constructor for a leaf node in the Command tree.
* @param parentNode Pointer to the parent node, to add the newly created command.
* @param nodeName Name of this node (this becomes a part of the command path / tree).
* @param helpText Help and usage string.
*/
DbgCli_Command(DbgCli_Node* parentNode, const char* nodeName, const char* helpText);
public:
/**
* Destructor.
*/
virtual ~DbgCli_Command();
/**
* Execute the debug command.
* Pure virtual method, to be implemented by the client application.
* @param argc number of elements in args
* @param args all arguments stored in an array
* @param idxToFirstArgToHandle Index to the first argument in args array to be handled as parameter (this is the first parameter to be passed to the method that gets called by this command)
*/
virtual void execute(unsigned int argc, const char** args, unsigned int idxToFirstArgToHandle);
private: // forbidden default functions
DbgCli_Command& operator= (const DbgCli_Command& src); // assignment operator
DbgCli_Command(const DbgCli_Command& src); // copy constructor
DbgCli_Command(); // default constructor
};
#endif /* PLAT_DEBUG_CLI_DBGCLICOMMAND_H_ */