[GME-commit] GMESRC/Paradigms/MetaGME/MetaInterpreter2004/Rep AttributeRep.cpp,1.6,1.7

gme-commit at list.isis.vanderbilt.edu gme-commit at list.isis.vanderbilt.edu
Thu Oct 21 12:18:24 CDT 2004


Update of /var/lib/gme/GMESRC/Paradigms/MetaGME/MetaInterpreter2004/Rep
In directory braindrain:/tmp/cvs-serv21769

Modified Files:
	AttributeRep.cpp 
Log Message:
Handling empty EnumAttrs. Write error messages.


CVS User: zolmol

Index: AttributeRep.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/MetaInterpreter2004/Rep/AttributeRep.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** AttributeRep.cpp	30 Jul 2004 00:10:23 -0000	1.6
--- AttributeRep.cpp	21 Oct 2004 16:18:21 -0000	1.7
***************
*** 192,195 ****
--- 192,199 ----
  	}
  
+ 	if( m_noOfItems == 0)
+ 		global_vars.err << MSG_ERROR << "Error: No enumeration items found. Please check: " << getPtr() << ".\n";
+ 
+ 	bool filled_def_item = m_ptr->getAttribute( "DefaultItem")->getStatus() >= BON::AS_Here;
  	std::string def_item = Dumper::xmlFilter( m_ptr->getAttribute("DefaultItem")->getStringValue());
  
***************
*** 202,206 ****
  	}
  
! 	if (found) m_noOfDefault = i;
  
  	return true;
--- 206,213 ----
  	}
  
! 	if (found)
! 		m_noOfDefault = i;
! 	else if( filled_def_item)
! 		global_vars.err << MSG_ERROR << "Error: Default enumitem not found among enumerated items at " << getPtr() << ".\n";
  
  	return true;
***************
*** 215,219 ****
  	std::string m_ref = getMetaRef( owner);
  	mmm += indStr() + "<attrdef name=\"" + getName() + "\" metaref = \"" + m_ref +"\" valuetype = \"enum\" defvalue = \"";
! 	mmm += m_itemsVal[m_noOfDefault];
  	mmm += "\">\n";
  	
--- 222,230 ----
  	std::string m_ref = getMetaRef( owner);
  	mmm += indStr() + "<attrdef name=\"" + getName() + "\" metaref = \"" + m_ref +"\" valuetype = \"enum\" defvalue = \"";
! 	if( m_noOfDefault < m_itemsVal.size())
! 		mmm += m_itemsVal[m_noOfDefault];
! 	else
! 		global_vars.err << MSG_ERROR << "Error: Default enumitem not found in vector of enumerated items. Please check: " << getPtr() << ".\n";
! 	
  	mmm += "\">\n";
  	



More information about the GME-commit mailing list