-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathOneof.h
53 lines (35 loc) · 1013 Bytes
/
Oneof.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 _ONEOF_H_
#define _ONEOF_H_
#include "Condition.h"
class Oneof : public Condition {
public:
CondVec conds;
Oneof() {}
Oneof( const Oneof * o, Domain & d ) {
for ( unsigned i = 0; i < o->conds.size(); ++i )
conds.push_back( o->conds[i]->copy( d ) );
}
~Oneof() {
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 Oneof( this, d );
}
};
#endif