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

Diff for /pegasus/src/Pegasus/Common/CIMValue.cpp between version 1.49.4.1 and 1.50

version 1.49.4.1, 2004/11/12 17:48:28 version 1.50, 2004/10/17 20:39:17
Line 1 
Line 1 
 //%2003////////////////////////////////////////////////////////////////////////  //%2004////////////////////////////////////////////////////////////////////////
 // //
 // Copyright (c) 2000, 2001, 2002  BMC Software, Hewlett-Packard Development  // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
 // Company, L. P., IBM Corp., The Open Group, Tivoli Systems.  // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
 // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L. P.; // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L. P.;
 // IBM Corp.; EMC Corporation, The Open Group. // IBM Corp.; EMC Corporation, The Open Group.
   // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
   // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
 // //
 // Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to // of this software and associated documentation files (the "Software"), to
Line 114 
Line 116 
     out << x.toString();     out << x.toString();
 } }
  
 inline void _toString(Array<Sint8>& out, const CIMObject& x)  
 {  
     out << x.toString();  
 }  
   
 template<class T> template<class T>
 void _toString(Array<Sint8>& out, const T* p, Uint32 size) void _toString(Array<Sint8>& out, const T* p, Uint32 size)
 { {
Line 237 
Line 234 
     set(x);     set(x);
 } }
  
 CIMValue::CIMValue(const CIMObject& x)  
 {  
     _rep = new CIMValueRep();  
     set(x);  
 }  
   
 CIMValue::CIMValue(const Array<Boolean>& x) CIMValue::CIMValue(const Array<Boolean>& x)
 { {
     _rep = new CIMValueRep();     _rep = new CIMValueRep();
Line 333 
Line 324 
     set(x);     set(x);
 } }
  
 CIMValue::CIMValue(const Array<CIMObject>& x)  
 {  
     _rep = new CIMValueRep();  
     set(x);  
 }  
   
 CIMValue::CIMValue(const CIMValue& x) CIMValue::CIMValue(const CIMValue& x)
 { {
     _rep = new CIMValueRep();     _rep = new CIMValueRep();
Line 447 
Line 432 
                     new Array<CIMObjectPath>(*(x._rep->_u._referenceArray));                     new Array<CIMObjectPath>(*(x._rep->_u._referenceArray));
                 break;                 break;
  
         case CIMTYPE_OBJECT:  
                 _rep->_u._cimobjectArray =  
                     new Array<CIMObject>(*(x._rep->_u._cimobjectArray));  
                 break;  
   
             default:             default:
                 PEGASUS_ASSERT(false);                 PEGASUS_ASSERT(false);
         }         }
Line 522 
Line 502 
                     new CIMObjectPath(*(x._rep->_u._referenceValue));                     new CIMObjectPath(*(x._rep->_u._referenceValue));
                 break;                 break;
  
             case CIMTYPE_OBJECT:  
                 _rep->_u._cimobjectValue =  
                     new CIMObject(x._rep->_u._cimobjectValue->clone());  
                 break;  
   
             // Should never get here. testing complete enum             // Should never get here. testing complete enum
             default:             default:
                 PEGASUS_ASSERT(false);                 PEGASUS_ASSERT(false);
Line 600 
Line 575 
                 delete _rep->_u._referenceArray;                 delete _rep->_u._referenceArray;
                 break;                 break;
  
             case CIMTYPE_OBJECT:  
                 delete _rep->_u._cimobjectArray;  
                 break;  
   
             default:             default:
                 PEGASUS_ASSERT(false);                 PEGASUS_ASSERT(false);
         }         }
Line 638 
Line 609 
                 delete _rep->_u._referenceValue;                 delete _rep->_u._referenceValue;
                 break;                 break;
  
             case CIMTYPE_OBJECT:  
                 delete _rep->_u._cimobjectValue;  
                 break;  
   
             default:             default:
                 PEGASUS_ASSERT(false);                 PEGASUS_ASSERT(false);
         }         }
Line 734 
Line 701 
             return _rep->_u._referenceArray->size();             return _rep->_u._referenceArray->size();
             break;             break;
  
         case CIMTYPE_OBJECT:  
             return _rep->_u._cimobjectArray->size();  
             break;  
   
         //default:  // Handled below         //default:  // Handled below
     }     }
  
Line 819 
Line 782 
                 set(Array<CIMObjectPath>(arraySize));                 set(Array<CIMObjectPath>(arraySize));
                 break;                 break;
  
             case CIMTYPE_OBJECT:  
                 set(Array<CIMObject>(arraySize));  
                 break;  
   
             default:             default:
                 throw TypeMismatchException();                 throw TypeMismatchException();
         }         }
Line 891 
Line 850 
                 set(CIMObjectPath());                 set(CIMObjectPath());
                 break;                 break;
  
             case CIMTYPE_OBJECT:  
                 set(CIMObject());  
                 break;  
   
             default:             default:
                 throw TypeMismatchException();                 throw TypeMismatchException();
         }         }
