(file) Return to SCMO.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

Diff for /pegasus/src/Pegasus/Common/SCMO.cpp between version 1.2.2.56 and 1.2.2.57

version 1.2.2.56, 2009/10/30 11:20:57 version 1.2.2.57, 2009/10/30 12:29:47
Line 83 
Line 83 
 #define NULLSTR(x) ((x) == 0 ? "" : (x)) #define NULLSTR(x) ((x) == 0 ? "" : (x))
  
 #define NEWCIMSTR(ptr,base) \ #define NEWCIMSTR(ptr,base) \
       ((ptr).length == 0 ?  \        ((ptr).size == 0 ?  \
       (String()) :           \       (String()) :           \
       (String(&(base)[(ptr).start],((ptr).length)-1)))        (String(&(base)[(ptr).start],((ptr).size)-1)))
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
Line 226 
Line 226 
     SCMBUnion* ptr;     SCMBUnion* ptr;
     // if the array was already set,     // if the array was already set,
     // the previous references has to be deleted     // the previous references has to be deleted
     if(theArray.length != 0)      if(theArray.size != 0)
     {     {
         Uint32 oldArraySize=(theArray.length/sizeof(SCMBUnion));          Uint32 oldArraySize=(theArray.size/sizeof(SCMBUnion));
  
         ptr = (SCMBUnion*)&(((char*)*pmem)[theArray.start]);         ptr = (SCMBUnion*)&(((char*)*pmem)[theArray.start]);
         for (Uint32 i = 0 ; i < oldArraySize ; i++)         for (Uint32 i = 0 ; i < oldArraySize ; i++)
Line 245 
Line 245 
     SCMBUnion* ptr;     SCMBUnion* ptr;
     // if the array was already set,     // if the array was already set,
     // the previous references has to be deleted     // the previous references has to be deleted
     if(theArray.length != 0)      if(theArray.size != 0)
     {     {
         Uint32 oldArraySize=(theArray.length/sizeof(SCMBUnion));          Uint32 oldArraySize=(theArray.size/sizeof(SCMBUnion));
  
         ptr = (SCMBUnion*)&(((char*)*pmem)[theArray.start]);         ptr = (SCMBUnion*)&(((char*)*pmem)[theArray.start]);
         for (Uint32 i = 0 ; i < oldArraySize ; i++)         for (Uint32 i = 0 ; i < oldArraySize ; i++)
Line 377 
Line 377 
     {     {
         // there is no Super ClassName         // there is no Super ClassName
         cls.hdr->superClassName.start=0;         cls.hdr->superClassName.start=0;
         cls.hdr->superClassName.length=0;          cls.hdr->superClassName.size=0;
     }     }
  
     CIMObjectPath theObjectPath=theCIMClass.getPath();     CIMObjectPath theObjectPath=theCIMClass.getPath();
Line 417 
Line 417 
  
 const char* SCMOClass::getSuperClassName_l(Uint64 & length) const const char* SCMOClass::getSuperClassName_l(Uint64 & length) const
 { {
     length = cls.hdr->superClassName.length-1;      length = cls.hdr->superClassName.size-1;
     return _getCharString(cls.hdr->superClassName,cls.base);     return _getCharString(cls.hdr->superClassName,cls.base);
 } }
  
Line 786 
Line 786 
         else         else
         {         {
             cls.hdr->keyBindingSet.nodeArray.start=0;             cls.hdr->keyBindingSet.nodeArray.start=0;
             cls.hdr->keyBindingSet.nodeArray.length=0;              cls.hdr->keyBindingSet.nodeArray.size=0;
         }         }
     }     }
     else     else
     {     {
         cls.hdr->propertySet.nodeArray.start=0;         cls.hdr->propertySet.nodeArray.start=0;
         cls.hdr->propertySet.nodeArray.length=0;          cls.hdr->propertySet.nodeArray.size=0;
         cls.hdr->keyPropertyMask.start=0;         cls.hdr->keyPropertyMask.start=0;
         cls.hdr->keyPropertyMask.length=0;          cls.hdr->keyPropertyMask.size=0;
         cls.hdr->keyBindingSet.nodeArray.start=0;         cls.hdr->keyBindingSet.nodeArray.start=0;
         cls.hdr->keyBindingSet.nodeArray.length=0;          cls.hdr->keyBindingSet.nodeArray.size=0;
     }     }
 } }
  
Line 1057 
Line 1057 
     else     else
     {     {
         scmoPropNode->theProperty.qualifierArray.start=0;         scmoPropNode->theProperty.qualifierArray.start=0;
         scmoPropNode->theProperty.qualifierArray.length=0;          scmoPropNode->theProperty.qualifierArray.size=0;
     }     }
  
     return isKey;     return isKey;
