tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edslatt...@apache.org
Subject svn commit: r366158 [16/25] - in /incubator/tuscany/cpp/sdo: ./ bin/ dependencies/ include/ include/commonj/ include/commonj/sdo/ lib/ projects/ projects/tuscany_sdo/ projects/tuscany_sdo/sdo_runtime/ projects/tuscany_sdo/sdo_samples/ projects/tuscany_...
Date Thu, 05 Jan 2006 10:58:55 GMT
Added: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SequenceImpl.cpp
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SequenceImpl.cpp?rev=366158&view=auto
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SequenceImpl.cpp (added)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SequenceImpl.cpp Thu Jan  5 02:55:00 2006
@@ -0,0 +1,790 @@
+/*
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/* $Rev$ $Date: 2005/12/22 16:54:15 $ */
+
+#include "commonj/sdo/disable_warn.h"
+#include "commonj/sdo/Property.h"
+#include "commonj/sdo/Type.h"
+#include "commonj/sdo/TypeList.h"
+
+#include "commonj/sdo/SequenceImpl.h"
+
+#include "commonj/sdo/DataObject.h"
+#include "commonj/sdo/DataObjectImpl.h"
+#include "commonj/sdo/SDORuntimeException.h"
+
+
+
+#define CHECK_RANGE\
+        if (index >= the_list.size()){\
+            string msg("Index out of range:");\
+            msg += index;\
+            SDO_THROW_EXCEPTION("Sequence API", SDOIndexOutOfRangeException,\
+            msg.c_str());\
+        }\
+        int j = 0;\
+        for (i = the_list.begin(); (j < index) && (i != the_list.end()); ++i)\
+        {\
+            j++;\
+        }
+    
+
+namespace commonj{
+namespace sdo{
+
+    SequenceImpl::SequenceImpl()
+    {
+        SDO_THROW_EXCEPTION("Sequence constructor", SDORuntimeException,\
+        "SequenceImpl::construction without a data object");\
+    }
+
+    SequenceImpl::SequenceImpl(DataObject* indo)
+    {
+        the_do = indo;
+    }
+
+    SequenceImpl::SequenceImpl(SequenceImpl* inseq)
+    {
+        // take a copy of the_list
+        the_list = inseq->the_list;
+    }
+
+    unsigned int SequenceImpl::size()
+    {
+          return the_list.size();
+    }
+
+    const Property& SequenceImpl::getProperty(unsigned int index)
+    {
+        SEQUENCE_ITEM_LIST::iterator i;
+
+        if (isText(index))
+        {
+            string msg("Cannot get property of a text item");
+            msg += index;
+            SDO_THROW_EXCEPTION("getProperty", SDOUnsupportedOperationException,
+            msg.c_str());
+        }
+
+        unsigned int j = 0;
+        for (i = the_list.begin() ; (j < index) && (i != the_list.end()); ++i){j++;}
+        
+        if (i != the_list.end()) {
+            return *((*i).getProp()); 
+        }
+        string msg("Index out of range:");
+        msg += index;
+        SDO_THROW_EXCEPTION("getProperty", SDOIndexOutOfRangeException,
+        msg.c_str());
+    }
+
+    Type::Types SequenceImpl::getTypeEnum(unsigned int index)
+    {
+        SEQUENCE_ITEM_LIST::iterator i;
+        
+        unsigned int j = 0;
+        for (i = the_list.begin() ; (j < index) && (i != the_list.end()); ++i){j++;}
+
+        if (i != the_list.end()) {
+            if ((*i).getProp() == 0) {
+                // text type
+                return Type::TextType;
+            }
+            return (*i).getProp()->getTypeEnum(); 
+        }
+        string msg("Index out of range:");
+        msg += index;
+        SDO_THROW_EXCEPTION("getTypeEnum", SDOIndexOutOfRangeException,
+        msg.c_str());
+    }
+
+    unsigned int SequenceImpl::getListIndex(unsigned int index)
+    {
+        SEQUENCE_ITEM_LIST::iterator i;
+        unsigned int j = 0;
+        for (i = the_list.begin() ; (j < index) && (i != the_list.end()); ++i){j++;}
+
+        if (i != the_list.end()) {
+            if ((*i).getProp() == 0) 
+            {
+                string msg("Get list index on text property");
+                SDO_THROW_EXCEPTION("getListIndex", SDOUnsupportedOperationException,
+                msg.c_str());
+            }
+            if ( (*i).getProp()->isMany())
+            {
+                return (*i).getIndex();
+            }
+            else 
+            {
+                string msg("Get list index on text single valued property");
+                SDO_THROW_EXCEPTION("getListIndex", SDOUnsupportedOperationException,
+                msg.c_str());
+            }
+        }
+        string msg("Index out of range:");
+        msg += index;
+        SDO_THROW_EXCEPTION("getListIndex", SDOIndexOutOfRangeException,
+        msg.c_str());
+    }
+
+    unsigned int SequenceImpl::getIndex(const char* propName, unsigned int pindex)
+    {
+        SEQUENCE_ITEM_LIST::iterator i;
+        unsigned int j = 0;
+        for (i=the_list.begin(), j=0;i != the_list.end();++i,++j) {
+            const Property* p = (*i).getProp();
+            if (p == 0 ) continue; // avoid text
+            if (!strcmp(p->getName(), propName)) {
+                if (p->isMany())
+                {
+                    if( pindex == (*i).getIndex())return j;
+                }
+                else {
+                    return j;
+                }
+            }
+        }
+        SDO_THROW_EXCEPTION("getIndex", SDOIndexOutOfRangeException,
+        "SequenceImpl::getIndex - property Setting not in sequence");
+    }
+
+    unsigned int SequenceImpl::getIndex(const Property& p, unsigned int pindex)
+    {
+        return getIndex(p.getName(), pindex);
+    }
+
+    ///////////////////////////////////////////////////////////////////////////
+    // specific getters for prims and data objects
+    ///////////////////////////////////////////////////////////////////////////
+
+
+#define StringGetter(returntype,primtype,defval)\
+    returntype SequenceImpl::get##primtype##Value(unsigned int index)\
+    {\
+        SEQUENCE_ITEM_LIST::iterator i;\
+        CHECK_RANGE;\
+        const Property* p = (*i).getProp();\
+        if (p == 0) {\
+            return (*i).getText();\
+        }\
+        if (p->isMany())\
+        {\
+            DataObjectList& dol = the_do->getList(*p);\
+            DataObject* list_do = dol[(*i).getIndex()];\
+            if (list_do != 0)\
+            {\
+                return ((DataObjectImpl*)list_do)->get##primtype();\
+            }\
+            return defval;\
+        }\
+        return the_do->get##primtype(*((*i).getProp()));\
+    }
+
+#define getter(returntype,primtype,defval)\
+    returntype SequenceImpl::get##primtype##Value(unsigned int index)\
+    {\
+        SEQUENCE_ITEM_LIST::iterator i;\
+        CHECK_RANGE;\
+        const Property* p = (*i).getProp();\
+        if (p == 0) {\
+            return defval;\
+        }\
+        if (p->isMany())\
+        {\
+            DataObjectList& dol = the_do->getList(*p);\
+            DataObject* list_do = dol[(*i).getIndex()];\
+            if (list_do != 0)\
+            {\
+                return ((DataObjectImpl*)list_do)->get##primtype();\
+            }\
+            return defval;\
+        }\
+        return the_do->get##primtype(*((*i).getProp()));\
+    }
+
+#define ObjectGetter(returntype,primtype,defval)\
+    returntype SequenceImpl::get##primtype##Value(unsigned int index)\
+    {\
+        SEQUENCE_ITEM_LIST::iterator i;\
+        CHECK_RANGE;\
+        const Property* p = (*i).getProp();\
+        if (p == 0) {\
+            return defval;\
+        }\
+        if (p->isMany())\
+        {\
+            DataObjectList& dol = the_do->getList(*p);\
+            DataObject* list_do = dol[(*i).getIndex()];\
+            if (list_do != 0)\
+            {\
+                    return list_do;\
+            }\
+            return defval;\
+        }\
+        return the_do->get##primtype(*((*i).getProp()));\
+    }
+
+#define CharGetter(returntype,primtype,defval)\
+    unsigned int SequenceImpl::get##primtype##Value(unsigned int index, returntype ptr, unsigned int max)\
+    {\
+        SEQUENCE_ITEM_LIST::iterator i;\
+        CHECK_RANGE;\
+        const Property* p = (*i).getProp();\
+        if (p == 0) {\
+            return defval;\
+        }\
+        if (p->isMany())\
+        {\
+            DataObjectList& dol = the_do->getList(*p);\
+            DataObject* list_do = dol[(*i).getIndex()];\
+            if (list_do != 0)\
+            {\
+                return ((DataObjectImpl*)list_do)->get##primtype(ptr, max);\
+            }\
+            return defval;\
+        }\
+        return the_do->get##primtype(*((*i).getProp()), ptr, max);\
+    }
+
+
+StringGetter(const char* , CString, 0);
+
+CharGetter( wchar_t* , String, 0);
+CharGetter( char*, Bytes, 0);
+
+unsigned int SequenceImpl::getLength(unsigned int index)
+{
+    SEQUENCE_ITEM_LIST::iterator i;
+    CHECK_RANGE;
+    const Property* p = (*i).getProp();
+    switch (p->getTypeEnum())
+    {
+    case Type::StringType:
+        return getStringValue(index,0,0);
+    case Type::BytesType:
+        return getBytesValue(index,0,0);
+    default:
+        return 0;
+    }
+}
+
+getter(bool, Boolean, false);
+getter(char, Byte, (char)0);
+getter(wchar_t, Character, 0);
+getter(short, Short, 0);
+getter(long, Integer, 0L);
+getter(int64_t, Long, 0);
+getter(float, Float, (float)0);
+getter(long double, Double, 0);
+getter(const SDODate, Date, 0);
+
+ObjectGetter(RefCountingPointer<DataObject> , DataObject, 0);
+
+
+    ///////////////////////////////////////////////////////////////////////////
+    // generic getter for those types which support it
+    ///////////////////////////////////////////////////////////////////////////
+    
+    void SequenceImpl::setCStringValue(    unsigned int index, const char* s )
+    {
+        SEQUENCE_ITEM_LIST::iterator i;
+        CHECK_RANGE;
+        if ((*i).getProp() == 0) {
+            (*i).setText(s);
+            return;
+        }
+        the_do->setCString(*((*i).getProp()),s);
+
+    }
+    void SequenceImpl::setBooleanValue(   unsigned int index, bool        b )
+    {
+        SEQUENCE_ITEM_LIST::iterator i;
+        CHECK_RANGE;
+        if ((*i).getProp() == 0) {
+            return;
+        }
+        the_do->setBoolean(*((*i).getProp()),b);
+    }
+
+    void SequenceImpl::setByteValue(      unsigned int index, char        c )
+    {
+        SEQUENCE_ITEM_LIST::iterator i;
+        CHECK_RANGE;
+        if ((*i).getProp() == 0) {
+            return;
+        }
+        the_do->setByte(*((*i).getProp()),c);
+    }
+
+    void SequenceImpl::setCharacterValue(     unsigned int index, wchar_t     c )
+    {
+        SEQUENCE_ITEM_LIST::iterator i;
+        CHECK_RANGE;
+        if ((*i).getProp() == 0) {
+            return;
+        }
+        the_do->setCharacter(*((*i).getProp()),c);
+    }
+    void SequenceImpl::setStringValue(   unsigned int index, const wchar_t* s , unsigned int len)
+    {
+        SEQUENCE_ITEM_LIST::iterator i;
+        CHECK_RANGE;
+        if ((*i).getProp() == 0) {
+            return;
+        }
+        the_do->setString(*((*i).getProp()),s, len);
+    }
+    void SequenceImpl::setBytesValue(   unsigned int index, const char* s , unsigned int len)
+    {
+        SEQUENCE_ITEM_LIST::iterator i;
+        CHECK_RANGE;
+        if ((*i).getProp() == 0) {
+            return;
+        }
+        the_do->setBytes(*((*i).getProp()),s, len);
+    }
+    void SequenceImpl::setShortValue(     unsigned int index, short       s )
+    {
+        SEQUENCE_ITEM_LIST::iterator i;
+        CHECK_RANGE;
+        if ((*i).getProp() == 0) {
+            return;
+        }
+        the_do->setShort(*((*i).getProp()),s);
+    }
+
+    void SequenceImpl::setIntegerValue(       unsigned int index, long         l)
+    {
+        SEQUENCE_ITEM_LIST::iterator i;
+        CHECK_RANGE;
+        if ((*i).getProp() == 0) {
+            return;
+        }
+        the_do->setInteger(*((*i).getProp()),l);
+    }
+
+
+    void SequenceImpl::setLongValue(  unsigned int index, int64_t     l )
+    {
+        SEQUENCE_ITEM_LIST::iterator i;
+        CHECK_RANGE;
+        if ((*i).getProp() == 0) {
+            return;
+        }
+        the_do->setLong(*((*i).getProp()),l);
+    }
+
+    void SequenceImpl::setFloatValue(     unsigned int index, float       f )
+    {
+        SEQUENCE_ITEM_LIST::iterator i;
+        CHECK_RANGE;
+        if ((*i).getProp() == 0) {
+            return;
+        }
+        the_do->setFloat(*((*i).getProp()),f);
+    }
+
+
+    void SequenceImpl::setDoubleValue(unsigned int index, long double d )
+    {
+        SEQUENCE_ITEM_LIST::iterator i;
+        CHECK_RANGE;
+        if ((*i).getProp() == 0) {
+            return;
+        }
+        the_do->setDouble(*((*i).getProp()),d);
+    }
+
+    void SequenceImpl::setDateValue(unsigned int index, const SDODate t )
+    {
+        SEQUENCE_ITEM_LIST::iterator i;
+        CHECK_RANGE;
+        if ((*i).getProp() == 0) {
+            return;
+        }
+        the_do->setDate(*((*i).getProp()),t);
+    }
+
+    void SequenceImpl::setDataObjectValue(unsigned int index, DataObjectPtr d )
+    {
+        SEQUENCE_ITEM_LIST::iterator i;
+        CHECK_RANGE;
+        if ((*i).getProp() == 0) {
+            return;
+        }
+        the_do->setDataObject(*((*i).getProp()),d);
+    }
+  
+
+
+#define adder(primtype,primval)\
+    bool SequenceImpl::add##primtype(const char* propertyName, primval v)\
+    {\
+        return add##primtype(the_do->getProperty(propertyName),v);\
+    }\
+    bool SequenceImpl::add##primtype(unsigned int propertyIndex, primval v)\
+    {\
+        return add##primtype(the_do->getProperty(propertyIndex), v);\
+    }\
+    bool SequenceImpl::add##primtype(const Property& p, primval v)\
+    {\
+        if (p.isMany())\
+        {\
+            DataObjectList& dol = the_do->getList(p);\
+            dol.append((primval)v);\
+            /* the_list.push_back(seq_item(&p,dol.size()-1));*/\
+            return true;\
+        }\
+        SEQUENCE_ITEM_LIST::iterator i;\
+        for (i=the_list.begin();i != the_list.end();++i) {\
+            const Property* pp = (*i).getProp();\
+            if (pp == 0) continue;\
+            if (!strcmp(pp->getName(),p.getName()))\
+            {\
+            SDO_THROW_EXCEPTION("add", SDOUnsupportedOperationException,\
+            "Sequence::add of property which already exists in sequence");\
+            }\
+        }\
+        the_do->set##primtype(p,v);\
+        the_list.push_back(seq_item(&p,0));\
+        return true;\
+    }
+
+adder( CString , const char* );
+adder( Boolean, bool);
+adder( Byte, char );
+adder(Character, wchar_t);
+adder(Short, short);
+adder(Integer, long);
+adder(Long, int64_t);
+adder(Float, float);
+adder(Double, long double);
+adder(Date, const SDODate);
+adder(DataObject, RefCountingPointer<DataObject>);
+
+
+#define charAdder(primtype,primval)\
+    bool SequenceImpl::add##primtype(const char* propertyName, primval v, unsigned int len)\
+    {\
+        return add##primtype(the_do->getProperty(propertyName),v, len);\
+    }\
+    bool SequenceImpl::add##primtype(unsigned int propertyIndex, primval v, unsigned int len)\
+    {\
+        return add##primtype(the_do->getProperty(propertyIndex), v, len);\
+    }\
+    bool SequenceImpl::add##primtype(const Property& p, primval v, unsigned int len)\
+    {\
+        if (p.isMany())\
+        {\
+            DataObjectList& dol = the_do->getList(p);\
+            dol.append((primval)v, len);\
+            /*the_list.push_back(seq_item(&p,dol.size()-1));*/\
+            return true;\
+        }\
+        SEQUENCE_ITEM_LIST::iterator i;\
+        for (i=the_list.begin();i != the_list.end();++i) {\
+            const Property* pp = (*i).getProp();\
+            if (pp == 0) continue;\
+            if (!strcmp(pp->getName(),p.getName()))\
+            {\
+            SDO_THROW_EXCEPTION("add", SDOUnsupportedOperationException,\
+            "Sequence::add of property which already exists in sequence");\
+            }\
+        }\
+        the_do->set##primtype(p,v, len);\
+        the_list.push_back(seq_item(&p,0));\
+        return true;\
+    }
+
+
+charAdder ( String, const wchar_t* );
+charAdder ( Bytes , const char* );
+
+
+
+#define inserter(primtype,primval)\
+    bool SequenceImpl::add##primtype(unsigned int index, const char* propertyName, primval v)\
+    {\
+        return add##primtype(index,the_do->getProperty(propertyName),v);\
+    }\
+    bool SequenceImpl::add##primtype(unsigned int index, unsigned int propertyIndex, primval v)\
+    {\
+        return add##primtype(index,the_do->getProperty(propertyIndex), v);\
+    }\
+    bool SequenceImpl::add##primtype(unsigned int index, const Property& p, primval v)\
+    {\
+        SEQUENCE_ITEM_LIST::iterator i;\
+        SEQUENCE_ITEM_LIST::iterator i2 = the_list.end();\
+        int j;\
+        if (index >= the_list.size()) {\
+            return add##primtype(p,v);\
+        }\
+        if (p.isMany())\
+        {\
+            DataObjectList& dol = the_do->getList(p);\
+            dol.append((primval)v);\
+            j = 0;\
+            for (i=the_list.begin();(j < index) && (i != the_list.end());++i) {\
+                j++;\
+            }\
+            /*the_list.insert(i,seq_item(&p,dol.size()-1));*/\
+            return true;\
+        }\
+        j = 0;\
+        for (i=the_list.begin();i != the_list.end();++i) {\
+            const Property* pp = (*i).getProp();\
+            if (pp == 0) continue;\
+            if (!strcmp(pp->getName(),p.getName()))\
+            {\
+                SDO_THROW_EXCEPTION("Insert", SDOUnsupportedOperationException,\
+                "Sequence::insert of property which already exists in sequence");\
+            }\
+            if (j == index) {\
+                i2 = i;\
+            }\
+            j++;\
+        }\
+        the_do->set##primtype(p,v);\
+        the_list.insert(i2,seq_item(&p,0));\
+        return true;\
+    }
+
+inserter( CString , const char* );
+inserter( Boolean, bool);
+inserter( Byte, char );
+inserter(Character, wchar_t);
+inserter(Short, short);
+inserter(Integer, long);
+inserter(Long, int64_t);
+inserter(Float, float);
+inserter(Double, long double);
+inserter(Date, const SDODate);
+inserter(DataObject, RefCountingPointer<DataObject>);
+
+
+
+#define charInserter(primtype,primval)\
+    bool SequenceImpl::add##primtype(unsigned int index, const char* propertyName, primval v, unsigned int len)\
+    {\
+        return add##primtype(index,the_do->getProperty(propertyName),v, len);\
+    }\
+    bool SequenceImpl::add##primtype(unsigned int index, unsigned int propertyIndex, primval v, unsigned int len)\
+    {\
+        return add##primtype(index,the_do->getProperty(propertyIndex), v, len);\
+    }\
+    bool SequenceImpl::add##primtype(unsigned int index, const Property& p, primval v, unsigned int len)\
+    {\
+        SEQUENCE_ITEM_LIST::iterator i;\
+        SEQUENCE_ITEM_LIST::iterator i2 = the_list.end();\
+        unsigned int j;\
+        if (index >= the_list.size()) {\
+            return add##primtype(p,v, len);\
+        }\
+        if (p.isMany())\
+        {\
+            DataObjectList& dol = the_do->getList(p);\
+            dol.append((primval)v, len);\
+            j = 0;\
+            for (i=the_list.begin();(j < index) && (i != the_list.end());++i) {\
+                j++;\
+            }\
+            /*the_list.insert(i,seq_item(&p,dol.size()-1));*/\
+            return true;\
+        }\
+        j = 0;\
+        for (i=the_list.begin();i != the_list.end();++i) {\
+            const Property* pp = (*i).getProp();\
+            if (pp == 0) continue;\
+            if (!strcmp(pp->getName(),p.getName()))\
+            {\
+                SDO_THROW_EXCEPTION("Insert", SDOUnsupportedOperationException,\
+                "Sequence::insert of property which already exists in sequence");\
+            }\
+            if (j == index) {\
+                i2 = i;\
+            }\
+            j++;\
+        }\
+        the_do->set##primtype(p,v, len);\
+        the_list.insert(i2,seq_item(&p,0));\
+        return true;\
+    }
+
+
+charInserter( String , const wchar_t* );
+charInserter (Bytes , const char* );
+
+
+
+
+
+    void SequenceImpl::push(const Property& p, unsigned int index)
+    {
+        the_list.push_back(seq_item(&p,index));
+    }
+
+    void SequenceImpl::remove(unsigned int index)
+    {
+        if (index >= the_list.size()) {
+            string msg("Index out of range:");
+            msg += index;
+            SDO_THROW_EXCEPTION("Sequence remove", SDOIndexOutOfRangeException,
+            msg.c_str());
+        }
+        SEQUENCE_ITEM_LIST::iterator i;
+        int j = 0;
+        for (i=the_list.begin();(j < index) && (i != the_list.end()) ; ++i)
+        {
+            j++;
+        }
+        the_list.erase(i);
+        return;
+    }
+
+    void SequenceImpl::removeAll(const Property& p)
+    {
+        int j = 0;
+        const Property* prop;
+        SEQUENCE_ITEM_LIST::iterator i;
+        for (i=the_list.begin();i != the_list.end(); ++i)
+        {
+            prop = (*i).getProp();
+            if (prop != 0) {
+                if (!strcmp(prop->getName(),
+                            p.getName()))
+                {
+                    // not sure this works - does i still equate
+                    // to an iterator over the list after the remove?
+                    i = the_list.erase(i);
+                }
+            }
+        }
+    
+        return;
+    }
+
+    void SequenceImpl::move(unsigned int toIndex, unsigned int fromIndex)
+    {
+        if (fromIndex >= the_list.size()) {
+            string msg("Index out of range:");
+            msg += fromIndex;
+            SDO_THROW_EXCEPTION("Sequence Move", SDOIndexOutOfRangeException,
+            msg.c_str());
+        }
+
+        if (toIndex == fromIndex) return;
+
+        SEQUENCE_ITEM_LIST::iterator i1,
+                            i2 = the_list.end(), 
+                            i3 = the_list.end();
+        int j = 0;
+        for (i3 = the_list.begin(); 
+             j < toIndex && j < fromIndex && 
+                 i3 != the_list.end() ; ++i3);
+        {
+            if (j == toIndex)   i1 = i3;
+            if (j == fromIndex) i2 = i3;
+            j++;
+        }
+
+        if (toIndex < fromIndex) 
+        {
+            the_list.insert( i1, *i2);
+            the_list.erase(i2);
+        }
+        else 
+        {
+            if (toIndex + 1 == the_list.size()) 
+            {
+                the_list.push_back(*i2);
+            }
+            else
+            {
+                the_list.insert(++i1,*i2);
+            }
+            the_list.erase(i2);
+        }
+        return;
+    }
+
+    bool SequenceImpl::addText(const char* text)
+    {
+        the_list.push_back(seq_item(text));
+        return true;
+    }
+
+    bool SequenceImpl::isText(unsigned int index)
+    {
+        if (index >= the_list.size()) {
+            return false;
+        }
+        SEQUENCE_ITEM_LIST::iterator i;
+        int j = 0;
+        for (i= the_list.begin(); (j < index) && (i != the_list.end()); ++i)
+        {
+            j++;
+        }
+        if ((*i).getProp() == 0)
+        {
+            return true;
+        }
+
+        return false;
+    }
+
+    bool SequenceImpl::addText(unsigned int index, const char* text)
+    {
+        if (index >= the_list.size()) {
+            return addText(text);
+        }
+
+        SEQUENCE_ITEM_LIST::iterator i;
+        int j = 0;
+        for (i= the_list.begin(); (j < index) && (i != the_list.end()); ++i)
+        {
+            j++;
+        }
+        the_list.insert(i,seq_item(text));
+        return true;
+    }
+
+    bool SequenceImpl::setText(unsigned int index, const char* text)
+    {
+        if (index >= the_list.size()) {
+            return false;
+        }
+
+        if (!isText(index))
+        {
+            return false;
+        }
+
+        SEQUENCE_ITEM_LIST::iterator i;
+        int j = 0;
+        for (i= the_list.begin(); (j < index) && (i != the_list.end()); ++i)
+        {
+            j++;
+        }
+        (*i).setText(text);
+        return true;
+    }
+
+};
+};
+

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SequenceImpl.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SequenceImpl.cpp
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SequenceImpl.h
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SequenceImpl.h?rev=366158&view=auto
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SequenceImpl.h (added)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SequenceImpl.h Thu Jan  5 02:55:00 2006
@@ -0,0 +1,369 @@
+/*
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/* $Rev$ $Date: 2005/12/22 16:54:15 $ */
+
+#ifndef _SEQUENCEIMPL_H_
+#define _SEQUENCEIMPL_H_
+
+#include "commonj/sdo/disable_warn.h"
+
+#include <vector>
+using namespace std;
+
+#include "commonj/sdo/Sequence.h"
+#include "commonj/sdo/SDODate.h"
+
+#define SequenceImplPtr RefCountingPointer<SequenceImpl> 
+
+namespace commonj{
+namespace sdo{
+
+class Property; /* forward declaration */
+class DataObject;
+
+/**  SequenceImpl implements the abstract class Sequence.
+ *
+ * A sequence is a heterogeneous list of properties and corresponding values.
+ * It represents an ordered arbitrary mixture of data values from more 
+ * than one property of a {@link DataObject data object}.
+ */
+
+class SequenceImpl : public Sequence 
+{
+    public:
+    ///////////////////////////////////////////////////////////////////////////
+    // Returns the number of entries in the sequence.
+    // @return the number of entries.
+    ///////////////////////////////////////////////////////////////////////////
+    virtual unsigned int size();
+
+    ///////////////////////////////////////////////////////////////////////////
+    // Returns the property for the given entry index.
+    ///////////////////////////////////////////////////////////////////////////
+    virtual const Property& getProperty(unsigned int index);
+
+    ///////////////////////////////////////////////////////////////////////////
+    // Returns the property for the given entry index.
+    ///////////////////////////////////////////////////////////////////////////
+    virtual unsigned int getIndex(const Property& p, unsigned int pindex=0);
+    virtual unsigned int getIndex(const char* propName, unsigned int pindex=0);
+
+    virtual unsigned int getListIndex(unsigned int index);
+    
+    Type::Types getTypeEnum(unsigned int index);
+
+    
+    ///////////////////////////////////////////////////////////////////////////
+    // Returns the property value for the given entry index.
+    // @param index the index of the entry.
+    // @return the value for the given entry index..
+    ///////////////////////////////////////////////////////////////////////////
+    virtual const char* getCStringValue(unsigned int index);
+    virtual bool        getBooleanValue(unsigned int index);
+    virtual char        getByteValue(unsigned int index);
+    virtual wchar_t     getCharacterValue(unsigned int index);
+    virtual unsigned int getStringValue(unsigned int index, wchar_t* val, unsigned int max);
+    virtual unsigned int getBytesValue(unsigned int index, char* val, unsigned int max);
+    virtual short       getShortValue(unsigned int index);
+    virtual long         getIntegerValue(unsigned int index);    
+    virtual int64_t     getLongValue(unsigned int index);
+    virtual float       getFloatValue(unsigned int index);
+    virtual long double getDoubleValue(unsigned int index);
+    virtual const SDODate   getDateValue(unsigned int index);
+    virtual DataObjectPtr getDataObjectValue(unsigned int index);
+
+    virtual unsigned int getLength(unsigned int index);
+ 
+    ///////////////////////////////////////////////////////////////////////////
+    // sets the entry at a specified index to the new value.
+    // @param index the index of the entry.
+    // @param value the new value for the entry.
+    ///////////////////////////////////////////////////////////////////////////
+
+    virtual void setCStringValue(   unsigned int index, const char* s );
+    virtual void setBooleanValue(   unsigned int index, bool        b );
+    virtual void setByteValue(      unsigned int index, char        c );
+    virtual void setCharacterValue( unsigned int index, wchar_t     c );
+    virtual void setBytesValue(     unsigned int index, const char* s , unsigned int len);
+    virtual void setStringValue(    unsigned int index, const wchar_t* s , unsigned int len);
+    virtual void setShortValue(     unsigned int index, short       s );
+    virtual void setIntegerValue(       unsigned int index, long         i );    
+    virtual void setLongValue(  unsigned int index, int64_t     l );
+    virtual void setFloatValue(     unsigned int index, float       f );
+    virtual void setDoubleValue(    unsigned int index, long double d );
+    virtual void setDateValue(    unsigned int index, const SDODate t );
+    virtual void setDataObjectValue(unsigned int index, DataObjectPtr d );
+    
+
+        ///////////////////////////////////////////////////////////////////////////
+    // adds a new entry with the specified property name and value
+    // to the end of the entries.
+    // @param propertyName the name of the entry's property.
+    // @param value the value for the entry.
+    ///////////////////////////////////////////////////////////////////////////
+    virtual bool addCString(   const char* propertyName,const char* s );
+    virtual bool addBoolean(   const char* propertyName,bool        b );
+    virtual bool addByte(      const char* propertyName,char        c );
+    virtual bool addCharacter( const char* propertyName,wchar_t     c );
+    virtual bool addString(    const char* propertyName,const wchar_t* s , unsigned int len);
+    virtual bool addBytes(     const char* propertyName,const char* s , unsigned int len);
+    virtual bool addShort(     const char* propertyName,short       s );
+    virtual bool addInteger(   const char* propertyName,long         i );    
+    virtual bool addLong(      const char* propertyName,int64_t     l );
+    virtual bool addFloat(     const char* propertyName,float       f );
+    virtual bool addDouble(    const char* propertyName,long double d );
+    virtual bool addDate(      const char* propertyName,const SDODate t );
+    virtual bool addDataObject(const char* propertyName,DataObjectPtr d );
+
+    
+    ///////////////////////////////////////////////////////////////////////////
+    // adds a new entry with the specified property index and value
+    // to the end of the entries.
+    // @param propertyIndex the index of the entry's property.
+    // @param value the value for the entry.
+    ///////////////////////////////////////////////////////////////////////////
+    virtual bool addCString(   unsigned int propertyIndex,const char* s );
+    virtual bool addBoolean(   unsigned int propertyIndex,bool        b );
+    virtual bool addByte(      unsigned int propertyIndex,char        c );
+    virtual bool addCharacter( unsigned int propertyIndex,wchar_t     c );
+    virtual bool addString(    unsigned int propertyIndex,const wchar_t* s , unsigned int len);
+    virtual bool addBytes(     unsigned int propertyIndex,const char* s , unsigned int len);
+    virtual bool addShort(     unsigned int propertyIndex,short       s );
+    virtual bool addInteger(   unsigned int propertyIndex,long         i );    
+    virtual bool addLong(      unsigned int propertyIndex,int64_t     l );
+    virtual bool addFloat(     unsigned int propertyIndex,float       f );
+    virtual bool addDouble(    unsigned int propertyIndex,long double d );
+    virtual bool addDate(      unsigned int propertyIndex,const SDODate t );
+    virtual bool addDataObject(unsigned int propertyIndex,DataObjectPtr d );
+
+
+    ///////////////////////////////////////////////////////////////////////////
+    // adds a new entry with the specified property and value
+    // to the end of the entries.
+    // @param property the property of the entry.
+    // @param value the value for the entry.
+    ///////////////////////////////////////////////////////////////////////////
+
+    virtual bool addCString(   const Property& property,const char* s );
+    virtual bool addBoolean(   const Property& property,bool        b );
+    virtual bool addByte(      const Property& property,char        c );
+    virtual bool addCharacter( const Property& property,wchar_t     c );
+    virtual bool addString(    const Property& property,const wchar_t* s , unsigned int len);
+    virtual bool addBytes(     const Property& property,const char* s , unsigned int len);
+    virtual bool addShort(     const Property& property,short       s );
+    virtual bool addInteger(   const Property& property,long         i );    
+    virtual bool addLong(      const Property& property,int64_t     l );
+    virtual bool addFloat(     const Property& property,float       f );
+    virtual bool addDouble(    const Property& property,long double d );
+    virtual bool addDate(      const Property& property,const SDODate t );
+    virtual bool addDataObject(const Property& property,DataObjectPtr d );
+
+
+    ///////////////////////////////////////////////////////////////////////////
+    // adds a new entry with the specified property name and value
+    // at the specified entry index.
+    // @param index the index at which to add the entry.
+    // @param propertyName the name of the entry's property.
+    // @param value the value for the entry.
+    ///////////////////////////////////////////////////////////////////////////
+    virtual bool addCString(   unsigned int index,const char* propertyName,const char* s );
+    virtual bool addBoolean(   unsigned int index,const char* propertyName,bool        b );
+    virtual bool addByte(      unsigned int index,const char* propertyName,char        c );
+    virtual bool addCharacter( unsigned int index,const char* propertyName,wchar_t     c );
+    virtual bool addString(    unsigned int index,const char* propertyName,const wchar_t* s , unsigned int len);
+    virtual bool addBytes(     unsigned int index,const char* propertyName,const char* s , unsigned int len);
+    virtual bool addShort(     unsigned int index,const char* propertyName,short       s );
+    virtual bool addInteger(   unsigned int index,const char* propertyName,long         i );    
+    virtual bool addLong(      unsigned int index,const char* propertyName,int64_t     l );
+    virtual bool addFloat(     unsigned int index,const char* propertyName,float       f );
+    virtual bool addDouble(    unsigned int index,const char* propertyName,long double d );
+    virtual bool addDate(      unsigned int index,const char* propertyName,const SDODate t );
+    virtual bool addDataObject(unsigned int index,const char* propertyName,DataObjectPtr d );
+
+
+    ///////////////////////////////////////////////////////////////////////////
+    // adds a new entry with the specified property index and value
+    // at the specified entry index.
+    // @param index the index at which to add the entry.
+    // @param propertyIndex the index of the entry's property.
+    // @param value the value for the entry.
+    ///////////////////////////////////////////////////////////////////////////
+    virtual bool addCString(   unsigned int index,unsigned int propertyIndex,const char* s );
+    virtual bool addBoolean(   unsigned int index,unsigned int propertyIndex,bool        b );
+    virtual bool addByte(      unsigned int index,unsigned int propertyIndex,char        c );
+    virtual bool addCharacter( unsigned int index,unsigned int propertyIndex,wchar_t     c );
+    virtual bool addString(    unsigned int index,unsigned int propertyIndex,const wchar_t* s , unsigned int len);
+    virtual bool addBytes(     unsigned int index,unsigned int propertyIndex,const char* s , unsigned int len);
+    virtual bool addShort(     unsigned int index,unsigned int propertyIndex,short       s );
+    virtual bool addInteger(   unsigned int index,unsigned int propertyIndex,long         i );    
+    virtual bool addLong(      unsigned int index,unsigned int propertyIndex,int64_t     l );
+    virtual bool addFloat(     unsigned int index,unsigned int propertyIndex,float       f );
+    virtual bool addDouble(    unsigned int index,unsigned int propertyIndex,long double d );
+    virtual bool addDate(      unsigned int index,unsigned int propertyIndex,const SDODate t );
+    virtual bool addDataObject(unsigned int index,unsigned int propertyIndex,DataObjectPtr d );
+
+
+    ///////////////////////////////////////////////////////////////////////////
+    // adds a new entry with the specified property and value
+    // at the specified entry index.
+    // @param index the index at which to add the entry.
+    // @param property the property of the entry.
+    // @param value the value for the entry.
+    ///////////////////////////////////////////////////////////////////////////
+    virtual bool addCString(   unsigned int index,const Property& property,const char* s );
+    virtual bool addBoolean(   unsigned int index,const Property& property,bool        b );
+    virtual bool addByte(      unsigned int index,const Property& property,char        c );
+    virtual bool addCharacter( unsigned int index,const Property& property,wchar_t     c );
+    virtual bool addString(    unsigned int index,const Property& property,const wchar_t* s , unsigned int len);
+    virtual bool addBytes(     unsigned int index,const Property& property,const char* s , unsigned int len);
+    virtual bool addShort(     unsigned int index,const Property& property,short       s );
+    virtual bool addInteger(   unsigned int index,const Property& property,long         i );    
+    virtual bool addLong(      unsigned int index,const Property& property,int64_t     l );
+    virtual bool addFloat(     unsigned int index,const Property& property,float       f );
+    virtual bool addDouble(    unsigned int index,const Property& property,long double d );
+    virtual bool addDate(      unsigned int index,const Property& property,const SDODate t );
+    virtual bool addDataObject(unsigned int index,const Property& property,DataObjectPtr d );
+
+ 
+    ///////////////////////////////////////////////////////////////////////////
+    // removes the entry at the given entry index.
+    // @param index the index of the entry
+    ///////////////////////////////////////////////////////////////////////////
+    virtual void remove(unsigned int index);
+    virtual void removeAll(const Property& p);
+
+    ///////////////////////////////////////////////////////////////////////////
+    // pushes a new entry without setting the property.
+    // @param index the index of the entry
+    ///////////////////////////////////////////////////////////////////////////
+    virtual void push(const Property& p, unsigned int index);
+
+    ///////////////////////////////////////////////////////////////////////////
+    // Moves the entry at <code>fromIndex</code> to <code>toIndex</code>.
+    // @param toIndex the index of the entry destination.
+    // @param fromIndex the index of the entry to move.
+    ///////////////////////////////////////////////////////////////////////////
+    virtual void move(unsigned int toIndex, unsigned int fromIndex);
+
+    ///////////////////////////////////////////////////////////////////////////
+    // adds a new Setting with the SDO text Property
+    // to the end of the Settings.
+    // @param text value of the Setting.
+    ///////////////////////////////////////////////////////////////////////////
+    virtual bool addText(const char* text);
+
+    ///////////////////////////////////////////////////////////////////////////
+    // adds a new Setting with the SDO text Property
+    // to the Settings.
+    // @param index the index at which to add the entry.
+    // @param text value of the Setting.
+    ///////////////////////////////////////////////////////////////////////////
+    virtual bool addText(unsigned int index, const char* text);
+
+    ///////////////////////////////////////////////////////////////////////////
+    // sets a text Property
+    // @param index the index at which to set the entry.
+    // @param text value of the Setting.
+    ///////////////////////////////////////////////////////////////////////////
+    bool setText(unsigned int index, const char* text);
+
+    ///////////////////////////////////////////////////////////////////////////
+    // Checks if an entry is text or a setting.
+    ///////////////////////////////////////////////////////////////////////////
+    virtual bool isText(unsigned int index);
+
+    SequenceImpl(DataObject* the_do);
+    SequenceImpl(SequenceImpl* s);
+  
+    private:
+
+    SequenceImpl();
+
+    DataObject* the_do;
+
+    class seq_item {
+       public:
+           seq_item(const Property* p, unsigned int i):
+             the_prop(p)
+            {
+                 index = i;
+                 text = 0;
+            }
+           seq_item(const char* t)
+           {
+               text = new char[strlen(t) + 1];
+               strcpy(text,t);
+               the_prop = 0;
+           }
+
+           ~seq_item()
+           {
+                if (text) {
+                    delete text;
+                }
+           }
+
+           seq_item(const seq_item& sin)
+           {
+               the_prop = sin.the_prop;
+               index = sin.index;
+               if (sin.text) {
+                   text = new char[strlen(sin.text) +1];
+                   strcpy(text, sin.text);
+               }
+               else
+               {
+                  text =0;
+               }
+           }
+
+           const Property* getProp() {return the_prop;}
+           unsigned int getIndex() { return index;}
+           char* getText() { return text;}
+           void setProp(Property* p) { the_prop = p;}
+           void setText(const char* intext)
+           {
+               if (intext != 0)
+               {
+                   if (text != 0)
+                   {
+                       delete text;
+                   }
+                   text = new char[strlen(intext) +1];
+                   strcpy(text,intext);
+               }
+           }
+           void setIndex(unsigned int i)
+           {
+               index = i;
+           }
+       private:
+       const Property* the_prop;
+       unsigned int index;
+       char* text;
+    };
+
+    typedef std::list<seq_item> SEQUENCE_ITEM_LIST;
+
+    SEQUENCE_ITEM_LIST the_list;
+
+};
+};
+};
+
+#endif //_SEQUENCE_H_

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SequenceImpl.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SequenceImpl.h
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/Setting.cpp
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/Setting.cpp?rev=366158&view=auto
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/Setting.cpp (added)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/Setting.cpp Thu Jan  5 02:55:00 2006
@@ -0,0 +1,303 @@
+/*
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/* $Rev$ $Date: 2005/12/22 16:54:15 $ */
+
+#include "commonj/sdo/Setting.h"
+#include "commonj/sdo/TypeImpl.h"
+
+namespace commonj{ 
+namespace sdo {
+    
+    Setting::Setting(bool set, bool nul, void* invalue, unsigned int len, const Property& p, unsigned int inindex)
+        : bisSet(set), bisNull(nul) , value(invalue),theProp(&p)
+    {
+        index = inindex;
+        length  = len;
+        strbuf = 0;
+    }
+
+    void Setting::copy(const Setting& s)
+    {
+        bisSet = s.isSet();
+        bisNull = s.isNull();
+        index = s.getIndex();
+        length = s.getLength();
+        theProp = &(s.getProperty());
+        strbuf = 0;
+        switch (theProp->getTypeEnum())
+        {
+            case Type::BooleanType:
+                value = new long;
+                *(long*)value = (long)s.getBooleanValue();
+                break;
+            case Type::ByteType:
+                value = new long;
+                *(long*)value = (long)s.getByteValue();
+                break;
+            case Type::CharacterType:
+                value = new long;
+                *(long*)value = (long)s.getCharacterValue();
+                break;
+            case Type::IntegerType: 
+                value = new long;
+                *(long*)value = (long)s.getIntegerValue();
+                break;
+            case Type::ShortType:
+                value = new long;
+                *(long*)value = (long)s.getShortValue();
+                break;
+            case Type::DoubleType:
+                value = new long double;
+                *(long double*)value = s.getDoubleValue();
+                break;
+            case Type::FloatType:
+                value = new float;
+                *(float*)value = s.getFloatValue();
+                break;
+            case Type::LongType:
+                value = new int64_t;
+                *(int64_t*)value = s.getLongValue();
+                break;
+            case Type::DateType:
+                value = new long;
+                *(long*)value = long(s.getDateValue().getTime());
+                break;
+            case Type::BigDecimalType: 
+            case Type::BigIntegerType: 
+            case Type::StringType: 
+            case Type::UriType:
+                value = new wchar_t[length];
+                s.getStringValue((wchar_t*)value,length);
+                break;
+            case Type::BytesType:
+                value = new char[length];
+                s.getBytesValue((char*)value,length);
+                break;
+            case Type::OtherTypes:
+            case Type::DataObjectType:
+            case Type::ChangeSummaryType:
+                value = s.getDataObjectValue();
+            default:
+                break;
+        }
+    }
+
+    Setting& Setting::operator=(const Setting& s)
+    {
+        if (this == &s) return *this;
+        copy(s);
+        return *this;
+    }
+
+    Setting::Setting(const Setting& s)
+    {
+        copy(s);
+    }
+
+    Setting::~Setting()
+    {
+        // The value has been allocated for everything except data objects
+
+        switch (theProp->getTypeEnum())
+        {
+            case Type::BooleanType:
+            case Type::ByteType:
+            case Type::CharacterType:
+            case Type::IntegerType: 
+            case Type::ShortType:
+                delete (long*)value;
+                break;
+            case Type::DoubleType:
+                delete (long double*)value;
+                break;
+            case Type::FloatType:
+                delete (float*)value;
+                break;
+            case Type::LongType:
+                delete (int64_t*)value;
+                break;
+            case Type::DateType:
+                delete (long*)value;
+                break;
+            case Type::BigDecimalType: 
+            case Type::BigIntegerType: 
+            case Type::StringType: 
+            case Type::UriType:
+                delete (wchar_t*)value;
+                break;
+            case Type::BytesType:
+                delete (char*)value;
+                break;
+            case Type::OtherTypes:
+            case Type::DataObjectType:
+            case Type::ChangeSummaryType:
+            default:
+                break;
+        }
+        if (strbuf != 0) delete strbuf;
+    }
+
+    const Property& Setting::getProperty() const
+    {
+      return *theProp;
+    }
+
+    const Type& Setting::getType() const
+    {
+      return theProp->getType();
+    }
+
+    bool Setting::getBooleanValue() const
+    {
+        TypeImpl* t = (TypeImpl*)&(getType());
+        return t->convertToBoolean(value, length);
+        //if (value == 0) return false;
+        //if (*(long*)value != 0) {
+        //    return true;
+        //}
+        //return false;
+    }
+
+    char Setting::getByteValue() const
+    {
+        TypeImpl* t = (TypeImpl*)&(getType());
+        return t->convertToByte(value, length);
+        //if (value == 0) return 0;
+        //return (char)*(long*)value;
+    }
+
+    wchar_t Setting::getCharacterValue() const
+    {
+        TypeImpl* t = (TypeImpl*)&(getType());
+        return t->convertToCharacter(value, length);
+        //if (value == 0) return 0;
+        //return (wchar_t)*(long*)value;
+    }
+    
+    unsigned int Setting::getBytesValue(char* buffer, unsigned int max) const
+    {
+        if (buffer == 0 && max == 0) return length;
+
+        TypeImpl* t = (TypeImpl*)&(getType());
+        return t->convertToBytes(value, buffer,length, max);
+        //int i;
+        //char* c = (char*)value;
+        //for (i=0;i < max && i < length;i++)
+        //{
+        //    buffer[i] = (char)*c;
+        //    c++;
+        //}
+        //return i;
+    }
+    
+    unsigned int Setting::getStringValue(wchar_t* buffer, unsigned int max) const
+    {
+        if (buffer == 0 && max == 0) return length;
+
+        TypeImpl* t = (TypeImpl*)&(getType());
+        return t->convertToString(value, buffer,length, max);
+        //int i;
+        //wchar_t* c = (wchar_t*)value;
+        //for (i=0;i < max && i < length;i++)
+        //{
+        //    buffer[i] = (wchar_t)*c;
+        //    c++;
+        //}
+        //return i;
+    }
+
+    short Setting::getShortValue() const
+    {
+        TypeImpl* t = (TypeImpl*)&(getType());
+        return t->convertToShort(value,length);
+        //return (short)*(long*)value;
+    }
+
+    long Setting::getIntegerValue() const
+    {
+        TypeImpl* t = (TypeImpl*)&(getType());
+        return t->convertToInteger(value, length);
+        //return *(long*)value;
+    }
+
+
+    int64_t Setting::getLongValue() const
+    {
+        TypeImpl* t = (TypeImpl*)&(getType());
+        return t->convertToLong(value, length);
+        //return (int64_t)*(int64_t*)value;
+    }
+
+    float Setting::getFloatValue() const
+    {
+        TypeImpl* t = (TypeImpl*)&(getType());
+        return t->convertToFloat(value, length);
+        //return (float)*(float*)value;
+    }
+
+    const SDODate Setting::getDateValue() const
+    {
+        TypeImpl* t = (TypeImpl*)&(getType());
+        return t->convertToDate(value, length);
+    }
+
+
+    long double Setting::getDoubleValue() const
+    {
+        TypeImpl* t = (TypeImpl*)&(getType());
+        return t->convertToDouble(value, length);
+        //return (long double)*(long double*)value;
+    }
+
+    const char* Setting::getCStringValue()
+    {
+        TypeImpl* t = (TypeImpl*)&(getType());
+        return t->convertToCString(value, &strbuf, length);
+        //return (const char*)value;
+    }
+
+    RefCountingPointer<DataObject> Setting::getDataObjectValue() const
+    {
+        DataObject *dob = (DataObject*)value;
+        return RefCountingPointer<DataObject>(dob);
+    }
+
+
+    unsigned int Setting::getLength() const
+    {
+        return length;
+    }
+
+    unsigned int Setting::getIndex() const
+    {
+        return index;
+    }
+
+    bool Setting::isSet() const
+    {
+        return bisSet;
+    }
+
+    bool Setting::isNull() const
+    {
+        return bisNull;
+    }
+
+};
+};
+

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/Setting.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/Setting.cpp
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/Setting.h
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/Setting.h?rev=366158&view=auto
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/Setting.h (added)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/Setting.h Thu Jan  5 02:55:00 2006
@@ -0,0 +1,149 @@
+/*
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/* $Rev$ $Date: 2005/12/22 16:54:15 $ */
+
+#ifndef SETTING_H
+#define SETTING_H
+
+#include "commonj/sdo/export.h"
+
+#include "commonj/sdo/Type.h"
+#include "commonj/sdo/DataObject.h"
+#include "commonj/sdo/SDODate.h"
+
+namespace commonj{
+namespace sdo {
+
+    class Property;
+
+     /**  
+     * A Setting encapsulates a property and a corresponding single value of 
+     * the property's type.
+      */
+
+    class Setting
+    {
+          public:
+
+        Setting(bool set, bool nul, void* invalue, unsigned int len, const Property& p, 
+            unsigned int inindex);
+
+        Setting(const Setting& s);
+
+        void copy(const Setting& s);
+
+        Setting& operator=(const Setting& s);
+
+
+        virtual ~Setting();
+
+
+         /**  getProperty returns the property set.
+         *
+         * Returns the property of the Setting.
+         * @return the Setting property.
+          */
+        
+        SDO_API const Property& getProperty() const;
+
+        /**  getType returns the type of the property
+         *
+         * Returns the type of this property. This is the same as
+         * getProperty().getType()
+          */
+        
+        SDO_API const Type& getType() const;
+
+        /**  getTypeEnum returns the type enumerator
+         *
+         * Returns the enum for the type of this property
+          */
+
+        SDO_API Type::Types getTypeEnum() const;
+
+
+         /** get methods get the right type of value from the setting
+         *
+         *
+         * Returns the value of the Setting. This must be of the right type for 
+         * Setting value.
+          */
+        
+        SDO_API bool getBooleanValue() const;
+        SDO_API char getByteValue() const;
+        SDO_API wchar_t getCharacterValue() const;
+        SDO_API unsigned int getBytesValue(char* buffer, unsigned int max) const;
+        SDO_API unsigned int getStringValue(wchar_t* buffer, unsigned int max) const;
+        SDO_API short getShortValue() const;
+        SDO_API long getIntegerValue() const;
+        SDO_API int64_t getLongValue() const;
+        SDO_API float getFloatValue() const;
+        SDO_API long double getDoubleValue() const;
+        SDO_API const SDODate getDateValue() const;
+        SDO_API const char* getCStringValue() ;
+        SDO_API DataObjectPtr getDataObjectValue() const;
+
+
+
+         /**  getIndex returns the index in a many-valued property
+         *
+         * Returns the index  of the Setting, if this is many valued
+          */
+
+        SDO_API unsigned int getIndex() const; 
+
+
+        /**  getLength gives the length of a string or bytes
+         *
+         * Returns the length of the setting, if this is a String or
+         * Bytes type
+         */
+
+        SDO_API unsigned int getLength() const ; 
+        
+        /** isSet returns whether the property WAS set.
+         *
+         * Returns whether or not the property is set. This value comes from the
+         * setting, and tells us whether the property was set before the change
+         * occurred.
+          */
+
+        SDO_API bool isSet() const;
+
+        /**  isNull is true if the property value WAS null
+         *
+         * Returns whether or not the property was null beforfe the setting
+         * happened.
+          */
+
+        SDO_API bool isNull() const;
+
+        private:
+
+            bool bisSet;
+            bool bisNull;
+            void* value;
+            const Property* theProp;
+            unsigned int length;
+            unsigned int index;
+            char* strbuf;
+    };
+};
+};
+
+#endif

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/Setting.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/Setting.h
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SettingList.cpp
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SettingList.cpp?rev=366158&view=auto
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SettingList.cpp (added)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SettingList.cpp Thu Jan  5 02:55:00 2006
@@ -0,0 +1,98 @@
+/*
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/* $Rev$ $Date: 2005/12/22 16:54:15 $ */
+
+#include "commonj/sdo/SDORuntimeException.h"
+
+#include "commonj/sdo/SettingList.h"
+#include "commonj/sdo/Logger.h"
+#include "commonj/sdo/Setting.h"
+
+namespace commonj{
+namespace sdo {
+
+
+SettingList::SettingList(SETTING_VECTOR p) : slist (p)
+{
+}
+
+/*SettingList::SettingList(const SettingList &pin)
+{
+    Logger::log("SettingList copy constructor\n");
+    slist = std::vector<Setting>(pin.getVec());
+}
+*/
+
+SettingList::SettingList()
+{
+}
+
+SettingList::~SettingList()
+{
+}
+
+
+Setting& SettingList::operator[] (int pos) const
+{    
+    validateIndex(pos);
+    return (Setting&)slist[pos];
+}
+
+int SettingList::size () const
+{
+    return slist.size();
+}
+
+SETTING_VECTOR SettingList::getVec() const
+{
+    return slist;
+}
+
+void SettingList::insert (unsigned int index, const Setting& d)
+{
+    slist.insert(slist.begin()+index, d);
+}
+
+void SettingList::append (const Setting& d)
+{
+    slist.insert(slist.end(),d);
+}
+
+void SettingList::remove(unsigned int index)
+{
+    validateIndex(index);
+    slist.erase(slist.begin()+index);
+    return;
+}
+
+void SettingList::validateIndex(int index) const
+{
+    if ((index < 0) || (index > size()))
+    {
+        string msg("Index out of range:");
+        msg += index;
+        SDO_THROW_EXCEPTION("ValidateIndex", SDOIndexOutOfRangeException,
+            msg.c_str());
+
+    }
+
+}
+
+};
+};
+

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SettingList.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SettingList.cpp
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SettingList.h
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SettingList.h?rev=366158&view=auto
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SettingList.h (added)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SettingList.h Thu Jan  5 02:55:00 2006
@@ -0,0 +1,75 @@
+/*
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/* $Rev$ $Date: 2005/12/22 16:54:15 $ */
+
+#ifndef SETTINGLIST_H
+#define SETTINGLIST_H
+
+
+
+#include <vector>
+#include "commonj/sdo/Setting.h"
+
+namespace commonj{
+namespace sdo{
+
+typedef std::vector<Setting> SETTING_VECTOR;
+
+/**  SettingList is a list of settings returned by a change summary
+ */
+
+class SettingList
+{
+
+public:
+    SettingList(SETTING_VECTOR sl);
+    SettingList();
+
+    virtual ~SettingList();
+
+    /**  [] is the index operator
+     *
+     * This gives access to elements of the list
+     */
+
+    virtual Setting& operator[] (int pos) const;
+
+    /**  size() returns the number of settings
+     *
+     * This method returns the size of the list os settings found.
+     * These may be creations, deletions or changes.
+     */
+
+    virtual int size () const;
+    
+    virtual void insert (unsigned int index, const Setting& d);
+    virtual void append (const Setting& d);
+    virtual void remove (unsigned int index);
+
+
+private: 
+    SETTING_VECTOR slist;
+    SETTING_VECTOR getVec() const;
+
+    void validateIndex(int index) const;
+};
+
+};
+};
+
+#endif

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SettingList.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SettingList.h
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/Type.cpp
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/Type.cpp?rev=366158&view=auto
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/Type.cpp (added)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/Type.cpp Thu Jan  5 02:55:00 2006
@@ -0,0 +1,36 @@
+/*
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/* $Rev$ $Date: 2005/12/22 16:54:15 $ */
+
+#include "commonj/sdo/Type.h"
+
+namespace commonj{
+namespace sdo{
+
+
+     Type::~Type()
+     {
+     }
+
+     const char* Type::SDOTypeNamespaceURI = "commonj.sdo";
+
+};
+};
+// end - namespace sdo
+
+

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/Type.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/Type.cpp
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/Type.h
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/Type.h?rev=366158&view=auto
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/Type.h (added)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/Type.h Thu Jan  5 02:55:00 2006
@@ -0,0 +1,225 @@
+/*
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/* $Rev$ $Date: 2005/12/22 16:54:15 $ */
+
+#ifndef _SDO_TYPE_H_
+#define _SDO_TYPE_H_
+
+
+#include "commonj/sdo/export.h"
+
+#include "commonj/sdo/PropertyList.h"
+
+namespace commonj{
+namespace sdo{
+
+
+
+
+class Property;
+
+    /**  
+     * 
+     * Type is a representation of the type of a property of a data object.
+     */
+
+class Type
+{
+
+public:
+
+
+/** \enum Types
+ *
+ * This is the enumerator for all DataType types. All DataObjectType types
+ * appear as a Type::Types of DataObjectType.
+ * otherTypes, ChangeSumamryType and TextType are not used by client code.
+ */
+
+
+   SDO_API enum Types
+   {
+    // Zero is a value for 'unknown type; - all data objects'
+    OtherTypes = 0,
+    BigDecimalType, 
+    BigIntegerType, 
+    BooleanType,   
+    ByteType,
+    BytesType,
+    CharacterType,
+    DateType,      
+    DoubleType,    
+    FloatType,    
+    IntegerType, 
+    LongType,      
+    ShortType,     
+    StringType,    
+    UriType,
+    DataObjectType,
+    ChangeSummaryType,
+    TextType,
+    num_types
+   };
+
+    virtual SDO_API ~Type();
+
+    /**  getName returns the name of the type
+     *
+     * This method returns a const char* name of the type.
+     */
+
+    virtual SDO_API const char* getName() const = 0;
+  
+    /**  getAlias returns the n'th alias
+     *
+     * This method returns a const char* corresponding to the
+     * alias at index n of the list of aliases. Use getAliasCount to 
+     * discover the size of the list.
+     */
+
+    virtual SDO_API const char* getAlias(unsigned int index = 0) const = 0;
+
+    /**  getAliasCount  returns the number of aliases
+     *
+     * This method returns the number of aliases for this type
+     */
+
+    virtual SDO_API unsigned int getAliasCount() const = 0;
+
+    /**  getBaseType returns the base if there is one
+     *
+     * This method returns a const Type* corresponding to the
+     * base Type for this type. The base type is the one which
+     * this type inherits from.
+     */
+    
+    virtual SDO_API const Type* getBaseType() const = 0;
+
+    /**  getURI  returns the URI for this type
+     *
+     * This method returns the URI for this type. The URI may be
+     * null.
+     */
+
+    virtual SDO_API const char* getURI() const = 0;
+
+
+
+    /**  getProperties returns a list of properties for this type
+     *
+     * This method returns the list of properties for this type. 
+     * Instances of open types may have more properties than appear
+     * in this list.
+     * See the propertylist API.
+     */
+
+    virtual SDO_API PropertyList  getProperties() const = 0;
+
+ 
+    /**  getProperty returns a property for this type
+     *
+     * This method returns a property, by index or by name
+     */
+
+    virtual SDO_API const Property& getProperty(const char* propertyName)  const = 0;
+    virtual SDO_API const Property& getProperty(unsigned int index)  const = 0;
+
+    /**  getPropertyIndex returns an index 
+     *
+     * This method returns a property index for a named property
+     */
+
+    virtual SDO_API unsigned int getPropertyIndex(const char* propertyName) const  = 0;
+ 
+    /**  isDataObjectType true if not a DataType 
+     *
+     * This method returns true if the type is not a DataType, and is therefore
+     * a DataObjectType with properties.
+     */
+
+    virtual SDO_API bool isDataObjectType() const = 0;
+  
+
+    /**  isSequencedType true if the type is sequenced 
+     *
+     * This method returns true if the type is sequenced, and is therefore
+     * objects of this type can be manipulate via their sequence interface.
+     */
+
+    virtual SDO_API bool isSequencedType() const = 0;
+
+
+    /**  isOpenType true if the type is open 
+     *
+     * Normal types have a predefined list of properties. Trying to set 
+     * properties which do not exist will cause an exception to be thrown.
+     * Open types, on the other hand, may have properties added to their 
+     * instances runtime. These properties get added silently when setting a
+     * property value for a property which does not exist.
+     * Different instances of these objects may have different lists of 
+     * open properties.
+     */
+
+    virtual SDO_API bool isOpenType() const = 0;
+
+    /**  isAbstractType true if the type is not instantiable. 
+     *
+     * An abstract type may not be instantiated. It is useful only as 
+     * a base type to some other non-abstract type.
+     */
+
+    virtual SDO_API bool isAbstractType() const = 0;
+
+    /**  isDataType true if the type is not an object. 
+     *
+     * A DataType is anything which is not a DataObjectType. This method
+     * is the opposite of isDataObjectType().
+     */
+
+    virtual    SDO_API bool isDataType() const = 0;
+
+
+    /**  isChangeSummaryType true if the type is a change summary. 
+     *
+     * There is only one type called ChangeSummary. This method serves
+     * no purpose in the C++ implementation.
+     */
+
+    virtual    SDO_API bool isChangeSummaryType() const = 0;
+
+    /**  getTypeEnum gets the enum for this type. 
+     *
+     * Each DataType has a defined value in the list of Types.
+     */
+
+    virtual    SDO_API Type::Types getTypeEnum() const = 0;
+
+    /**  equals compares uri and name. 
+     *
+     * The types are equal if the URI and Name are equal.
+     */
+
+    virtual SDO_API bool equals(const Type& tother) const = 0;
+
+    static SDO_API const char* SDOTypeNamespaceURI;
+};
+
+};
+};
+#endif //_SDO_TYPE_H_
+

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/Type.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/Type.h
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/TypeDefinition.cpp
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/TypeDefinition.cpp?rev=366158&view=auto
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/TypeDefinition.cpp (added)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/TypeDefinition.cpp Thu Jan  5 02:55:00 2006
@@ -0,0 +1,42 @@
+/*
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/* $Rev$ $Date: 2005/12/22 16:54:15 $ */
+
+#include "commonj/sdo/TypeDefinition.h"
+namespace commonj
+{
+    namespace sdo
+    {
+        TypeDefinition::TypeDefinition()
+            : dataType(false),
+              isOpen(false),
+              isSequenced(false),
+              isMany(false),
+              isQName(false),
+              isAbstract(false),
+              groupElementCount(0),
+              isExtendedPrimitive(false)
+        {
+        }
+        
+        TypeDefinition::~TypeDefinition()
+        {
+        }
+        
+    } // End - namespace sdo
+} // End - namespace commonj

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/TypeDefinition.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/TypeDefinition.cpp
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/TypeDefinition.h
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/TypeDefinition.h?rev=366158&view=auto
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/TypeDefinition.h (added)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/TypeDefinition.h Thu Jan  5 02:55:00 2006
@@ -0,0 +1,77 @@
+/*
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/* $Rev$ $Date: 2005/12/22 16:54:15 $ */
+
+#ifndef _TYPEDEFINITION_H_
+#define _TYPEDEFINITION_H_
+
+#include "commonj/sdo/disable_warn.h"
+
+#include "commonj/sdo/PropertyDefinition.h"
+#include "list"
+
+
+namespace commonj
+{
+    namespace sdo
+    {
+        
+        typedef std::list<PropertyDefinition> XmlDasPropertyDefs;
+        
+/**
+ * TypeDefinition holds information gathered from parsing the
+ * XSD and used for creating Types
+ */
+        class TypeDefinition
+        {
+            
+        public:
+            TypeDefinition();
+            virtual ~TypeDefinition();
+        
+    
+            SDOXMLString uri;
+            SDOXMLString name;
+            SDOXMLString localname;
+
+            SDOXMLString aliases;
+
+            SDOXMLString parentTypeUri;
+            SDOXMLString parentTypeName;
+
+            SDOXMLString IDPropertyName;
+
+            bool dataType;
+            XmlDasPropertyDefs properties;
+
+            bool isOpen;
+            bool isSequenced;
+            bool isAbstract;
+
+            bool isExtendedPrimitive;
+
+            bool isMany;
+            int groupElementCount;
+
+            bool isQName;
+        };
+    } // End - namespace sdo
+} // End - namespace commonj
+
+
+#endif //_TYPEDEFINITION_H_

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/TypeDefinition.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/TypeDefinition.h
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/TypeDefinitions.cpp
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/TypeDefinitions.cpp?rev=366158&view=auto
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/TypeDefinitions.cpp (added)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/TypeDefinitions.cpp Thu Jan  5 02:55:00 2006
@@ -0,0 +1,39 @@
+/*
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/* $Rev$ $Date: 2005/12/22 16:54:15 $ */
+
+#include "commonj/sdo/TypeDefinitions.h"
+namespace commonj
+{
+    namespace sdo
+    {
+        TypeDefinitions::TypeDefinitions()
+        {
+        }
+        
+        TypeDefinitions::~TypeDefinitions()
+        {
+        }
+
+        SDOXMLString TypeDefinitions::getTypeQName(const SDOXMLString& typeUri, const SDOXMLString& typeName)
+        {
+            return typeUri + "#" + typeName;
+        }
+
+    } // End - namespace sdo
+} // End - namespace commonj

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/TypeDefinitions.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/TypeDefinitions.cpp
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/TypeDefinitions.h
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/TypeDefinitions.h?rev=366158&view=auto
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/TypeDefinitions.h (added)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/TypeDefinitions.h Thu Jan  5 02:55:00 2006
@@ -0,0 +1,53 @@
+/*
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/* $Rev$ $Date: 2005/12/22 16:54:15 $ */
+
+#ifndef _TYPEDEFINITIONS_H_
+#define _TYPEDEFINITIONS_H_
+
+#include "commonj/sdo/disable_warn.h"
+
+#include "commonj/sdo/TypeDefinition.h"
+#include "map"
+
+namespace commonj
+{
+    namespace sdo
+    {
+        typedef std::map<SDOXMLString, TypeDefinition> XMLDAS_TypeDefs;
+        
+/**
+ * TypeDefinitions holds a list information gathered from parsing the
+ * XSD and used for creating Types
+ */
+        class TypeDefinitions
+        {
+            
+        public:
+            TypeDefinitions();
+            virtual ~TypeDefinitions();
+            static SDOXMLString getTypeQName(const SDOXMLString& typeUri, const SDOXMLString& typeName);
+
+            XMLDAS_TypeDefs types;
+            
+        };
+    } // End - namespace sdo
+} // End - namespace commonj
+
+
+#endif //_TYPEDEFINITIONS_H_

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/TypeDefinitions.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/TypeDefinitions.h
------------------------------------------------------------------------------
    svn:keywords = Rev,Date



Mime
View raw message