[Mobies-commit] [commit] r3636 - in UDM/trunk: doc include samples/CreateLampModel src/UdmBase

endre at redhat1.isis.vanderbilt.edu endre at redhat1.isis.vanderbilt.edu
Mon Feb 14 09:38:27 CST 2011


Author: endre
Date: Mon Feb 14 09:38:27 2011
New Revision: 3636

Log:
updated documentation, additional comments

Modified:
   UDM/trunk/doc/UDMAPI.doc
   UDM/trunk/include/UdmBase.h
   UDM/trunk/samples/CreateLampModel/CreateLampModel.cpp
   UDM/trunk/src/UdmBase/UdmTomi.cpp

Modified: UDM/trunk/doc/UDMAPI.doc
==============================================================================
Binary file (source and/or target). No diff available.

Modified: UDM/trunk/include/UdmBase.h
==============================================================================
--- UDM/trunk/include/UdmBase.h	Tue Feb  8 15:18:19 2011	(r3635)
+++ UDM/trunk/include/UdmBase.h	Mon Feb 14 09:38:27 2011	(r3636)
@@ -3102,6 +3102,10 @@
 		Object getInstantiatedObjectInPrimarilyDerivedBlock(const Udm::Object &where) const;
 
 
+		//checks if the object is a reference object. 
+		//if so, and it's not an empty reference, returns the referred object
+		//Note: References in UDM does not really exist, it's merely an MGA concept.
+		//in UDM references are emulated with associations with rolename "ref" at the referenced object
 		Object getReferencedObject(const string refrole = "ref") const;
 
 

Modified: UDM/trunk/samples/CreateLampModel/CreateLampModel.cpp
==============================================================================
--- UDM/trunk/samples/CreateLampModel/CreateLampModel.cpp	Tue Feb  8 15:18:19 2011	(r3635)
+++ UDM/trunk/samples/CreateLampModel/CreateLampModel.cpp	Mon Feb 14 09:38:27 2011	(r3636)
@@ -20,137 +20,6 @@
 
 using namespace LampDiagram;
 