Line 1088 
Line 1088 
     else     else
     {     {
         cls.hdr->qualifierArray.start=0;         cls.hdr->qualifierArray.start=0;
         cls.hdr->qualifierArray.length=0;          cls.hdr->qualifierArray.size=0;
     }     }
 } }
  
Line 1152 
Line 1152 
             // Is set to the number of array members by the function.             // Is set to the number of array members by the function.
             scmoValue->valueArraySize,             scmoValue->valueArraySize,
             cls.hdr->nameSpace.start,             cls.hdr->nameSpace.start,
             cls.hdr->nameSpace.length,              cls.hdr->nameSpace.size,
             rep->u);             rep->u);
     }     }
     else     else
Line 1162 
Line 1162 
             &cls.mem,             &cls.mem,
             rep->type,             rep->type,
             cls.hdr->nameSpace.start,             cls.hdr->nameSpace.start,
             cls.hdr->nameSpace.length,              cls.hdr->nameSpace.size,
             rep->u);             rep->u);
     }     }
 } }
Line 2223 
Line 2223 
             // Is set to the number of array members by the function.             // Is set to the number of array members by the function.
             theInstProp.valueArraySize,             theInstProp.valueArraySize,
             inst.hdr->instNameSpace.start,             inst.hdr->instNameSpace.start,
             inst.hdr->instNameSpace.length,              inst.hdr->instNameSpace.size,
             valRep->u);             valRep->u);
     }     }
     else     else
Line 2233 
Line 2233 
             &inst.mem,             &inst.mem,
             realType,             realType,
             inst.hdr->instNameSpace.start,             inst.hdr->instNameSpace.start,
             inst.hdr->instNameSpace.length,              inst.hdr->instNameSpace.size,
             valRep->u);             valRep->u);
     }     }
 } }
Line 2262 
Line 2262 
  
     }     }
     inst.hdr->hostName.start=0;     inst.hdr->hostName.start=0;
     inst.hdr->hostName.length=0;      inst.hdr->hostName.size=0;
 } }
  
 void SCMOInstance::setHostName_l(const char* hostName, Uint32 len) void SCMOInstance::setHostName_l(const char* hostName, Uint32 len)
Line 2278 
Line 2278 
  
 const char* SCMOInstance::getHostName_l(Uint64& length) const const char* SCMOInstance::getHostName_l(Uint64& length) const
 { {
     length = inst.hdr->hostName.length-1;      length = inst.hdr->hostName.size-1;
     return _getCharString(inst.hdr->hostName,inst.base);     return _getCharString(inst.hdr->hostName,inst.base);
 } }
  
Line 2312 
Line 2312 
  
 const char* SCMOInstance::getClassName_l(Uint64 & length) const const char* SCMOInstance::getClassName_l(Uint64 & length) const
 { {
     length = inst.hdr->instClassName.length-1;      length = inst.hdr->instClassName.size-1;
     return _getCharString(inst.hdr->instClassName,inst.base);     return _getCharString(inst.hdr->instClassName,inst.base);
 } }
  
Line 2338 
Line 2338 
     }     }
  
     inst.hdr->instNameSpace.start=0;     inst.hdr->instNameSpace.start=0;
     inst.hdr->instNameSpace.length=0;      inst.hdr->instNameSpace.size=0;
 } }
  
 void SCMOInstance::setNameSpace_l(const char* nameSpace, Uint32 len) void SCMOInstance::setNameSpace_l(const char* nameSpace, Uint32 len)
Line 2356 
Line 2356 
  
 const char* SCMOInstance::getNameSpace_l(Uint64 & length) const const char* SCMOInstance::getNameSpace_l(Uint64 & length) const
 { {
     length = inst.hdr->instNameSpace.length-1;      length = inst.hdr->instNameSpace.size-1;
     return _getCharString(inst.hdr->instNameSpace,inst.base);     return _getCharString(inst.hdr->instNameSpace,inst.base);
 } }
  
Line 2440 
Line 2440 
             keyData.isSet=true;             keyData.isSet=true;
             _setBinary(             _setBinary(
                 &uBase[u.stringValue.start],                 &uBase[u.stringValue.start],
                 u.stringValue.length,                  u.stringValue.size,
                 keyData.data.stringValue,                 keyData.data.stringValue,
                 &inst.mem);                 &inst.mem);
             break;             break;
