summaryrefslogtreecommitdiff
path: root/src/theory
diff options
context:
space:
mode:
authorDejan Jovanović <dejan@cs.nyu.edu>2012-12-21 19:08:26 -0500
committerDejan Jovanović <dejan@cs.nyu.edu>2012-12-21 19:08:26 -0500
commitd1cd7732b17b280ad17d12a84399ff05cd1d77c4 (patch)
tree3e87311558c4d845c97ffdaad42cd748ddf6febf /src/theory
parent3614e4664567cfdb5fcbec0efe45e279369aba86 (diff)
adding copy constructor for the datatype enumerator
fixes bug 484
Diffstat (limited to 'src/theory')
-rw-r--r--src/theory/datatypes/type_enumerator.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/theory/datatypes/type_enumerator.h b/src/theory/datatypes/type_enumerator.h
index d8557fcaf..2a14d7fba 100644
--- a/src/theory/datatypes/type_enumerator.h
+++ b/src/theory/datatypes/type_enumerator.h
@@ -57,6 +57,7 @@ class DatatypesEnumerator : public TypeEnumeratorBase<DatatypesEnumerator> {
}
}
+
public:
DatatypesEnumerator(TypeNode type) throw() :
@@ -91,6 +92,25 @@ public:
newEnumerators();
}
+ DatatypesEnumerator(const DatatypesEnumerator& other) :
+ TypeEnumeratorBase<DatatypesEnumerator>(other.getType()),
+ d_datatype(other.d_datatype),
+ d_ctor(other.d_ctor),
+ d_zeroCtor(other.d_zeroCtor),
+ d_argEnumerators(NULL) {
+
+ if (other.d_argEnumerators != NULL) {
+ d_argEnumerators = new TypeEnumerator*[d_datatype[d_ctor].getNumArgs()];
+ for(size_t a = 0; a < d_datatype[d_ctor].getNumArgs(); ++a) {
+ if (other.d_argEnumerators[a] != NULL) {
+ d_argEnumerators[a] = new TypeEnumerator(*other.d_argEnumerators[a]);
+ } else {
+ d_argEnumerators[a] = NULL;
+ }
+ }
+ }
+ }
+
~DatatypesEnumerator() throw() {
deleteEnumerators();
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback