-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCommand.h
executable file
·71 lines (59 loc) · 2.26 KB
/
Command.h
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//------------------------------------------------------------------------------
/// Filename: Command.h
/// Description: Header for Base Class Command
/// Authors:
/// Ralph Ankele (0931953)
/// Tutor: Manuel Weber
/// Group: 24
/// Created: 08.09.2011
/// Last change: 25.09.2011
//------------------------------------------------------------------------------
#ifndef COMMAND_H_INCLUDED
#define COMMAND_H_INCLUDED
#include <string>
class Database;
class UserInterface;
class Command
{
private:
//----------------------------------------------------------------------------
/// Copy Constructor
/// Makes a copy of another Command Object.
/// @param source Original to copy.
Command(const Command& source);
//----------------------------------------------------------------------------
/// Assignment Operator
/// Used to assign one Command to another
/// @param source Original with values to copy.
Command &operator=(const Command& source);
protected:
//----------------------------------------------------------------------------
/// Connection to UserInterface
UserInterface* ui_;
//----------------------------------------------------------------------------
/// Connection to Database
Database *db_;
//----------------------------------------------------------------------------
/// Name of Command
std::string name_;
public:
//----------------------------------------------------------------------------
/// Constructor
/// @param ui Connection to UserInterface
/// @param db Connection to Database
Command(UserInterface *ui,
Database *db) : ui_(ui),
db_(db) {}
//----------------------------------------------------------------------------
/// Destructor
virtual ~Command() throw() {}
//----------------------------------------------------------------------------
/// This Function executes the Command
/// @return returns true if execute was correct
virtual bool execute() { return false;}
//----------------------------------------------------------------------------
/// Function getName()
/// @return The commands name
std::string getName() { return name_;}
};
#endif //COMMAND_H_INCLUDED