Line 2511 
Line 2511 
     _setBinary(     _setBinary(
         _getCharString(inst.hdr->theClass->cls.hdr->className,         _getCharString(inst.hdr->theClass->cls.hdr->className,
                        inst.hdr->theClass->cls.base),                        inst.hdr->theClass->cls.base),
         inst.hdr->theClass->cls.hdr->className.length,          inst.hdr->theClass->cls.hdr->className.size,
         inst.hdr->instClassName,         inst.hdr->instClassName,
         &inst.mem);         &inst.mem);
  
     _setBinary(     _setBinary(
         _getCharString(inst.hdr->theClass->cls.hdr->nameSpace,         _getCharString(inst.hdr->theClass->cls.hdr->nameSpace,
                        inst.hdr->theClass->cls.base),                        inst.hdr->theClass->cls.base),
         inst.hdr->theClass->cls.hdr->nameSpace.length,          inst.hdr->theClass->cls.hdr->nameSpace.size,
         inst.hdr->instNameSpace,         inst.hdr->instNameSpace,
         &inst.mem);         &inst.mem);
  
Line 3812 
Line 3812 
         // Copy the host name to tha new instance-         // Copy the host name to tha new instance-
         _setBinary(         _setBinary(
             _resolveDataPtr(this->inst.hdr->hostName,this->inst.base),             _resolveDataPtr(this->inst.hdr->hostName,this->inst.base),
             this->inst.hdr->hostName.length,              this->inst.hdr->hostName.size,
             newInst.inst.hdr->hostName,             newInst.inst.hdr->hostName,
             &newInst.inst.mem);             &newInst.inst.mem);
  
Line 3825 
Line 3825 
             // Copy the class name to tha new instance-             // Copy the class name to tha new instance-
             _setBinary(             _setBinary(
                 _resolveDataPtr(this->inst.hdr->instClassName,this->inst.base),                 _resolveDataPtr(this->inst.hdr->instClassName,this->inst.base),
                 this->inst.hdr->instClassName.length,                  this->inst.hdr->instClassName.size,
                 newInst.inst.hdr->instClassName,                 newInst.inst.hdr->instClassName,
                 &newInst.inst.mem);                 &newInst.inst.mem);
  
             // Copy the name space name to tha new instance-             // Copy the name space name to tha new instance-
             _setBinary(             _setBinary(
                 _resolveDataPtr(this->inst.hdr->instNameSpace,this->inst.base),                 _resolveDataPtr(this->inst.hdr->instNameSpace,this->inst.base),
                 this->inst.hdr->instNameSpace.length,                  this->inst.hdr->instNameSpace.size,
                 newInst.inst.hdr->instNameSpace,                 newInst.inst.hdr->instNameSpace,
                 &newInst.inst.mem);                 &newInst.inst.mem);
         }         }
Line 3926 
Line 3926 
     ptrNewElement = _getUserDefinedKeyBinding(     ptrNewElement = _getUserDefinedKeyBinding(
         _getCharString(theInsertElement.name,elementBase),         _getCharString(theInsertElement.name,elementBase),
         // lenght is without the trailing '\0'         // lenght is without the trailing '\0'
         theInsertElement.name.length-1,          theInsertElement.name.size-1,
         theInsertElement.type);         theInsertElement.type);
  
     // Copy the data     // Copy the data
Line 3991 
Line 3991 
         //   to the next element of the new element.         //   to the next element of the new element.
         ptrNewElement->nextElement.start =         ptrNewElement->nextElement.start =
             inst.hdr->userKeyBindingElement.start;             inst.hdr->userKeyBindingElement.start;
         ptrNewElement->nextElement.length =          ptrNewElement->nextElement.size =
             inst.hdr->userKeyBindingElement.length;              inst.hdr->userKeyBindingElement.size;
         // - Assing the the new element         // - Assing the the new element
         //   to the  start point of user key binding element chain         //   to the  start point of user key binding element chain
         inst.hdr->userKeyBindingElement.start = newElement.start;         inst.hdr->userKeyBindingElement.start = newElement.start;
         inst.hdr->userKeyBindingElement.length = newElement.length;          inst.hdr->userKeyBindingElement.size = newElement.size;
         // Adjust the couter of user defined key bindings.         // Adjust the couter of user defined key bindings.
         inst.hdr->numberUserKeyBindings++;         inst.hdr->numberUserKeyBindings++;
  
Line 4099 
Line 4099 
                     ptr[i].extString.pchar =                     ptr[i].extString.pchar =
                         (char*)_getCharString(av[i].stringValue,base);                         (char*)_getCharString(av[i].stringValue,base);
                     // lenght with out the trailing /0 !                     // lenght with out the trailing /0 !
                     ptr[i].extString.length = av[i].stringValue.length-1;                      ptr[i].extString.length = av[i].stringValue.size-1;
                 }                 }
             }             }
             else             else
