bool TTconceptNode::createConcept(int mode, int conceptIndex, TTword *word) { TTconcept *newConcept = new TTconcept(word, ST_UNKNOWN_SCRIPT); TTconcept **conceptPP = setConcept(conceptIndex, newConcept); if (mode == 0 || (mode == 1 && !*conceptPP)) { delete *conceptPP; *conceptPP = newConcept; return false; } else { delete newConcept; return true; } }
int TTconceptNode::changeConcept(int mode, TTconcept **conceptPP, int conceptIndex) { TTconcept **newConceptPP = setConcept(conceptIndex, *conceptPP); if (mode == 0 || (mode == 1 && !*newConceptPP)) { if (!*conceptPP) return SS_5; delete *newConceptPP; *newConceptPP = new TTconcept(**conceptPP); return SS_VALID; } else { return SS_1; } }
int TTconceptNode::replaceConcept(int mode, int conceptIndex, TTconcept *concept) { TTconcept **conceptPP = setConcept(conceptIndex, concept); if (mode == 0 || (mode == 1 && !*conceptPP)) { if (!concept || !concept->isValid()) return SS_5; if (mode == 0 && *conceptPP) { delete *conceptPP; } *conceptPP = new TTconcept(*concept); return (*conceptPP)->isValid() ? SS_VALID : SS_11; } else { return SS_1; } }
void DLVertex :: Load ( SaveLoadManager& m ) { // now OP is already loaded switch ( Type() ) { case dtBad: case dtTop: // can't be S/L default: fpp_unreachable(); break; case dtAnd: { unsigned int size = m.loadUInt(); for ( unsigned int j = 0; j < size; ++j ) Child.push_back(m.loadSInt()); break; } case dtLE: Role = static_cast<const TRole*>(m.loadEntry()); setChild(m.loadSInt()); n = m.loadUInt(); break; case dtForall: Role = static_cast<const TRole*>(m.loadEntry()); setChild(m.loadSInt()); n = m.loadUInt(); break; case dtIrr: Role = static_cast<const TRole*>(m.loadEntry()); break; case dtPConcept: case dtNConcept: case dtPSingleton: case dtNSingleton: setConcept(m.loadEntry()); setChild(m.loadSInt()); break; case dtProj: setChild(m.loadSInt()); Role = static_cast<const TRole*>(m.loadEntry()); ProjRole = static_cast<const TRole*>(m.loadEntry()); break; case dtNN: // nothing to do break; case dtDataType: case dtDataValue: case dtDataExpr: setConcept(m.loadEntry()); setChild(m.loadSInt()); break; } }