-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConnector.h
More file actions
40 lines (30 loc) · 812 Bytes
/
Connector.h
File metadata and controls
40 lines (30 loc) · 812 Bytes
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
//
// Created by 沈敖 on 16/9/13.
//
#ifndef CONSTRAINT_CONNECTOR_H
#define CONSTRAINT_CONNECTOR_H
#include <string>
#include <set>
#include "Constraint.h"
#include <memory>
using namespace std;
class Connector {
private:
int value; //connector当前的value
string informant; //设置value的约束器名称
set<shared_ptr<Constraint>> constraints; //当前connector连接的约束器
public:
Connector();
int getValue();
void setValue(int newValue, string setter);
/**
* 通过检验informant是否为空来判断是否已经设定value
*/
bool hasValue();
/**
* 忘掉之前的值,只需将informant设置为空即可
*/
void forgetValue(string retractor);
void connect(Constraint *newConstraint);
};
#endif //CONSTRAINT_CONNECTOR_H