You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by js...@apache.org on 2006/12/16 08:48:31 UTC
svn commit: r487770 [3/3] - in /incubator/tuscany/cpp/sca/runtime: core/src/
core/src/tuscany/sca/core/ core/src/tuscany/sca/model/
core/src/tuscany/sca/util/ extensions/cpp/src/osoa/sca/
extensions/cpp/src/tuscany/sca/cpp/ extensions/php/src/tuscany/s...
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/Utils.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/Utils.cpp?view=diff&rev=487770&r1=487769&r2=487770
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/Utils.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/Utils.cpp Fri Dec 15 23:48:29 2006
@@ -31,534 +31,537 @@
{
namespace sca
{
- void Utils::tokeniseUri(const string& uri, string& token1, string& token2)
+ namespace util
{
- tokeniseString("/", uri, token1, token2);
- }
-
- void Utils::tokeniseQName(const string& qname, string& uri, string& name)
- {
- tokeniseString("#", qname, uri, name);
- if (name == "")
+ void Utils::tokeniseUri(const string& uri, string& token1, string& token2)
{
- name = uri;
- uri = "";
+ tokeniseString("/", uri, token1, token2);
}
- }
-
- void Utils::tokeniseString(
- const string& separator,
- const string& str,
- string& token1,
- string& token2)
- {
- string::size_type sep = str.find(separator);
- if (sep != string::npos)
+
+ void Utils::tokeniseQName(const string& qname, string& uri, string& name)
{
- int l = separator.length();
- token1 = str.substr(0, sep);
- if ( (sep+l) < str.length())
+ tokeniseString("#", qname, uri, name);
+ if (name == "")
{
- token2 = str.substr(sep+l);
+ name = uri;
+ uri = "";
+ }
+ }
+
+ void Utils::tokeniseString(
+ const string& separator,
+ const string& str,
+ string& token1,
+ string& token2)
+ {
+ string::size_type sep = str.find(separator);
+ if (sep != string::npos)
+ {
+ int l = separator.length();
+ token1 = str.substr(0, sep);
+ if ( (sep+l) < str.length())
+ {
+ token2 = str.substr(sep+l);
+ }
+ else
+ {
+ token2 = "";
+ }
}
else
{
+ token1 = str;
token2 = "";
}
}
- else
- {
- token1 = str;
- token2 = "";
- }
- }
-
- void Utils::rTokeniseString(
- const string& separator,
- const string& str,
- string& token1,
- string& token2)
- {
- string::size_type sep = str.rfind(separator);
- if (sep != string::npos)
- {
- int l = separator.length();
- token1 = str.substr(0, sep);
- if ( (sep+l) < str.length())
- {
- token2 = str.substr(sep+l);
+
+ void Utils::rTokeniseString(
+ const string& separator,
+ const string& str,
+ string& token1,
+ string& token2)
+ {
+ string::size_type sep = str.rfind(separator);
+ if (sep != string::npos)
+ {
+ int l = separator.length();
+ token1 = str.substr(0, sep);
+ if ( (sep+l) < str.length())
+ {
+ token2 = str.substr(sep+l);
+ }
+ else
+ {
+ token2 = "";
+ }
}
else
{
- token2 = "";
+ token1 = "";
+ token2 = str;
}
}
- else
- {
- token1 = "";
- token2 = str;
- }
- }
-
- void Utils::breakpoint() {
- // dummy method used to set breakpoints
- }
-
- //////////////////////////////////////////////////////////////////////////
- // Print a DatObject tree
- //////////////////////////////////////////////////////////////////////////
- void Utils::tabs(int inc)
- {
- for (int ind=0; ind <inc; ind++)
- {
- cout << " ";
- }
- }
-
- const bool Utils::compareProperties(DataObjectPtr dataObject1, const Property& prop1, DataObjectPtr dataObject2, const Property& prop2, string& diff)
- {
- if(strcmp(prop1.getName(),prop2.getName()) != 0)
- {
- diff.append("Differing names for Properties:\n");
- diff.append(prop1.getName());
- diff.append("\n");
- diff.append(prop2.getName());
- return false;
- }
-
- const Type& propertyType1 = prop1.getType();
- const Type& propertyType2 = prop2.getType();
-
- if(strcmp(propertyType1.getName(), propertyType2.getName()) != 0 ||
- strcmp(propertyType1.getURI(),propertyType2.getURI()) != 0 )
- {
- diff.append("Differing types for Properties:\n");
- diff.append(propertyType1.getName());
- diff.append("#");
- diff.append(propertyType1.getURI());
- diff.append("\n");
- diff.append(propertyType2.getName());
- diff.append("#");
- diff.append(propertyType2.getURI());
- return false;
- }
- if (dataObject1->isSet(prop1) != dataObject2->isSet(prop2))
- {
- diff.append("Property ");
- diff.append(prop1.getName());
- diff.append(" is set on one DataObject but not the other");
- return false;
+
+ void Utils::breakpoint() {
+ // dummy method used to set breakpoints
}
-
- if (dataObject1->isSet(prop1))
+
+ //////////////////////////////////////////////////////////////////////////
+ // Print a DatObject tree
+ //////////////////////////////////////////////////////////////////////////
+ void Utils::tabs(int inc)
{
-
- if (prop1.isMany() != prop2.isMany())
+ for (int ind=0; ind <inc; ind++)
{
- diff.append("Property ");
+ cout << " ";
+ }
+ }
+
+ const bool Utils::compareProperties(DataObjectPtr dataObject1, const Property& prop1, DataObjectPtr dataObject2, const Property& prop2, string& diff)
+ {
+ if(strcmp(prop1.getName(),prop2.getName()) != 0)
+ {
+ diff.append("Differing names for Properties:\n");
diff.append(prop1.getName());
- diff.append(" is many on one DataObject but not the other");
+ diff.append("\n");
+ diff.append(prop2.getName());
+ return false;
+ }
+
+ const Type& propertyType1 = prop1.getType();
+ const Type& propertyType2 = prop2.getType();
+
+ if(strcmp(propertyType1.getName(), propertyType2.getName()) != 0 ||
+ strcmp(propertyType1.getURI(),propertyType2.getURI()) != 0 )
+ {
+ diff.append("Differing types for Properties:\n");
+ diff.append(propertyType1.getName());
+ diff.append("#");
+ diff.append(propertyType1.getURI());
+ diff.append("\n");
+ diff.append(propertyType2.getName());
+ diff.append("#");
+ diff.append(propertyType2.getURI());
return false;
}
- if (propertyType1.isDataType() != propertyType2.isDataType())
+ if (dataObject1->isSet(prop1) != dataObject2->isSet(prop2))
{
diff.append("Property ");
diff.append(prop1.getName());
- diff.append(" is dataType on one DataObject but not the other");
+ diff.append(" is set on one DataObject but not the other");
return false;
}
-
- //////////////////////////////////////////////////////////////////////
- // For a many-valued property get the list of values
- //////////////////////////////////////////////////////////////////////
- if (prop1.isMany())
- {
- DataObjectList& dol1 = dataObject1->getList(prop1);
- DataObjectList& dol2 = dataObject2->getList(prop2);
- if (dol1.size() != dol2.size())
+
+ if (dataObject1->isSet(prop1))
+ {
+
+ if (prop1.isMany() != prop2.isMany())
{
diff.append("Property ");
diff.append(prop1.getName());
- diff.append(" is many but has differing number of elements");
+ diff.append(" is many on one DataObject but not the other");
return false;
}
-
- for (unsigned int j = 0; j <dol1.size(); j++)
- {
-
- if (propertyType1.isDataType())
+ if (propertyType1.isDataType() != propertyType2.isDataType())
+ {
+ diff.append("Property ");
+ diff.append(prop1.getName());
+ diff.append(" is dataType on one DataObject but not the other");
+ return false;
+ }
+
+ //////////////////////////////////////////////////////////////////////
+ // For a many-valued property get the list of values
+ //////////////////////////////////////////////////////////////////////
+ if (prop1.isMany())
+ {
+ DataObjectList& dol1 = dataObject1->getList(prop1);
+ DataObjectList& dol2 = dataObject2->getList(prop2);
+ if (dol1.size() != dol2.size())
{
- if( strcmp(dol1.getCString(j), dol2.getCString(j)) != 0)
+ diff.append("Property ");
+ diff.append(prop1.getName());
+ diff.append(" is many but has differing number of elements");
+ return false;
+ }
+
+ for (unsigned int j = 0; j <dol1.size(); j++)
+ {
+
+ if (propertyType1.isDataType())
{
- diff.append("Differing value for Property ");
- diff.append(prop1.getName());
- diff.append("[");
- diff += ((int)j);
- diff.append("]:\n");
- diff.append(dol1.getCString(j));
- diff.append("\n");
- diff.append(dol2.getCString(j));
- return false;
+ if( strcmp(dol1.getCString(j), dol2.getCString(j)) != 0)
+ {
+ diff.append("Differing value for Property ");
+ diff.append(prop1.getName());
+ diff.append("[");
+ diff += ((int)j);
+ diff.append("]:\n");
+ diff.append(dol1.getCString(j));
+ diff.append("\n");
+ diff.append(dol2.getCString(j));
+ return false;
+ }
}
- }
- else
- {
- if(!compareDataObjects(dol1[j], dol2[j], diff))
+ else
{
- return false;
+ if(!compareDataObjects(dol1[j], dol2[j], diff))
+ {
+ return false;
+ }
}
}
- }
- } // end IsMany
-
-
- //////////////////////////////////////////////////////////////////////
- // For a primitive data type compare the values
- //////////////////////////////////////////////////////////////////////
- else if (propertyType1.isDataType())
- {
- if( strcmp(dataObject1->getCString(prop1), dataObject2->getCString(prop2)) != 0)
+ } // end IsMany
+
+
+ //////////////////////////////////////////////////////////////////////
+ // For a primitive data type compare the values
+ //////////////////////////////////////////////////////////////////////
+ else if (propertyType1.isDataType())
{
- diff.append("Differing value for Property ");
- diff.append(prop1.getName());
- diff.append(":\n");
- diff.append(dataObject1->getCString(prop1));
- diff.append("\n");
- diff.append(dataObject2->getCString(prop2));
- return false;
+ if( strcmp(dataObject1->getCString(prop1), dataObject2->getCString(prop2)) != 0)
+ {
+ diff.append("Differing value for Property ");
+ diff.append(prop1.getName());
+ diff.append(":\n");
+ diff.append(dataObject1->getCString(prop1));
+ diff.append("\n");
+ diff.append(dataObject2->getCString(prop2));
+ return false;
+ }
}
- }
-
- //////////////////////////////////////////////////////////////////////
- // For a dataobject compare the DOs
- //////////////////////////////////////////////////////////////////////
- else
- {
- if(!compareDataObjects(dataObject1->getDataObject(prop1), dataObject2->getDataObject(prop2), diff))
+
+ //////////////////////////////////////////////////////////////////////
+ // For a dataobject compare the DOs
+ //////////////////////////////////////////////////////////////////////
+ else
{
- return false;
+ if(!compareDataObjects(dataObject1->getDataObject(prop1), dataObject2->getDataObject(prop2), diff))
+ {
+ return false;
+ }
}
- }
- }
- return true;
- }
-
- const bool Utils::compareDataObjects(DataObjectPtr dataObject1, DataObjectPtr dataObject2, string& diff)
- {
- if (!dataObject1 || !dataObject2)
- {
- diff.append("Cannot compare null DataObjects");
- return false;
- }
-
- const Type& dataObject1Type = dataObject1->getType();
- const Type& dataObject2Type = dataObject2->getType();
-
- if( strcmp(dataObject1Type.getURI(), dataObject2Type.getURI()) != 0 ||
- strcmp(dataObject1Type.getName(), dataObject2Type.getName()) != 0 )
- {
- diff.append("DataObject Types differ:\n");
- diff.append(dataObject1Type.getURI());
- diff.append("#");
- diff.append(dataObject1Type.getName());
- diff.append("\n");
- diff.append(dataObject2Type.getURI());
- diff.append("#");
- diff.append(dataObject2Type.getName());
- return false;
- }
-
- //////////////////////////////////////////////////////////////////////////
- // Iterate over all the properties
- //////////////////////////////////////////////////////////////////////////
- PropertyList pl1 = dataObject1->getInstanceProperties();
- PropertyList pl2 = dataObject2->getInstanceProperties();
- if (pl1.size() != pl2.size())
- {
- diff.append("Differing number of properties");
- return false;
+ }
+ return true;
}
-
- if (pl1.size() != 0)
+
+ const bool Utils::compareDataObjects(DataObjectPtr dataObject1, DataObjectPtr dataObject2, string& diff)
{
- for (unsigned int i = 0; i < pl1.size(); i++)
+ if (!dataObject1 || !dataObject2)
{
- if(!compareProperties(dataObject1, pl1[i], dataObject2, pl2[i], diff))
- {
- return false;
- }
+ diff.append("Cannot compare null DataObjects");
+ return false;
}
- }
- else
- {
- if(dataObject1->getType().isOpenType() != dataObject2->getType().isOpenType() &&
- dataObject1->getType().isDataObjectType() != dataObject2->getType().isDataObjectType())
+
+ const Type& dataObject1Type = dataObject1->getType();
+ const Type& dataObject2Type = dataObject2->getType();
+
+ if( strcmp(dataObject1Type.getURI(), dataObject2Type.getURI()) != 0 ||
+ strcmp(dataObject1Type.getName(), dataObject2Type.getName()) != 0 )
{
- diff.append("DataObject is open & DO type on one but not the other");
+ diff.append("DataObject Types differ:\n");
+ diff.append(dataObject1Type.getURI());
+ diff.append("#");
+ diff.append(dataObject1Type.getName());
+ diff.append("\n");
+ diff.append(dataObject2Type.getURI());
+ diff.append("#");
+ diff.append(dataObject2Type.getName());
return false;
}
-
- // Compare elements under an open DataObject
- if(dataObject1->getType().isOpenType() && dataObject1->getType().isDataObjectType())
- {
- SequencePtr sequence1 = dataObject1->getSequence();
- SequencePtr sequence2 = dataObject2->getSequence();
-
- if (sequence1 != NULL && sequence2 != NULL)
+
+ //////////////////////////////////////////////////////////////////////////
+ // Iterate over all the properties
+ //////////////////////////////////////////////////////////////////////////
+ PropertyList pl1 = dataObject1->getInstanceProperties();
+ PropertyList pl2 = dataObject2->getInstanceProperties();
+ if (pl1.size() != pl2.size())
+ {
+ diff.append("Differing number of properties");
+ return false;
+ }
+
+ if (pl1.size() != 0)
+ {
+ for (unsigned int i = 0; i < pl1.size(); i++)
{
- if (sequence1->size() != sequence1->size())
+ if(!compareProperties(dataObject1, pl1[i], dataObject2, pl2[i], diff))
{
- diff.append("Open DataObjects have differing number of elements");
return false;
}
-
- for (unsigned int i = 0; i < sequence1->size(); i++)
+ }
+ }
+ else
+ {
+ if(dataObject1->getType().isOpenType() != dataObject2->getType().isOpenType() &&
+ dataObject1->getType().isDataObjectType() != dataObject2->getType().isDataObjectType())
+ {
+ diff.append("DataObject is open & DO type on one but not the other");
+ return false;
+ }
+
+ // Compare elements under an open DataObject
+ if(dataObject1->getType().isOpenType() && dataObject1->getType().isDataObjectType())
+ {
+ SequencePtr sequence1 = dataObject1->getSequence();
+ SequencePtr sequence2 = dataObject2->getSequence();
+
+ if (sequence1 != NULL && sequence2 != NULL)
{
- if (sequence1->isText(i) != sequence2->isText(i))
+ if (sequence1->size() != sequence1->size())
{
- diff.append("Open DataObjects have differing element types at position ");
- diff += ((int) i);
+ diff.append("Open DataObjects have differing number of elements");
return false;
}
- if (sequence1->isText(i))
- {
- if( strcmp(sequence1->getCStringValue(i), sequence2->getCStringValue(i)) != 0)
+
+ for (unsigned int i = 0; i < sequence1->size(); i++)
+ {
+ if (sequence1->isText(i) != sequence2->isText(i))
{
- diff.append("Differing value for element at position ");
+ diff.append("Open DataObjects have differing element types at position ");
diff += ((int) i);
- diff.append(":\n");
- diff.append(sequence1->getCStringValue(i));
- diff.append("\n");
- diff.append(sequence2->getCStringValue(i));
return false;
}
- }
- else
- {
- const Property& p1 = sequence1->getProperty(i);
- const Property& p2 = sequence2->getProperty(i);
-
- if(!compareProperties(dataObject1, p1, dataObject2, p2, diff))
+ if (sequence1->isText(i))
+ {
+ if( strcmp(sequence1->getCStringValue(i), sequence2->getCStringValue(i)) != 0)
+ {
+ diff.append("Differing value for element at position ");
+ diff += ((int) i);
+ diff.append(":\n");
+ diff.append(sequence1->getCStringValue(i));
+ diff.append("\n");
+ diff.append(sequence2->getCStringValue(i));
+ return false;
+ }
+ }
+ else
{
- return false;
+ const Property& p1 = sequence1->getProperty(i);
+ const Property& p2 = sequence2->getProperty(i);
+
+ if(!compareProperties(dataObject1, p1, dataObject2, p2, diff))
+ {
+ return false;
+ }
}
}
}
}
}
- }
-
- return true;
- }
- void Utils::printDO(DataObjectPtr dataObject, int increment)
- {
- int inc=increment;
- if (!dataObject)
- return;
- const Type& dataObjectType = dataObject->getType();
- tabs(inc);
- cout << "DataObject type: " << dataObjectType.getURI()<< "#" << dataObjectType.getName() << endl;
- inc++;
-
- //////////////////////////////////////////////////////////////////////////
- // Iterate over all the properties
- //////////////////////////////////////////////////////////////////////////
- PropertyList pl = dataObject->getInstanceProperties();
- if (pl.size() != 0)
+ return true;
+ }
+
+ void Utils::printDO(DataObjectPtr dataObject, int increment)
{
- for (unsigned int i = 0; i < pl.size(); i++)
+ int inc=increment;
+ if (!dataObject)
+ return;
+ const Type& dataObjectType = dataObject->getType();
+ tabs(inc);
+ cout << "DataObject type: " << dataObjectType.getURI()<< "#" << dataObjectType.getName() << endl;
+ inc++;
+
+ //////////////////////////////////////////////////////////////////////////
+ // Iterate over all the properties
+ //////////////////////////////////////////////////////////////////////////
+ PropertyList pl = dataObject->getInstanceProperties();
+ if (pl.size() != 0)
{
- tabs(inc);
- cout << "Property: " << pl[i].getName() << endl;
-
- const Type& propertyType = pl[i].getType();
-
- tabs(inc);
- cout << "Property Type: " << propertyType.getURI()<< "#" << propertyType.getName() << endl;
-
- if (dataObject->isSet(pl[i]))
+ for (unsigned int i = 0; i < pl.size(); i++)
{
+ tabs(inc);
+ cout << "Property: " << pl[i].getName() << endl;
- //////////////////////////////////////////////////////////////////////
- // For a many-valued property get the list of values
- //////////////////////////////////////////////////////////////////////
- if (pl[i].isMany())
+ const Type& propertyType = pl[i].getType();
+
+ tabs(inc);
+ cout << "Property Type: " << propertyType.getURI()<< "#" << propertyType.getName() << endl;
+
+ if (dataObject->isSet(pl[i]))
{
- inc++;
- DataObjectList& dol = dataObject->getList(pl[i]);
- for (unsigned int j = 0; j <dol.size(); j++)
+
+ //////////////////////////////////////////////////////////////////////
+ // For a many-valued property get the list of values
+ //////////////////////////////////////////////////////////////////////
+ if (pl[i].isMany())
{
- tabs(inc);
- cout << "Value " << j <<endl;
inc++;
-
- if (propertyType.isDataType())
+ DataObjectList& dol = dataObject->getList(pl[i]);
+ for (unsigned int j = 0; j <dol.size(); j++)
{
tabs(inc);
- cout<< "Property Value: " << dol.getCString(j) <<endl ;
+ cout << "Value " << j <<endl;
+ inc++;
+
+ if (propertyType.isDataType())
+ {
+ tabs(inc);
+ cout<< "Property Value: " << dol.getCString(j) <<endl ;
+ }
+ else
+ printDO(dol[j], inc);
+ inc--;
}
- else
- printDO(dol[j], inc);
+ inc--;
+ } // end IsMany
+
+
+ //////////////////////////////////////////////////////////////////////
+ // For a primitive data type print the value
+ //////////////////////////////////////////////////////////////////////
+ else if (propertyType.isDataType())
+ {
+ tabs(inc);
+ cout<< "Property Value: " << dataObject->getCString(pl[i]) <<endl ;
+ }
+
+ //////////////////////////////////////////////////////////////////////
+ // For a dataobject print the do
+ //////////////////////////////////////////////////////////////////////
+ else
+ {
+ inc++;
+ printDO(dataObject->getDataObject(pl[i]), inc);
inc--;
}
- inc--;
- } // end IsMany
-
-
- //////////////////////////////////////////////////////////////////////
- // For a primitive data type print the value
- //////////////////////////////////////////////////////////////////////
- else if (propertyType.isDataType())
- {
- tabs(inc);
- cout<< "Property Value: " << dataObject->getCString(pl[i]) <<endl ;
}
-
- //////////////////////////////////////////////////////////////////////
- // For a dataobject print the do
- //////////////////////////////////////////////////////////////////////
else
{
- inc++;
- printDO(dataObject->getDataObject(pl[i]), inc);
- inc--;
+ tabs(inc);
+ cout<< "Property Value: not set" <<endl ;
}
+
}
- else
- {
- tabs(inc);
- cout<< "Property Value: not set" <<endl ;
- }
-
}
- }
- else
- {
- // Print elements under an open DataObject
- if(dataObject->getType().isOpenType() && dataObject->getType().isDataObjectType())
+ else
{
- SequencePtr sequence = dataObject->getSequence();
- if (sequence != NULL)
+ // Print elements under an open DataObject
+ if(dataObject->getType().isOpenType() && dataObject->getType().isDataObjectType())
{
- for (unsigned int i = 0; i < sequence->size(); i++)
+ SequencePtr sequence = dataObject->getSequence();
+ if (sequence != NULL)
{
- if (sequence->isText(i))
+ for (unsigned int i = 0; i < sequence->size(); i++)
{
- tabs(inc);
- cout<< "Text Value: " << sequence->getCStringValue(i) <<endl ;
- }
- else {
- const Property& p = sequence->getProperty(i);
-
- tabs(inc);
- cout << "Property: " << p.getName() << endl;
-
- const Type& propertyType = p.getType();
-
- tabs(inc);
- cout << "Property Type: " << propertyType.getURI()<< "#" << propertyType.getName() << endl;
-
- if (dataObject->isSet(p))
+ if (sequence->isText(i))
{
+ tabs(inc);
+ cout<< "Text Value: " << sequence->getCStringValue(i) <<endl ;
+ }
+ else {
+ const Property& p = sequence->getProperty(i);
+
+ tabs(inc);
+ cout << "Property: " << p.getName() << endl;
+
+ const Type& propertyType = p.getType();
+
+ tabs(inc);
+ cout << "Property Type: " << propertyType.getURI()<< "#" << propertyType.getName() << endl;
- //////////////////////////////////////////////////////////////////////
- // For a many-valued property get the list of values
- //////////////////////////////////////////////////////////////////////
- if (p.isMany())
+ if (dataObject->isSet(p))
{
- inc++;
- DataObjectList& dol = dataObject->getList(p);
- for (unsigned int j = 0; j <dol.size(); j++)
+
+ //////////////////////////////////////////////////////////////////////
+ // For a many-valued property get the list of values
+ //////////////////////////////////////////////////////////////////////
+ if (p.isMany())
{
- tabs(inc);
- cout << "Value " << j <<endl;
inc++;
-
- if (propertyType.isDataType())
+ DataObjectList& dol = dataObject->getList(p);
+ for (unsigned int j = 0; j <dol.size(); j++)
{
tabs(inc);
- cout<< "Property Value: " << dol.getCString(j) <<endl ;
+ cout << "Value " << j <<endl;
+ inc++;
+
+ if (propertyType.isDataType())
+ {
+ tabs(inc);
+ cout<< "Property Value: " << dol.getCString(j) <<endl ;
+ }
+ else
+ printDO(dol[j], inc);
+ inc--;
}
- else
- printDO(dol[j], inc);
+ inc--;
+ } // end IsMany
+
+
+ //////////////////////////////////////////////////////////////////////
+ // For a primitive data type print the value
+ //////////////////////////////////////////////////////////////////////
+ else if (propertyType.isDataType())
+ {
+ tabs(inc);
+ cout<< "Property Value: " << dataObject->getCString(p) <<endl ;
+ }
+
+ //////////////////////////////////////////////////////////////////////
+ // For a dataobject print the do
+ //////////////////////////////////////////////////////////////////////
+ else
+ {
+ inc++;
+ printDO(dataObject->getDataObject(p), inc);
inc--;
}
- inc--;
- } // end IsMany
-
-
- //////////////////////////////////////////////////////////////////////
- // For a primitive data type print the value
- //////////////////////////////////////////////////////////////////////
- else if (propertyType.isDataType())
- {
- tabs(inc);
- cout<< "Property Value: " << dataObject->getCString(p) <<endl ;
}
-
- //////////////////////////////////////////////////////////////////////
- // For a dataobject print the do
- //////////////////////////////////////////////////////////////////////
else
{
- inc++;
- printDO(dataObject->getDataObject(p), inc);
- inc--;
+ tabs(inc);
+ cout<< "Property Value: not set" <<endl ;
}
}
- else
- {
- tabs(inc);
- cout<< "Property Value: not set" <<endl ;
- }
}
}
}
}
+ inc--;
}
- inc--;
- }
-
- void Utils::printTypes(DataFactoryPtr df)
- {
- //////////////////////////////////////////////////////////////////////////
- // Retrieve the DataFactory from the mediator
- // get the list of Types in the DataFactory and list them
- //////////////////////////////////////////////////////////////////////////
- TypeList tl = df->getTypes();
- for (unsigned int i = 0; i < tl.size(); i++)
+
+ void Utils::printTypes(DataFactoryPtr df)
{
- cout << "Type: " << tl[i].getURI()<< "#" << tl[i].getName() << endl;
- PropertyList pl = tl[i].getProperties();
- for (unsigned int j = 0; j < pl.size(); j++)
- {
- cout << "\tProperty: " << pl[j].getName()
- << " type: " <<pl[j].getType().getURI()<<"#"<<pl[j].getType().getName()<< endl;
-
+ //////////////////////////////////////////////////////////////////////////
+ // Retrieve the DataFactory from the mediator
+ // get the list of Types in the DataFactory and list them
+ //////////////////////////////////////////////////////////////////////////
+ TypeList tl = df->getTypes();
+ for (unsigned int i = 0; i < tl.size(); i++)
+ {
+ cout << "Type: " << tl[i].getURI()<< "#" << tl[i].getName() << endl;
+ PropertyList pl = tl[i].getProperties();
+ for (unsigned int j = 0; j < pl.size(); j++)
+ {
+ cout << "\tProperty: " << pl[j].getName()
+ << " type: " <<pl[j].getType().getURI()<<"#"<<pl[j].getType().getName()<< endl;
+
+ }
}
+
}
- }
-
- void Utils::printType(const Type& type, int increment)
- {
- int inc = increment;
- tabs(inc);
- cout << "Type: " << type.getURI()<< "#" << type.getName() << endl;
- inc++;
- PropertyList pl = type.getProperties();
- for (unsigned int j = 0; j < pl.size(); j++)
+ void Utils::printType(const Type& type, int increment)
{
+ int inc = increment;
tabs(inc);
- cout << "\tProperty: " << pl[j].getName()
- << " type: " <<pl[j].getType().getURI()<<"#"<<pl[j].getType().getName()<< endl;
+ cout << "Type: " << type.getURI()<< "#" << type.getName() << endl;
inc++;
- printType(pl[j].getType(), inc);
- inc--;
+ PropertyList pl = type.getProperties();
+ for (unsigned int j = 0; j < pl.size(); j++)
+ {
+ tabs(inc);
+ cout << "\tProperty: " << pl[j].getName()
+ << " type: " <<pl[j].getType().getURI()<<"#"<<pl[j].getType().getName()<< endl;
+ inc++;
+ printType(pl[j].getType(), inc);
+ inc--;
+ }
}
- }
+ } // End namespace util
} // End namespace sca
} // End namespace tuscany
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/Utils.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/Utils.h?view=diff&rev=487770&r1=487769&r2=487770
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/Utils.h (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/Utils.h Fri Dec 15 23:48:29 2006
@@ -31,39 +31,42 @@
{
namespace sca
{
- /**
- * Utility methods to parse strings and provide debugging information.
- */
- class SCA_API Utils {
-
- public:
- static void tokeniseUri(const string& uri, string& token1, string& token2);
- static void tokeniseQName(const string& sdoname, string& uri, string& name);
- static void tokeniseString(
- const string& separator,
- const string& str,
- string& token1,
- string& token2);
-
- static void rTokeniseString(
- const string& separator,
- const string& str,
- string& token1,
- string& token2);
-
- static void breakpoint();
-
- static void printDO(commonj::sdo::DataObjectPtr dataObject, int increment=0);
- static void printTypes(commonj::sdo::DataFactoryPtr df);
- static void printType(const commonj::sdo::Type& type, int increment=0);
-
- static const bool compareDataObjects(commonj::sdo::DataObjectPtr dataObject1, commonj::sdo::DataObjectPtr dataObject2, string& diff);
- static const bool compareProperties(commonj::sdo::DataObjectPtr dataObject1, const commonj::sdo::Property& prop1, commonj::sdo::DataObjectPtr dataObject2, const commonj::sdo::Property& prop2, string& diff);
-
- private:
- static void tabs(int increment=0);
- };
+ namespace util
+ {
+ /**
+ * Utility methods to parse strings and provide debugging information.
+ */
+ class SCA_API Utils {
+
+ public:
+ static void tokeniseUri(const string& uri, string& token1, string& token2);
+ static void tokeniseQName(const string& sdoname, string& uri, string& name);
+ static void tokeniseString(
+ const string& separator,
+ const string& str,
+ string& token1,
+ string& token2);
+
+ static void rTokeniseString(
+ const string& separator,
+ const string& str,
+ string& token1,
+ string& token2);
+
+ static void breakpoint();
+
+ static void printDO(commonj::sdo::DataObjectPtr dataObject, int increment=0);
+ static void printTypes(commonj::sdo::DataFactoryPtr df);
+ static void printType(const commonj::sdo::Type& type, int increment=0);
+
+ static const bool compareDataObjects(commonj::sdo::DataObjectPtr dataObject1, commonj::sdo::DataObjectPtr dataObject2, string& diff);
+ static const bool compareProperties(commonj::sdo::DataObjectPtr dataObject1, const commonj::sdo::Property& prop1, commonj::sdo::DataObjectPtr dataObject2, const commonj::sdo::Property& prop2, string& diff);
+
+ private:
+ static void tabs(int increment=0);
+ };
+ } // End namespace util
} // End namespace sca
} // End namespace tuscany
#endif // tuscany_sca_util_utils_h
Modified: incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/osoa/sca/ServiceRuntimeException.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/osoa/sca/ServiceRuntimeException.h?view=diff&rev=487770&r1=487769&r2=487770
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/osoa/sca/ServiceRuntimeException.h (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/osoa/sca/ServiceRuntimeException.h Fri Dec 15 23:48:29 2006
@@ -24,7 +24,7 @@
#include "osoa/sca/export.h"
-#include "tuscany/sca/util/Exceptions.h"
+#include "tuscany/sca/core/Exceptions.h"
using tuscany::sca::TuscanyRuntimeException;
Modified: incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPImplementationExtension.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPImplementationExtension.cpp?view=diff&rev=487770&r1=487769&r2=487770
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPImplementationExtension.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPImplementationExtension.cpp Fri Dec 15 23:48:29 2006
@@ -24,6 +24,8 @@
#include "tuscany/sca/util/Logging.h"
#include "tuscany/sca/util/Utils.h"
+using namespace tuscany::sca::util;
+
namespace tuscany
{
Modified: incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceProxy.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceProxy.h?view=diff&rev=487770&r1=487769&r2=487770
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceProxy.h (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceProxy.h Fri Dec 15 23:48:29 2006
@@ -32,6 +32,7 @@
#include "tuscany/sca/model/Service.h"
using namespace tuscany::sca::model;
+using namespace tuscany::sca::util;
namespace tuscany
Modified: incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceWrapper.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceWrapper.h?view=diff&rev=487770&r1=487769&r2=487770
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceWrapper.h (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceWrapper.h Fri Dec 15 23:48:29 2006
@@ -31,7 +31,7 @@
#include "tuscany/sca/util/Library.h"
using namespace tuscany::sca::model;
-
+using namespace tuscany::sca::util;
namespace tuscany
{
Modified: incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/TuscanyRuntime.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/TuscanyRuntime.cpp?view=diff&rev=487770&r1=487769&r2=487770
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/TuscanyRuntime.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/TuscanyRuntime.cpp Fri Dec 15 23:48:29 2006
@@ -22,7 +22,7 @@
#include "tuscany/sca/cpp/TuscanyRuntime.h"
#include "tuscany/sca/util/Logging.h"
#include "tuscany/sca/util/Utils.h"
-#include "tuscany/sca/util/Exceptions.h"
+#include "tuscany/sca/core/Exceptions.h"
#include "tuscany/sca/core/SCARuntime.h"
namespace tuscany
Modified: incubator/tuscany/cpp/sca/runtime/extensions/php/src/tuscany/sca/php/PHPServiceWrapper.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/php/src/tuscany/sca/php/PHPServiceWrapper.cpp?view=diff&rev=487770&r1=487769&r2=487770
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/php/src/tuscany/sca/php/PHPServiceWrapper.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/php/src/tuscany/sca/php/PHPServiceWrapper.cpp Fri Dec 15 23:48:29 2006
@@ -27,7 +27,7 @@
#include "tuscany/sca/php/PHPServiceWrapper.h"
#include "tuscany/sca/util/Logging.h"
-#include "tuscany/sca/util/Exceptions.h"
+#include "tuscany/sca/core/Exceptions.h"
#include "tuscany/sca/util/Utils.h"
#include "tuscany/sca/model/Component.h"
#include "tuscany/sca/model/Composite.h"
Modified: incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.cpp?view=diff&rev=487770&r1=487769&r2=487770
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.cpp Fri Dec 15 23:48:29 2006
@@ -22,7 +22,7 @@
#include "tuscany/sca/python/PythonServiceWrapper.h"
#include "tuscany/sca/util/Logging.h"
-#include "tuscany/sca/util/Exceptions.h"
+#include "tuscany/sca/core/Exceptions.h"
#include "tuscany/sca/util/Utils.h"
#include "tuscany/sca/model/Component.h"
#include "tuscany/sca/model/Composite.h"
Modified: incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/sca_module.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/sca_module.cpp?view=diff&rev=487770&r1=487769&r2=487770
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/sca_module.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/sca_module.cpp Fri Dec 15 23:48:29 2006
@@ -32,7 +32,7 @@
using namespace tuscany::sca::python;
#include "tuscany/sca/util/Logging.h"
-#include "tuscany/sca/util/Exceptions.h"
+#include "tuscany/sca/core/Exceptions.h"
#include "commonj/sdo/SDO.h"
using namespace commonj::sdo;
Modified: incubator/tuscany/cpp/sca/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/RESTServiceWrapper.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/RESTServiceWrapper.cpp?view=diff&rev=487770&r1=487769&r2=487770
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/RESTServiceWrapper.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/RESTServiceWrapper.cpp Fri Dec 15 23:48:29 2006
@@ -21,7 +21,7 @@
#endif
#include "tuscany/sca/util/Logging.h"
-#include "tuscany/sca/util/Exceptions.h"
+#include "tuscany/sca/core/Exceptions.h"
#include "tuscany/sca/util/Utils.h"
#include "RESTServiceWrapper.h"
#include "tuscany/sca/core/Operation.h"
Modified: incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/ModREST.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/ModREST.cpp?view=diff&rev=487770&r1=487769&r2=487770
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/ModREST.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/ModREST.cpp Fri Dec 15 23:48:29 2006
@@ -42,7 +42,7 @@
#include "mod_core.h"
-#include "tuscany/sca/util/Exceptions.h"
+#include "tuscany/sca/core/Exceptions.h"
#include "tuscany/sca/util/Logging.h"
#include "RESTServiceProxy.h"
#include "model/RESTReferenceBinding.h"
Modified: incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTServiceProxy.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTServiceProxy.cpp?view=diff&rev=487770&r1=487769&r2=487770
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTServiceProxy.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTServiceProxy.cpp Fri Dec 15 23:48:29 2006
@@ -21,7 +21,7 @@
#include "RESTServiceProxy.h"
#include "tuscany/sca/util/Logging.h"
-#include "tuscany/sca/util/Exceptions.h"
+#include "tuscany/sca/core/Exceptions.h"
#include "tuscany/sca/util/Utils.h"
#include "tuscany/sca/core/SCARuntime.h"
#include "tuscany/sca/model/Reference.h"
Modified: incubator/tuscany/cpp/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceProxy.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceProxy.cpp?view=diff&rev=487770&r1=487769&r2=487770
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceProxy.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceProxy.cpp Fri Dec 15 23:48:29 2006
@@ -23,7 +23,7 @@
#include "tuscany/sca/ruby/RubyServiceProxy.h"
#include "tuscany/sca/util/Logging.h"
#include "tuscany/sca/core/SCARuntime.h"
-#include "tuscany/sca/util/Exceptions.h"
+#include "tuscany/sca/core/Exceptions.h"
#include "tuscany/sca/model/Reference.h"
#include "tuscany/sca/model/ReferenceType.h"
#include "tuscany/sca/model/Service.h"
Modified: incubator/tuscany/cpp/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceWrapper.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceWrapper.cpp?view=diff&rev=487770&r1=487769&r2=487770
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceWrapper.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceWrapper.cpp Fri Dec 15 23:48:29 2006
@@ -23,7 +23,7 @@
#include "tuscany/sca/ruby/RubyServiceWrapper.h"
#include "tuscany/sca/util/Logging.h"
-#include "tuscany/sca/util/Exceptions.h"
+#include "tuscany/sca/core/Exceptions.h"
#include "tuscany/sca/util/Utils.h"
#include "tuscany/sca/util/Library.h"
#include "tuscany/sca/model/Component.h"
Modified: incubator/tuscany/cpp/sca/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/Axis2Client.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/Axis2Client.cpp?view=diff&rev=487770&r1=487769&r2=487770
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/Axis2Client.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/Axis2Client.cpp Fri Dec 15 23:48:29 2006
@@ -41,7 +41,7 @@
#include "tuscany/sca/util/Utils.h"
#include "model/WSServiceBinding.h"
#include "tuscany/sca/util/Utils.h"
-#include "tuscany/sca/util/Exceptions.h"
+#include "tuscany/sca/core/Exceptions.h"
#include "tuscany/sca/model/Service.h"
#include "tuscany/sca/model/ServiceType.h"
#include "tuscany/sca/model/Composite.h"
Modified: incubator/tuscany/cpp/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Service.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Service.cpp?view=diff&rev=487770&r1=487769&r2=487770
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Service.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Service.cpp Fri Dec 15 23:48:29 2006
@@ -32,7 +32,7 @@
#include <sdo_axiom.h>
-#include "tuscany/sca/util/Exceptions.h"
+#include "tuscany/sca/core/Exceptions.h"
#include "tuscany/sca/util/Logging.h"
#include "WSServiceProxy.h"
#include "model/WSReferenceBinding.h"
Modified: incubator/tuscany/cpp/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSServiceProxy.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSServiceProxy.cpp?view=diff&rev=487770&r1=487769&r2=487770
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSServiceProxy.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSServiceProxy.cpp Fri Dec 15 23:48:29 2006
@@ -21,7 +21,7 @@
#include "WSServiceProxy.h"
#include "tuscany/sca/util/Logging.h"
-#include "tuscany/sca/util/Exceptions.h"
+#include "tuscany/sca/core/Exceptions.h"
#include "tuscany/sca/util/Utils.h"
#include "tuscany/sca/core/SCARuntime.h"
#include "tuscany/sca/model/Reference.h"
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org