cppCompSetName
UseCase3
// COM1205 Propagation Pattern for DemDraw Project.
//
// Created by Young Soo Yang (yyang@ccs.neu.edu)
//
// This file contains 4 propagation patterns,
// cppCompEdgeName(), cppSetEdgeName(), cppCompVertName(), & cppSetVertName().
//
// They are called by other propagation patterns such as cppRenEdge(),
// cppRenVertex(), cppDelVertex(), cppDelAEdge(), & cppDelCEdge() that need
// to access label names of vertices and edges to check or reset the names
// of them.
//
// Modification History:
//
// 11/26/95 - Young Soo Yang (yyang@ccs.neu.edu)
// First created to support and make other propagation patterns more
// structure shy.
//
// This will compare a label name of a construction edge with the argument
// Labelname and returns 1 if they are same, otherwise, returns 0.
*operation* int cppCompEdgeName(char* Labelname)
*traverse*
*from* ConstEdge
*to* EdgeName
*wrapper* EdgeName
(@
DemIdent* argName = new DemIdent(Labelname);
if (this->get_name()->g_equal(argName))
return_val = 1;
else
return_val = 0;
argName->g_delete();
@)
// This will reset an edge name to the argument NewLabelname
*operation* void cppSetEdgeName(char* NewLabelname)
*traverse*
*from* ConstEdge
*to* EdgeName
*wrapper* EdgeName
(@
this->get_name()->g_delete();
this->set_name(new DemIdent(NewLabelname));
@)
// This will compare a label name of a vertex with the argument Labelname
// and returns 1 if they are same, otherwise, returns 0.
*operation* int cppCompVertName(char* Labelname)
*traverse*
*from* Vertex
*to* VertexName
*wrapper* VertexName
(@
DemIdent* argName = new DemIdent(Labelname);
if (this->get_name()->g_equal(argName))
return_val = 1;
else
return_val = 0;
argName->g_delete();
@)
// This will change a name of a vertex to the argument NewLabelname
*operation* void cppSetVertName(char* NewLabelname)
*traverse*
*from* Vertex
*to* VertexName
*wrapper* VertexName
(@
this->get_name()->g_delete();
this->set_name(new DemIdent(NewLabelname));
@)