Line 4108 
Line 4108 
                 ptr->extString.pchar =                 ptr->extString.pchar =
                     (char*)_getCharString(u->stringValue,base);                     (char*)_getCharString(u->stringValue,base);
                 // lenght with out the trailing /0 !                 // lenght with out the trailing /0 !
                 ptr->extString.length = u->stringValue.length-1;                  ptr->extString.length = u->stringValue.size-1;
             }             }
  
              return(ptr);              return(ptr);
Line 4230 
Line 4230 
         type = theClassKeyBindNodeArray[node].type;         type = theClassKeyBindNodeArray[node].type;
  
         // First resolve pointer to the key binding name         // First resolve pointer to the key binding name
         pnameLen = theClassKeyBindNodeArray[node].name.length;          pnameLen = theClassKeyBindNodeArray[node].name.size;
         *pname = _getCharString(         *pname = _getCharString(
             theClassKeyBindNodeArray[node].name,             theClassKeyBindNodeArray[node].name,
             inst.hdr->theClass->cls.base);             inst.hdr->theClass->cls.base);
Line 4250 
Line 4250 
  
         type = theElem->type;         type = theElem->type;
  
         pnameLen = theElem->name.length;          pnameLen = theElem->name.size;
         *pname = _getCharString(theElem->name,inst.base);         *pname = _getCharString(theElem->name,inst.base);
  
         // There is no value set in the instance         // There is no value set in the instance
Line 4577 
Line 4577 
             SCMOClass* theRefClass = _getSCMOClass(             SCMOClass* theRefClass = _getSCMOClass(
                 theCIMObj,                 theCIMObj,
                 _getCharString(inst.hdr->instNameSpace,inst.base),                 _getCharString(inst.hdr->instNameSpace,inst.base),
                 inst.hdr->instNameSpace.length-1);                  inst.hdr->instNameSpace.size-1);
  
             if (theRefClass != 0)             if (theRefClass != 0)
             {             {
Line 6143 
Line 6143 
             SCMBDataPtr* p = (SCMBDataPtr*)&(base[u.arrayValue.start]);             SCMBDataPtr* p = (SCMBDataPtr*)&(base[u.arrayValue.start]);
             for (Uint32 i = 0; i < size; i++)             for (Uint32 i = 0; i < size; i++)
             {             {
                 if ( 0 != p[i].length)                  if ( 0 != p[i].size)
                 {                 {
                     out.append('\'');                     out.append('\'');
                     out.append((const char*)_getCharString(p[i],base),                     out.append((const char*)_getCharString(p[i],base),
                                p[i].length-1);                                 p[i].size-1);
                     out.append('\'');                     out.append('\'');
                 }                 }
                 else                 else
Line 6314 
Line 6314 
  
     case CIMTYPE_STRING:     case CIMTYPE_STRING:
         {         {
             if ( 0 != u.stringValue.length)              if ( 0 != u.stringValue.size)
             {             {
                 out.append((const char*)_getCharString(u.stringValue,base),                 out.append((const char*)_getCharString(u.stringValue,base),
                            u.stringValue.length-1);                             u.stringValue.size-1);
             }             }
             fprintf(_out,"\nThe Value is: '%s'",out.getData());             fprintf(_out,"\nThe Value is: '%s'",out.getData());
             break;             break;
Line 6479 
Line 6479 
     if (size == 0)     if (size == 0)
     {     {
         ptr.start = 0;         ptr.start = 0;
         ptr.length = 0;          ptr.size = 0;
         return 0;         return 0;
     }     }
  
     // The SCMBDataPtr has to be set before any reallocation.     // The SCMBDataPtr has to be set before any reallocation.
     start = (*pmem)->startOfFreeSpace;     start = (*pmem)->startOfFreeSpace;
     ptr.start = start;     ptr.start = start;
     ptr.length = size;      ptr.size = size;
  
     while ((*pmem)->freeBytes < size)     while ((*pmem)->freeBytes < size)
     {     {
Line 6543 
Line 6543 
     else     else
     {     {
         ptr.start = 0;         ptr.start = 0;
         ptr.length = 0;          ptr.size = 0;
     }     }
 } }
  
Line 6572 
Line 6572 
     else     else
     {     {
         ptr.start = 0;         ptr.start = 0;
         ptr.length = 0;          ptr.size = 0;
     }     }
 } }
  


Legend:
Removed from v.1.2.2.56  
changed lines
  Added in v.1.2.2.57

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2