OW_CIMDataType.cpp

Go to the documentation of this file.
00001 /*******************************************************************************
00002 * Copyright (C) 2001-2004 Vintela, Inc. All rights reserved.
00003 *
00004 * Redistribution and use in source and binary forms, with or without
00005 * modification, are permitted provided that the following conditions are met:
00006 *
00007 *  - Redistributions of source code must retain the above copyright notice,
00008 *    this list of conditions and the following disclaimer.
00009 *
00010 *  - Redistributions in binary form must reproduce the above copyright notice,
00011 *    this list of conditions and the following disclaimer in the documentation
00012 *    and/or other materials provided with the distribution.
00013 *
00014 *  - Neither the name of Vintela, Inc. nor the names of its
00015 *    contributors may be used to endorse or promote products derived from this
00016 *    software without specific prior written permission.
00017 *
00018 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
00019 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00020 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00021 * ARE DISCLAIMED. IN NO EVENT SHALL Vintela, Inc. OR THE CONTRIBUTORS
00022 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00023 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
00024 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00025 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
00026 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00027 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00028 * POSSIBILITY OF SUCH DAMAGE.
00029 *******************************************************************************/
00030 
00036 #include "OW_config.h"
00037 #include "OW_CIMDataType.hpp"
00038 #include "OW_StringStream.hpp"
00039 #include "OW_Assertion.hpp"
00040 #include "OW_BinarySerialization.hpp"
00041 #include "OW_StrictWeakOrdering.hpp"
00042 #include "OW_COWIntrusiveCountableBase.hpp"
00043 
00044 namespace OW_NAMESPACE
00045 {
00046 
00047 using std::istream;
00048 using std::ostream;
00050 struct CIMDataType::DTData : public COWIntrusiveCountableBase
00051 {
00052    DTData() :
00053       m_type(CIMDataType::CIMNULL), m_numberOfElements(0), m_sizeRange(0)
00054    {}
00055    CIMDataType::Type m_type;
00056    Int32 m_numberOfElements;
00057    Int32 m_sizeRange;
00058    CIMName m_reference;
00059    DTData* clone() const { return new DTData(*this); }
00060 };
00062 bool operator<(const CIMDataType::DTData& x, const CIMDataType::DTData& y)
00063 {
00064    return StrictWeakOrdering(
00065       x.m_type, y.m_type,
00066       x.m_numberOfElements, y.m_numberOfElements,
00067       x.m_sizeRange, y.m_sizeRange,
00068       x.m_reference, y.m_reference);
00069 }
00071 bool operator ==(const CIMDataType::DTData& x, const CIMDataType::DTData& y)
00072 {
00073    return 
00074       x.m_type == y.m_type &&
00075       x.m_numberOfElements == y.m_numberOfElements &&
00076       x.m_sizeRange == y.m_sizeRange &&
00077       x.m_reference == y.m_reference;
00078 }
00080 CIMDataType::CIMDataType() :
00081    CIMBase(), m_pdata(new DTData)
00082 {
00083    m_pdata->m_type = CIMNULL;
00084    m_pdata->m_numberOfElements = 0;
00085 }
00087 CIMDataType::CIMDataType(CIMNULL_t) :
00088    CIMBase(), m_pdata(NULL)
00089 {
00090 }
00092 CIMDataType::CIMDataType(CIMDataType::Type type) :
00093    CIMBase(), m_pdata(new DTData)
00094 {
00095    OW_ASSERT(type >= CIMNULL && type < MAXDATATYPE);
00096    m_pdata->m_type = type;
00097    m_pdata->m_numberOfElements = 1;
00098    m_pdata->m_sizeRange = SIZE_SINGLE;
00099 }
00101 CIMDataType::CIMDataType(CIMDataType::Type type, Int32 size) :
00102    CIMBase(), m_pdata(new DTData)
00103 {
00104    OW_ASSERT(type >= CIMNULL && type < MAXDATATYPE);
00105    m_pdata->m_type = type;
00106    m_pdata->m_numberOfElements = (size < 1) ? -1 : size;
00107    m_pdata->m_sizeRange = m_pdata->m_numberOfElements >= 1 ? SIZE_LIMITED
00108       : SIZE_UNLIMITED;
00109 }
00111 CIMDataType::CIMDataType(const CIMDataType& arg) :
00112    CIMBase(), m_pdata(arg.m_pdata) {}
00114 CIMDataType::~CIMDataType()
00115 {
00116 }
00118 void
00119 CIMDataType::setNull()
00120 {
00121    m_pdata = NULL;
00122 }
00124 CIMDataType&
00125 CIMDataType::operator = (const CIMDataType& arg)
00126 {
00127    m_pdata = arg.m_pdata;
00128    return *this;
00129 }
00131 bool
00132 CIMDataType::isArrayType() const
00133 {
00134    return (m_pdata->m_sizeRange != SIZE_SINGLE);
00135 }
00137 bool
00138 CIMDataType::isNumericType() const
00139 {
00140    return isNumericType(m_pdata->m_type);
00141 }
00143 // STATIC
00144 bool
00145 CIMDataType::isNumericType(CIMDataType::Type type)
00146 {
00147    switch (type)
00148    {
00149       case UINT8:
00150       case SINT8:
00151       case UINT16:
00152       case SINT16:
00153       case UINT32:
00154       case SINT32:
00155       case UINT64:
00156       case SINT64:
00157       case REAL32:
00158       case REAL64:
00159          return true;
00160       default:
00161          return false;
00162    }
00163    return false;
00164 }
00166 bool
00167 CIMDataType::isReferenceType() const
00168 {
00169    return (m_pdata->m_type == REFERENCE);
00170 }
00172 bool
00173 CIMDataType::isEmbeddedObjectType() const
00174 {
00175    return (m_pdata->m_type == EMBEDDEDINSTANCE || m_pdata->m_type == EMBEDDEDCLASS);
00176 }
00178 CIMDataType::Type
00179 CIMDataType::getType() const
00180 {
00181    return m_pdata->m_type;
00182 }
00184 Int32
00185 CIMDataType::getSize() const
00186 {
00187    return m_pdata->m_numberOfElements;
00188 }
00190 String
00191 CIMDataType::getRefClassName() const
00192 {
00193    return m_pdata->m_reference.toString();
00194 }
00196 CIMDataType::operator CIMDataType::safe_bool () const
00197 {
00198    safe_bool cc = 0;
00199    if (m_pdata)
00200    {
00201       cc = (m_pdata->m_type != CIMNULL && m_pdata->m_type != INVALID)
00202          ? &CIMDataType::m_pdata : 0;
00203    }
00204    return cc;
00205 }
00207 bool
00208 CIMDataType::operator!() const
00209 {
00210    bool cc = true;
00211    if (m_pdata)
00212    {
00213       cc = m_pdata->m_type == CIMNULL || m_pdata->m_type == INVALID;
00214    }
00215    return cc;
00216 }
00218 bool
00219 CIMDataType::setToArrayType(Int32 size)
00220 {
00221    m_pdata->m_numberOfElements = (size < 1) ? -1 : size;
00222    m_pdata->m_sizeRange = m_pdata->m_numberOfElements >= 1 ? SIZE_LIMITED
00223       : SIZE_UNLIMITED;
00224    return true;
00225 }
00227 bool
00228 CIMDataType::syncWithValue(const CIMValue& value)
00229 {
00230    if (!value && !(*this))
00231    {
00232       return false;
00233    }
00234    bool rv(false);
00235    if (!m_pdata)
00236    {
00237       m_pdata = new DTData;
00238       m_pdata->m_type = CIMNULL;
00239    }
00240    if (!value)
00241    {
00242       m_pdata->m_type = CIMNULL;
00243       m_pdata->m_numberOfElements = 0;
00244       m_pdata->m_sizeRange = SIZE_SINGLE;
00245       rv = true;
00246    }
00247    else
00248    {
00249       if ((m_pdata->m_type != value.getType())
00250          || (isArrayType() != value.isArray()))
00251       {
00252          m_pdata->m_type = value.getType();
00253          m_pdata->m_sizeRange = (value.isArray()) ? SIZE_UNLIMITED : SIZE_SINGLE;
00254          m_pdata->m_numberOfElements = (m_pdata->m_sizeRange == SIZE_UNLIMITED)
00255             ? -1 : 1;
00256          rv = true;
00257       }
00258    }
00259    return rv;
00260 }
00262 CIMDataType::CIMDataType(const CIMName& refClassName) :
00263    CIMBase(), m_pdata(new DTData)
00264 {
00265    m_pdata->m_type = REFERENCE;
00266    m_pdata->m_numberOfElements = 1;
00267    m_pdata->m_sizeRange = SIZE_SINGLE;
00268    m_pdata->m_reference = refClassName;
00269 }
00271 bool
00272 CIMDataType::equals(const CIMDataType& arg) const
00273 {
00274    return (m_pdata->m_type == arg.m_pdata->m_type
00275       && m_pdata->m_sizeRange == arg.m_pdata->m_sizeRange);
00276 }
00278 void
00279 CIMDataType::readObject(istream &istrm)
00280 {
00281    UInt32 type;
00282    UInt32 numberOfElements;
00283    UInt32 sizeRange;
00284    CIMName ref;
00285    CIMBase::readSig( istrm, OW_CIMDATATYPESIG );
00286    BinarySerialization::readLen(istrm, type);
00287    BinarySerialization::readLen(istrm, numberOfElements);
00288    BinarySerialization::readLen(istrm, sizeRange);
00289    ref.readObject(istrm);
00290    if (!m_pdata)
00291    {
00292       m_pdata = new DTData;
00293    }
00294    m_pdata->m_type = CIMDataType::Type(type);
00295    m_pdata->m_numberOfElements = numberOfElements;
00296    m_pdata->m_sizeRange = sizeRange;
00297    m_pdata->m_reference = ref;
00298 }
00300 void
00301 CIMDataType::writeObject(ostream &ostrm) const
00302 {
00303    CIMBase::writeSig( ostrm, OW_CIMDATATYPESIG );
00304    BinarySerialization::writeLen(ostrm, m_pdata->m_type);
00305    BinarySerialization::writeLen(ostrm, m_pdata->m_numberOfElements);
00306    BinarySerialization::writeLen(ostrm, m_pdata->m_sizeRange);
00307    m_pdata->m_reference.writeObject(ostrm);
00308 }
00310 String
00311 CIMDataType::toString() const
00312 {
00313    switch (m_pdata->m_type)
00314    {
00315       case UINT8: 
00316       return "uint8"; 
00317       break;
00318       
00319       case SINT8: 
00320       return "sint8"; 
00321       break;
00322       
00323       case UINT16: 
00324       return "uint16"; 
00325       break;
00326       
00327       case SINT16: 
00328       return "sint16"; 
00329       break;
00330       
00331       case UINT32: 
00332       return "uint32"; 
00333       break;
00334       
00335       case SINT32: 
00336       return "sint32"; 
00337       break;
00338       
00339       case UINT64: 
00340       return "uint64"; 
00341       break;
00342       
00343       case SINT64: 
00344       return "sint64"; 
00345       break;
00346       
00347       case REAL64: 
00348       return "real64"; 
00349       break;
00350       
00351       case REAL32: 
00352       return "real32"; 
00353       break;
00354       
00355       case CHAR16: 
00356       return "char16"; 
00357       break;
00358       
00359       case STRING: 
00360       return "string"; 
00361       break;
00362       
00363       case BOOLEAN: 
00364       return "boolean"; 
00365       break;
00366       
00367       case DATETIME: 
00368       return "datetime"; 
00369       break;
00370       
00371       case REFERENCE: 
00372       return "REF"; 
00373       break;
00374       
00375       case EMBEDDEDCLASS: 
00376       case EMBEDDEDINSTANCE: 
00377       return "string"; 
00378       break;
00379       
00380       default:
00381       return "** INVALID DATA TYPE IN CIMDATATYPE - toString **";
00382    }
00383 }
00385 String
00386 CIMDataType::toMOF() const
00387 {
00388    if (m_pdata->m_type == REFERENCE)
00389    {
00390       return m_pdata->m_reference.toString() + " REF";
00391    }
00392    else
00393    {
00394       return toString();
00395    }
00396 }
00397 
00399 String
00400 CIMDataType::getArrayMOF() const
00401 {
00402    if (!isArrayType())
00403    {
00404       return String();
00405    }
00406    if (m_pdata->m_sizeRange == SIZE_UNLIMITED)
00407    {
00408       return "[]";
00409    }
00410    StringBuffer rv("[");
00411    rv += getSize();
00412    rv += ']';
00413    return rv.releaseString();
00414 }
00416 // STATIC
00417 CIMDataType::Type
00418 CIMDataType::strToSimpleType(const String& strType)
00419 {
00420 // If you want to know what this function does, here's the old slow way it
00421 // used to be written.
00422 #if 0
00423    if (strType_.empty())
00424    {
00425       return INVALID;
00426    }
00427    OW_String strType(strType_);
00428    strType.toLowerCase();
00429    if (strType == "uint8")
00430    {
00431       return UINT8;
00432    }
00433    else if (strType == "sint8")
00434    {
00435       return SINT8;
00436    }
00437    else if (strType == "uint16")
00438    {
00439       return UINT16;
00440    }
00441    else if (strType == "sint16")
00442    {
00443       return SINT16;
00444    }
00445    else if (strType == "uint32")
00446    {
00447       return UINT32;
00448    }
00449    else if (strType == "sint32")
00450    {
00451       return SINT32;
00452    }
00453    else if (strType == "uint64")
00454    {
00455       return UINT64;
00456    }
00457    else if (strType == "sint64")
00458    {
00459       return SINT64;
00460    }
00461    else if (strType == "real64")
00462    {
00463       return REAL64;
00464    }
00465    else if (strType == "real32")
00466    {
00467       return REAL32;
00468    }
00469    else if (strType == "char16")
00470    {
00471       return CHAR16;
00472    }
00473    else if (strType == "string")
00474    {
00475       return STRING;
00476    }
00477    else if (strType == "boolean")
00478    {
00479       return BOOLEAN;
00480    }
00481    else if (strType == "datetime")
00482    {
00483       return DATETIME;
00484    }
00485    else if (strType == "ref")
00486    {
00487       return REFERENCE;
00488    }
00489    else if (strType == "reference")
00490    {
00491       return REFERENCE;
00492    }
00493    return INVALID;
00494 #endif
00495 // This function is heavily used, and needs to be as fast as possible, so it's
00496 // been re-written to use a lexer fsm.  The code was generated by re2c and
00497 // subsequently modified to not dereference the char one past the terminating
00498 // '\0' of the string (the commented out lines, if you care).
00499 // Yes, I know this is a maintenance nightmare, and if you ever need to change
00500 // this function it'll be a big PITA, but at the moment, I don't think this
00501 // function is really ever going to need to be modified, and it's quite a
00502 // hotspot performance wise, so I think the change will be worth it.
00503 // It's generated from the following re2c input:
00504 #if 0
00505    #define YYCTYPE char
00506    #define YYCURSOR     begin
00507    #define YYLIMIT       end
00508    #define YYMARKER     q
00509    #define YYFILL(n)
00510 
00511 start:
00533 #endif
00534 
00535    const char* begin = strType.c_str();
00536    const char* q(begin);
00537 
00538    #define YYCTYPE char
00539    #define YYCURSOR     begin
00540    #define YYLIMIT       begin
00541    #define YYMARKER     q
00542    #define YYFILL(n)
00543 
00544    {
00545    YYCTYPE yych;
00546    unsigned int yyaccept;
00547    goto yy0;
00548    ++YYCURSOR;
00549 yy0:
00550    if ((YYLIMIT - YYCURSOR) < 10) YYFILL(10);
00551    yych = *YYCURSOR;
00552    switch (yych){
00553    case 'B':   case 'b':   goto yy7;
00554    case 'C':   case 'c':   goto yy6;
00555    case 'D':   case 'd':   goto yy8;
00556    case 'R':   case 'r':   goto yy5;
00557    case 'S':   case 's':   goto yy4;
00558    case 'U':   case 'u':   goto yy2;
00559    default: goto yy9;
00560    }
00561 yy2:  yyaccept = 0;
00562    yych = *(YYMARKER = ++YYCURSOR);
00563    switch (yych){
00564    case 'I':   case 'i':   goto yy82;
00565    default: goto yy3;
00566    }
00567 yy3:
00568    { return INVALID; }
00569 yy4:  yyaccept = 0;
00570    yych = *(YYMARKER = ++YYCURSOR);
00571    switch (yych){
00572    case 'I':   case 'i':   goto yy58;
00573    case 'T':   case 't':   goto yy57;
00574    default: goto yy3;
00575    }
00576 yy5:  yyaccept = 0;
00577    yych = *(YYMARKER = ++YYCURSOR);
00578    switch (yych){
00579    case 'E':   case 'e':   goto yy35;
00580    default: goto yy3;
00581    }
00582 yy6:  yyaccept = 0;
00583    yych = *(YYMARKER = ++YYCURSOR);
00584    switch (yych){
00585    case 'H':   case 'h':   goto yy28;
00586    default: goto yy3;
00587    }
00588 yy7:  yyaccept = 0;
00589    yych = *(YYMARKER = ++YYCURSOR);
00590    switch (yych){
00591    case 'O':   case 'o':   goto yy20;
00592    default: goto yy3;
00593    }
00594 yy8:  yyaccept = 0;
00595    yych = *(YYMARKER = ++YYCURSOR);
00596    switch (yych){
00597    case 'A':   case 'a':   goto yy10;
00598    default: goto yy3;
00599    }
00600 yy9:  //yych = *++YYCURSOR;
00601    goto yy3;
00602 yy10: yych = *++YYCURSOR;
00603    switch (yych){
00604    case 'T':   case 't':   goto yy12;
00605    default: goto yy11;
00606    }
00607 yy11: YYCURSOR = YYMARKER;
00608    switch (yyaccept){
00609    case 0:  goto yy3;
00610    }
00611 yy12: yych = *++YYCURSOR;
00612    switch (yych){
00613    case 'E':   case 'e':   goto yy13;
00614    default: goto yy11;
00615    }
00616 yy13: yych = *++YYCURSOR;
00617    switch (yych){
00618    case 'T':   case 't':   goto yy14;
00619    default: goto yy11;
00620    }
00621 yy14: yych = *++YYCURSOR;
00622    switch (yych){
00623    case 'I':   case 'i':   goto yy15;
00624    default: goto yy11;
00625    }
00626 yy15: yych = *++YYCURSOR;
00627    switch (yych){
00628    case 'M':   case 'm':   goto yy16;
00629    default: goto yy11;
00630    }
00631 yy16: yych = *++YYCURSOR;
00632    switch (yych){
00633    case 'E':   case 'e':   goto yy17;
00634    default: goto yy11;
00635    }
00636 yy17: yych = *++YYCURSOR;
00637    if (yych >= '\001')  goto yy11;
00638    { return DATETIME; }
00639 yy20: yych = *++YYCURSOR;
00640    switch (yych){
00641    case 'O':   case 'o':   goto yy21;
00642    default: goto yy11;
00643    }
00644 yy21: yych = *++YYCURSOR;
00645    switch (yych){
00646    case 'L':   case 'l':   goto yy22;
00647    default: goto yy11;
00648    }
00649 yy22: yych = *++YYCURSOR;
00650    switch (yych){
00651    case 'E':   case 'e':   goto yy23;
00652    default: goto yy11;
00653    }
00654 yy23: yych = *++YYCURSOR;
00655    switch (yych){
00656    case 'A':   case 'a':   goto yy24;
00657    default: goto yy11;
00658    }
00659 yy24: yych = *++YYCURSOR;
00660    switch (yych){
00661    case 'N':   case 'n':   goto yy25;
00662    default: goto yy11;
00663    }
00664 yy25: yych = *++YYCURSOR;
00665    if (yych >= '\001')  goto yy11;
00666    { return BOOLEAN; }
00667 yy28: yych = *++YYCURSOR;
00668    switch (yych){
00669    case 'A':   case 'a':   goto yy29;
00670    default: goto yy11;
00671    }
00672 yy29: yych = *++YYCURSOR;
00673    switch (yych){
00674    case 'R':   case 'r':   goto yy30;
00675    default: goto yy11;
00676    }
00677 yy30: yych = *++YYCURSOR;
00678    switch (yych){
00679    case '1':   goto yy31;
00680    default: goto yy11;
00681    }
00682 yy31: yych = *++YYCURSOR;
00683    switch (yych){
00684    case '6':   goto yy32;
00685    default: goto yy11;
00686    }
00687 yy32: yych = *++YYCURSOR;
00688    if (yych >= '\001')  goto yy11;
00689    { return CHAR16; }
00690 yy35: yych = *++YYCURSOR;
00691    switch (yych){
00692    case 'A':   case 'a':   goto yy36;
00693    case 'F':   case 'f':   goto yy37;
00694    default: goto yy11;
00695    }
00696 yy36: yych = *++YYCURSOR;
00697    switch (yych){
00698    case 'L':   case 'l':   goto yy48;
00699    default: goto yy11;
00700    }
00701 yy37: yych = *++YYCURSOR;
00702    switch (yych){
00703    case '\000':   goto yy39;
00704    case 'E':   case 'e':   goto yy38;
00705    default: goto yy11;
00706    }
00707 yy38: yych = *++YYCURSOR;
00708    switch (yych){
00709    case 'R':   case 'r':   goto yy41;
00710    default: goto yy11;
00711    }
00712 yy39: //yych = *++YYCURSOR;
00713    { return REFERENCE; }
00714 yy41: yych = *++YYCURSOR;
00715    switch (yych){
00716    case 'E':   case 'e':   goto yy42;
00717    default: goto yy11;
00718    }
00719 yy42: yych = *++YYCURSOR;
00720    switch (yych){
00721    case 'N':   case 'n':   goto yy43;
00722    default: goto yy11;
00723    }
00724 yy43: yych = *++YYCURSOR;
00725    switch (yych){
00726    case 'C':   case 'c':   goto yy44;
00727    default: goto yy11;
00728    }
00729 yy44: yych = *++YYCURSOR;
00730    switch (yych){
00731    case 'E':   case 'e':   goto yy45;
00732    default: goto yy11;
00733    }
00734 yy45: yych = *++YYCURSOR;
00735    if (yych >= '\001')  goto yy11;
00736    { return REFERENCE; }
00737 yy48: yych = *++YYCURSOR;
00738    switch (yych){
00739    case '3':   goto yy49;
00740    case '6':   goto yy50;
00741    default: goto yy11;
00742    }
00743 yy49: yych = *++YYCURSOR;
00744    switch (yych){
00745    case '2':   goto yy54;
00746    default: goto yy11;
00747    }
00748 yy50: yych = *++YYCURSOR;
00749    switch (yych){
00750    case '4':   goto yy51;
00751    default: goto yy11;
00752    }
00753 yy51: yych = *++YYCURSOR;
00754    if (yych >= '\001')  goto yy11;
00755    { return REAL64; }
00756 yy54: yych = *++YYCURSOR;
00757    if (yych >= '\001')  goto yy11;
00758    { return REAL32; }
00759 yy57: yych = *++YYCURSOR;
00760    switch (yych){
00761    case 'R':   case 'r':   goto yy76;
00762    default: goto yy11;
00763    }
00764 yy58: yych = *++YYCURSOR;
00765    switch (yych){
00766    case 'N':   case 'n':   goto yy59;
00767    default: goto yy11;
00768    }
00769 yy59: yych = *++YYCURSOR;
00770    switch (yych){
00771    case 'T':   case 't':   goto yy60;
00772    default: goto yy11;
00773    }
00774 yy60: yych = *++YYCURSOR;
00775    switch (yych){
00776    case '1':   goto yy62;
00777    case '3':   goto yy63;
00778    case '6':   goto yy64;
00779    case '8':   goto yy61;
00780    default: goto yy11;
00781    }
00782 yy61: yych = *++YYCURSOR;
00783    if (yych <= '\000')  goto yy74;
00784    goto yy11;
00785 yy62: yych = *++YYCURSOR;
00786    switch (yych){
00787    case '6':   goto yy71;
00788    default: goto yy11;
00789    }
00790 yy63: yych = *++YYCURSOR;
00791    switch (yych){
00792    case '2':   goto yy68;
00793    default: goto yy11;
00794    }
00795 yy64: yych = *++YYCURSOR;
00796    switch (yych){
00797    case '4':   goto yy65;
00798    default: goto yy11;
00799    }
00800 yy65: yych = *++YYCURSOR;
00801    if (yych >= '\001')  goto yy11;
00802    { return SINT64; }
00803 yy68: yych = *++YYCURSOR;
00804    if (yych >= '\001')  goto yy11;
00805    { return SINT32; }
00806 yy71: yych = *++YYCURSOR;
00807    if (yych >= '\001')  goto yy11;
00808    { return SINT16; }
00809 yy74: //yych = *++YYCURSOR;
00810    { return SINT8; }
00811 yy76: yych = *++YYCURSOR;
00812    switch (yych){
00813    case 'I':   case 'i':   goto yy77;
00814    default: goto yy11;
00815    }
00816 yy77: yych = *++YYCURSOR;
00817    switch (yych){
00818    case 'N':   case 'n':   goto yy78;
00819    default: goto yy11;
00820    }
00821 yy78: yych = *++YYCURSOR;
00822    switch (yych){
00823    case 'G':   case 'g':   goto yy79;
00824    default: goto yy11;
00825    }
00826 yy79: yych = *++YYCURSOR;
00827    if (yych >= '\001')  goto yy11;
00828    { return STRING; }
00829 yy82: yych = *++YYCURSOR;
00830    switch (yych){
00831    case 'N':   case 'n':   goto yy83;
00832    default: goto yy11;
00833    }
00834 yy83: yych = *++YYCURSOR;
00835    switch (yych){
00836    case 'T':   case 't':   goto yy84;
00837    default: goto yy11;
00838    }
00839 yy84: yych = *++YYCURSOR;
00840    switch (yych){
00841    case '1':   goto yy86;
00842    case '3':   goto yy87;
00843    case '6':   goto yy88;
00844    case '8':   goto yy85;
00845    default: goto yy11;
00846    }
00847 yy85: yych = *++YYCURSOR;
00848    if (yych <= '\000')  goto yy98;
00849    goto yy11;
00850 yy86: yych = *++YYCURSOR;
00851    switch (yych){
00852    case '6':   goto yy95;
00853    default: goto yy11;
00854    }
00855 yy87: yych = *++YYCURSOR;
00856    switch (yych){
00857    case '2':   goto yy92;
00858    default: goto yy11;
00859    }
00860 yy88: yych = *++YYCURSOR;
00861    switch (yych){
00862    case '4':   goto yy89;
00863    default: goto yy11;
00864    }
00865 yy89: yych = *++YYCURSOR;
00866    if (yych >= '\001')  goto yy11;
00867    { return UINT64; }
00868 yy92: yych = *++YYCURSOR;
00869    if (yych >= '\001')  goto yy11;
00870    { return UINT32; }
00871 yy95: yych = *++YYCURSOR;
00872    if (yych >= '\001')  goto yy11;
00873    { return UINT16; }
00874 yy98: //yych = *++YYCURSOR;
00875    { return UINT8; }
00876 }
00877 }
00879 // STATIC
00880 CIMDataType
00881 CIMDataType::getDataType(const String& strType)
00882 {
00883    if (strType.empty())
00884    {
00885       return CIMDataType();
00886    }
00887    Type type = strToSimpleType(strType);
00888    if (type != INVALID)
00889    {
00890       return CIMDataType(type);
00891    }
00892    return CIMDataType(CIMNULL);
00893 }
00894 
00896 bool operator<(const CIMDataType& x, const CIMDataType& y)
00897 {
00898    return *x.m_pdata < *y.m_pdata;
00899 }
00900 
00902 bool operator==(const CIMDataType& x, const CIMDataType& y)
00903 {
00904    return *x.m_pdata == *y.m_pdata;
00905 }
00906 
00908 bool operator<=(const CIMDataType& x, const CIMDataType& y)
00909 {
00910     return !(y < x);
00911 }
00912 
00914 bool operator>(const CIMDataType& x, const CIMDataType& y)
00915 {
00916     return y < x;
00917 }
00918 
00920 bool operator>=(const CIMDataType& x, const CIMDataType& y)
00921 {
00922     return !(x < y);
00923 }
00924 
00926 bool operator!=(const CIMDataType& x, const CIMDataType& y)
00927 {
00928    return !(x == y);
00929 }
00930 
00931 } // end namespace OW_NAMESPACE
00932 

Generated on Thu Feb 9 08:47:53 2006 for openwbem by  doxygen 1.4.6