-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathWhen.h
53 lines (35 loc) · 962 Bytes
/
When.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
#ifndef _WHEN_H_
#define _WHEN_H_
#include "Condition.h"
class When : public Condition {
public:
Condition *pars, *cond;
When()
: pars( 0 ), cond( 0 ) {}
When( const When * w, Domain & d )
: pars( 0 ), cond( 0 ) {
if ( w->pars ) pars = w->pars->copy( d );
if ( w->cond ) cond = w->cond->copy( d );
}
~When() {
if ( pars ) delete pars;
if ( cond ) delete cond;
}
void print( std::ostream & s ) const {
s << "WHEN:\n";
if ( pars ) pars->print( s );
if ( cond ) cond->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 ) {
pars->addParams( m, n );
cond->addParams( m, n );
}
Condition * copy( Domain & d ) {
return new When( this, d );
}
};
#endif