//===========================// //== This software is ==// //== (c)opyrighted in 1993 ==// //== by Chris Koeritz ==// //== cak0l@Virginia.EDU ==// //===========================// #include "outcome.h" #include "guards.h" //#include "tree_content.h" //#include outcome::outcome() {} outcome::~outcome() {} int outcome::well_formed() const { return FALSE; } /* byte *outcome::pack(int &size) const { if (!well_formed()) deadly_error(NAME, "pack", "outcome is not well formed."); int tree_size = 0; byte *packed_tree = preconditions->pack(tree_size); int packed_name_size = outcome_name.length() + 1; size = tree_size + sizeof(int) + packed_name_size; byte *to_return = new byte[size]; typed_copy(&packed_name_size, to_return, int); byte *to_stuff = to_return + sizeof(int); mcopy((char *)outcome_name, to_stuff, packed_name_size); to_stuff += packed_name_size; mcopy(packed_tree, to_stuff, tree_size); return to_return; } outcome *outcome_unpack(byte *packed_form) { int packed_name_size; typed_copy(packed_form, &packed_name_size, int); byte *stuffed = packed_form + sizeof(int); string unstuff((char *)stuffed); outcome *to_return = new outcome; to_return->outcome_name = unstuff; stuffed += packed_name_size; to_return->preconditions = zeno_tree_unpack(stuffed); if (!to_return->well_formed()) deadly_error(NAME, "outcome_unpack", "outcome is not well formed."); return to_return; } */ void outcome::print() const { cout << "[ outcome expression is: " << flush; characteristic_predicate::print(); cout << "]" << endl; }