00001 #include <typeinfo> 00002 #include "simpleprocess.h" 00003 using namespace std; 00004 00005 Ast& SimpleProcess::operator = (const Ast& ast) { 00006 const SimpleProcess& simpleProcess = dynamic_cast<const SimpleProcess&>(ast); 00007 00008 Process::operator=(ast); 00009 this->identifier = simpleProcess.identifier ? dynamic_cast<Identifier*>(&(simpleProcess.identifier->clone())) : 0; 00010 this->declaration = simpleProcess.declaration ? dynamic_cast<Declaration*>(&(simpleProcess.declaration->clone())) : 0; 00011 this->action = simpleProcess.action ? dynamic_cast<Action*>(&(simpleProcess.action->clone())) : 0; 00012 this->server = simpleProcess.server; 00013 00014 return *(this); 00015 } 00016 00017 bool SimpleProcess::operator == (const Ast& ast) const { 00018 bool result = false; 00019 const SimpleProcess& simpleProcess = dynamic_cast<const SimpleProcess&>(ast); 00020 00021 if (typeid(ast) != typeid(SimpleProcess)) 00022 return false; 00023 00024 if (this->identifier && this->declaration && this->action) 00025 result = (*(this->identifier) == *(simpleProcess.identifier) && 00026 *(this->declaration) == *(simpleProcess.declaration) && 00027 *(this->action) == *(simpleProcess.action) && 00028 this->server == simpleProcess.server); 00029 00030 return result && Process::operator==(ast); 00031 } 00032