-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathOr.h
50 lines (34 loc) · 970 Bytes
/
Or.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
#ifndef _OR_H_
#define _OR_H_
#include "Condition.h"
class Or : public Condition {
public:
Condition *first, *second;
Or()
: first( 0 ), second( 0 ) {}
Or( const Or * o, Domain & d )
: first( 0 ), second( 0 ) {
if ( o->first ) first = o->first->copy( d );
if ( o->second ) second = o->second->copy( d );
}
~Or() {
if ( first ) delete first;
if ( second ) delete second;
}
void print( std::ostream & s ) const {
s << "OR:\n";
if ( first ) first->print( s );
if ( second ) second->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 addParams( int m, unsigned n ) {
first->addParams( m, n );
second->addParams( m, n );
}
Condition * copy( Domain & d ) {
return new Or( this, d );
}
};
#endif