version 1.2.2.56, 2009/10/30 11:20:57
|
version 1.2.2.57, 2009/10/30 12:29:47
|
|
|
#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 |
| |
|
|
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++) |
|
|
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++) |
|
|
{ | { |
// 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(); |
|
|
| |
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); |
} | } |
| |
|
|
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; |
} | } |
} | } |
| |
|
|
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; |
|
|
else | else |
{ | { |
cls.hdr->qualifierArray.start=0; | cls.hdr->qualifierArray.start=0; |
cls.hdr->qualifierArray.length=0; |
cls.hdr->qualifierArray.size=0; |
} | } |
} | } |
| |
|
|
// 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 |
|
|
&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); |
} | } |
} | } |
|
|
// 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 |
|
|
&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); |
} | } |
} | } |
|
|
| |
} | } |
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) |
|
|
| |
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); |
} | } |
| |
|
|
| |
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); |
} | } |
| |
|
|
} | } |
| |
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) |
|
|
| |
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); |
} | } |
| |
|
|
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; |
|
|
_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); |
| |
|
|
// 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); |
| |
|
|
// 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); |
} | } |
|
|
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 |
|
|
// 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++; |
| |
|
|
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 |
|
|
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); |
|
|
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); |
|
|
| |
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 |
|
|
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) |
{ | { |
|
|
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 |
|
|
| |
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; |
|
|
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) |
{ | { |
|
|
else | else |
{ | { |
ptr.start = 0; | ptr.start = 0; |
ptr.length = 0; |
ptr.size = 0; |
} | } |
} | } |
| |
|
|
else | else |
{ | { |
ptr.start = 0; | ptr.start = 0; |
ptr.length = 0; |
ptr.size = 0; |
} | } |
} | } |
| |