-void myDisplay(char *msg)
-{
-    fprintf(stdout,"myDisplay: %s",msg);
-}
-
-
-#define CLINE "-Ic:\\EiC\\include -D_EiC"
-
-int main_regtest(int argc, char *argv[])
-{
-	/*
-	*	Test code for interpreted UDM (Cint and Eic).
-	*	The only argument is the name of the file, which will be used to create 
-	*	the DataNetwork.
-	*
-	*/
-	if(argc < 2) 
-	{
-			cout << "Usage: CreateLampModel <UdmBackEnd file(lamp to be created in)>\n";
-			return -1;
-	}
-	try 
-	{
-		Udm::SmartDataNetwork nw(diagram);
-
-		nw.CreateNew(argv[1],"LampDiagram", RootFolder::meta, Udm::CHANGES_PERSIST_ALWAYS);
-
-		{
-			RootFolder rrr = RootFolder::Cast(nw.GetRootObject());
-			Lamp lamp = Lamp::Create(rrr);
-			lamp.name() = "Host Lamp ";
-			lamp.ModelName() = "Seqeunce tester lamp";
-
-			unsigned long dn_id = lamp.__impl()->__getdn()->uniqueId();
-			unsigned long o_id = lamp.uniqueId();
-
-			Bulb bulb = Bulb::Create(lamp);
-			bulb.Wattage() = 10;
-			bulb.Voltage() = 20;
-
-
-			//should be empty string
-			cout << (string) lamp.RegAttr() << endl;
-
-			rrr.RegAttr() = "regHello!";
-			lamp.RegAttr() = "lampreg!";
-
-			//unsigned long bo_id = bulb.uniqueId();
-
-
-			cout << (string) rrr.RegAttr() << endl;
-			cout << (string) lamp.RegAttr() << endl;
-
-			cout << "end" << endl;
-/* 
-//EIC Test code
-			eic_init(CLINE, myDisplay);
-			eic_add_object(lamp, "host_lamp");
-
-
-			//code 
-			EIC_BOOL res = EIC_FALSE;
-			EiC_parseString("char err[100]; bool res @ %ld; double i;", &res);
-
-			EiC_parseString("res = SetStringAttribute(%d, %d, \"name\", \"EiC rulez\");", dn_id, o_id);
-			EiC_parseString("if(res) printf(\"Operation SetStringAttr OK!\\n\");");
-
-			EiC_parseString("res = GetStringAttribute(%d, %d, \"name\", err);", dn_id, o_id);
-			EiC_parseString("if(res) printf(\"Operation GetStringAttr OK!: %%s\\n\", err);");
-
-			EiC_parseString("res = GetRealAttribute(%d, %d, \"Wattage\", &i);", dn_id, bo_id);
-			EiC_parseString("if(res) printf(\"Operation GetRealAttr OK!: %%lf\\n\", i);");
-
-			EiC_parseString("res = SetRealAttribute(%d, %d, \"Wattage\", 3.1415926535);", dn_id, bo_id);
-			EiC_parseString("if(res) printf(\"Operation SetRealAttr OK!: %%lf\\n\", i);");
-
-			EiC_parseString("res = GetRealAttribute(%d, %d, \"Wattage\", &i);", dn_id, bo_id);
-			EiC_parseString("if(res) printf(\"Operation GetRealAttr OK!: %%lf\\n\", i);");
-			
-			eic_ipretter();
-
-
-			EiC_parseString("res = GetStrVal(host_lamp,\"name\", err);", dn_id, o_id);
-			EiC_parseString("if(res) printf(\"Operation GetStrVal on host_lamp OK!: %%s\\n\", err);");
-
-			EiC_parseString("res = GetLastError(err);");
-			EiC_parseString("if(res) printf(\"%%s\", err);");
-*/
-			/*
-			//Cint testcode with a UdmPseudoObject created in interpreted context
-			cint_init(NULL, myDisplay);
-			cint_add_object(lamp,"host_lamp");
-
-			string code = "host_lamp.SetStrVal(\"name\",\"cint also rulez!\");";
-			//cint_ipretter();
-			cint_int_calc(code);
-			
-
-			//Cint testcode with a UdmPseudoObject created in compiled context
-			
-			cint_init(NULL, myDisplay);
-			UdmPseudoObject pseudo_lamp(dn_id, o_id);
-
-			char code[200];
-			sprintf(code, "UdmPseudoObject * p_pseudo_lamp = (UdmPseudoObject *) %p;\n", &pseudo_lamp);
-			cint_int_eval(code);
-			//sprintf(code, "UdmPseudoObject pseudo_lamp = *p_pseudo_lamp;\n");
-			//cint_int_eval(code);
-			sprintf(code,"p_pseudo_lamp->SetStrVal(\"name\",\"cint also rulez!\");");
-			cint_int_eval(code);
-
-			cout << (string) lamp.name() << endl;
-			*/
-		
-	
-		}
-
-
-	}
-
-	catch(udm_exception &e)
-	{
-		cout << "exception: " << e.what() << endl;
-		return -1;
-	}
-	return 0;
-}
-
-
-
-
 int main_dom_string (int argc, char * argv[])
 {
 	string xml_xsd = 

Modified: UDM/trunk/src/UdmBase/UdmTomi.cpp
==============================================================================
--- UDM/trunk/src/UdmBase/UdmTomi.cpp	Tue Feb  8 15:18:19 2011	(r3635)
+++ UDM/trunk/src/UdmBase/UdmTomi.cpp	Mon Feb 14 09:38:27 2011	(r3636)
@@ -1860,7 +1860,7 @@
 	return getInstantiatedObjectInTree(derived_block);
 };
 
-//checks if the objects is a reference object. 
+//checks if the object is a reference object. 
 //if so, and it's not an empty reference, returns the referred object
 //Note: References in UDM does not really exist, it's merely an MGA concept.
 //in UDM references are emulated with associations with rolename "ref" at the referenced object


More information about the Mobies-commit mailing list