-
Notifications
You must be signed in to change notification settings - Fork 0
/
method.h
44 lines (40 loc) · 1.62 KB
/
method.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
#ifndef METHOD_H
#define METHOD_H
#include <unordered_map>
#include <QString>
#include "visibility.h"
class Method
{
public:
Method(QString const& mname);
Method(QString const& mname, QString const& rtype, Visibility visi, bool isconst, bool isvirtual, bool isstatic, bool isabstract);
~Method();
void add_args(QString const& arg_name, QString const& arg_type);
void rm_args(QString const& arg_name);
QString getArgsAsQString();
QString* getName() const {return name;}
QString* getReturntype() const {return returntype;}
Visibility getVisibility() const {return visibility;}
std::unordered_map<QString*,QString*> getArgs() const {return args;}
bool isConst() const {return const_;}
bool isVirtual() const {return virtual_;}
bool isStatic() const {return static_;}
bool isAbstract() const {return abstract_;}
void setName(QString const& new_) {name = new QString(new_);}
void setReturntype(QString const& new_) {returntype = new QString(new_);}
void setVisibility(Visibility new_) {visibility = new_;}
void setConst(bool new_) {const_ = new_;}
void setVirtual(bool new_) {virtual_ = new_;}
void setStatic(bool new_) {static_ = new_;}
void setAbstract(bool new_) {abstract_ = new_;}
protected:
QString* name;
QString* returntype;
Visibility visibility;
std::unordered_map<QString*,QString*> args;
bool const_;
bool virtual_;
bool static_;
bool abstract_;
};
#endif // METHOD_H