-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathAnd.h
51 lines (34 loc) · 991 Bytes
/
And.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
#ifndef _AND_H_
#define _AND_H_
#include "Condition.h"
class And : public Condition {
public:
CondVec conds;
And() {}
And( const And * a, Domain & d ) {
for ( unsigned i = 0; i < a->conds.size(); ++i )
conds.push_back( a->conds[i]->copy( d ) );
}
~And() {
for ( unsigned i = 0; i < conds.size(); ++i )
delete conds[i];
}
void print( std::ostream & s ) const {
for ( unsigned i = 0; i < conds.size(); ++i )
conds[i]->print( s );
}
void PDDLPrint( std::ostream & s, unsigned indent, const TokenStruct< std::string > & ts, Domain & d );
void parse( Filereader & f, TokenStruct< std::string > & ts, Domain & d );
void SHOPparse( Filereader & f, TokenStruct< std::string > & ts, Domain & d );
void add( Condition * cond ) {
conds.push_back( cond );
}
void addParams( int m, unsigned n ) {
for ( unsigned i = 0; i < conds.size(); ++i )
conds[i]->addParams( m, n );
}
Condition * copy( Domain & d ) {
return new And( this, d );
}
};
#endif