Line 1026 
Line 981 
     _rep->_isNull = false;     _rep->_isNull = false;
 } }
  
 void CIMValue::set(const CIMObject& x)  
 {  
     clear();  
     if (x.isUninitialized()) {  
         // Don't need to clone since null CIMObjects aren't shared when created.  
         // Doesn't work anyway, clone() throws an exception if null.  
         _rep->_u._cimobjectValue = new CIMObject(x);  
     }  
     else {  
         _rep->_u._cimobjectValue = new CIMObject(x.clone());  
     }  
     _rep->_type = CIMTYPE_OBJECT;  
     _rep->_isNull = false;  
 }  
   
 void CIMValue::set(const Array<Boolean>& x) void CIMValue::set(const Array<Boolean>& x)
 { {
     clear();     clear();
Line 1176 
Line 1116 
     _rep->_isNull = false;     _rep->_isNull = false;
 } }
  
 void CIMValue::set(const Array<CIMObject>& x)  
 {  
     clear();  
     _rep->_u._cimobjectArray = new Array<CIMObject>(x);  
     _rep->_type = CIMTYPE_OBJECT;  
     _rep->_isArray = true;  
     _rep->_isNull = false;  
 }  
   
 void CIMValue::get(Boolean& x) const void CIMValue::get(Boolean& x) const
 { {
     if (_rep->_type != CIMTYPE_BOOLEAN || _rep->_isArray)     if (_rep->_type != CIMTYPE_BOOLEAN || _rep->_isArray)
Line 1320 
Line 1251 
         x = *_rep->_u._referenceValue;         x = *_rep->_u._referenceValue;
 } }
  
 void CIMValue::get(CIMObject& x) const  
 {  
     if (_rep->_type != CIMTYPE_OBJECT || _rep->_isArray)  
         throw TypeMismatchException();  
   
     if (!_rep->_isNull)  
         x = *_rep->_u._cimobjectValue;  
 }  
   
 void CIMValue::get(Array<Boolean>& x) const void CIMValue::get(Array<Boolean>& x) const
 { {
     if (_rep->_type != CIMTYPE_BOOLEAN || !_rep->_isArray)     if (_rep->_type != CIMTYPE_BOOLEAN || !_rep->_isArray)
Line 1464 
Line 1386 
         x = *_rep->_u._referenceArray;         x = *_rep->_u._referenceArray;
 } }
  
 void CIMValue::get(Array<CIMObject>& x) const  
 {  
     if (_rep->_type != CIMTYPE_OBJECT || !_rep->_isArray)  
         throw TypeMismatchException();  
   
     if (!_rep->_isNull)  
         x = *_rep->_u._cimobjectArray;  
 }  
   
 Boolean CIMValue::equal(const CIMValue& x) const Boolean CIMValue::equal(const CIMValue& x) const
 { {
     if (!typeCompatible(x))     if (!typeCompatible(x))
Line 1545 
Line 1458 
                 return (*_rep->_u._referenceArray) ==                 return (*_rep->_u._referenceArray) ==
                     (*x._rep->_u._referenceArray);                     (*x._rep->_u._referenceArray);
  
             case CIMTYPE_OBJECT:  
                 return (*_rep->_u._cimobjectArray) ==  
                     (*x._rep->_u._cimobjectArray);  
   
             default:             default:
                 PEGASUS_ASSERT(false);                 PEGASUS_ASSERT(false);
         }         }
Line 1604 
Line 1513 
                 return *_rep->_u._referenceValue ==                 return *_rep->_u._referenceValue ==
                     *x._rep->_u._referenceValue;                     *x._rep->_u._referenceValue;
  
             case CIMTYPE_OBJECT:  
                 return (*_rep->_u._cimobjectValue).identical((*x._rep->_u._cimobjectValue));  
   
             default:             default:
                 PEGASUS_ASSERT(false);                 PEGASUS_ASSERT(false);
         }         }
Line 1710 
Line 1616 
                                _rep->_u._referenceArray->size());                                _rep->_u._referenceArray->size());
                 break;                 break;
  
             case CIMTYPE_OBJECT:  
                 _toString(out, _rep->_u._cimobjectArray->getData(),  
                                _rep->_u._cimobjectArray->size());  
                 break;  
   
             default:             default:
                 PEGASUS_ASSERT(false);                 PEGASUS_ASSERT(false);
         }         }
Line 1783 
Line 1684 
                 _toString(out, *_rep->_u._referenceValue);                 _toString(out, *_rep->_u._referenceValue);
                 break;                 break;
  
             case CIMTYPE_OBJECT:  
                 _toString(out, *_rep->_u._cimobjectValue);  
                 break;  
   
             default:             default:
                 PEGASUS_ASSERT(false);                 PEGASUS_ASSERT(false);
         }         }


Legend:
Removed from v.1.49.4.1  
changed lines
  Added in v.1.50

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2