(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.14 and 1.15

version 1.14, 2002/02/18 14:35:07 version 1.15, 2002/02/20 23:14:18
Line 354 
Line 354 
 inline void _toXml(Array<Sint8>& out, const CIMDateTime& x) { _toString(out, x); } inline void _toXml(Array<Sint8>& out, const CIMDateTime& x) { _toString(out, x); }
 inline void _toMof(Array<Sint8>& out, const CIMDateTime& x) { _toString(out, x); } inline void _toMof(Array<Sint8>& out, const CIMDateTime& x) { _toString(out, x); }
  
   inline void _toString(Array<Sint8>& out, const CIMReference& x)
   {
       out << x.toString();
   }
   inline void _toXml(Array<Sint8>& out, const CIMReference& x)
   {
       x.toXml(out);
   }
   // ATTN-RK-P2-20020220: What does toMof look like for an array of references?
   
 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 497 
Line 507 
             case CIMType::DATETIME:             case CIMType::DATETIME:
                 _Inc(_u._dateTimeArray = x._u._dateTimeArray);                 _Inc(_u._dateTimeArray = x._u._dateTimeArray);
                 break;                 break;
   
               case CIMType::REFERENCE:
                   _Inc(_u._referenceArray = x._u._referenceArray);
                   break;
             default:             default:
                 throw CIMValueInvalidType();                 throw CIMValueInvalidType();
         }         }
Line 642 
Line 656 
             break;             break;
  
         case CIMType::REFERENCE:         case CIMType::REFERENCE:
             return 0;              return _u._referenceArray->size;
               break;
   
         default:         default:
             throw CIMValueInvalidType();             throw CIMValueInvalidType();
     }     }
Line 720 
Line 736 
             case CIMType::DATETIME:             case CIMType::DATETIME:
                 _Dec(_u._dateTimeArray);                 _Dec(_u._dateTimeArray);
                 break;                 break;
   
               case CIMType::REFERENCE:
                   _Dec(_u._referenceArray);
                   break;
   
             //default:             //default:
                 //throw CIMValueInvalidType();                 //throw CIMValueInvalidType();
         }         }
Line 765 
Line 786 
 { {
     // If the CIMValue is Null, no element is returned.     // If the CIMValue is Null, no element is returned.
     //ATTNCH: Feb 12 added the isNull test KS     //ATTNCH: Feb 12 added the isNull test KS
     // Note that I ouptut absolutly nothing      // Note that I output absolutely nothing
  
     if (_isNull)     if (_isNull)
     {     {
         // out << "\n";         // out << "\n";
         return;         return;
     }     }
       if (_type == CIMType::REFERENCE)
       {
     if (_isArray)     if (_isArray)
     {     {
               out << "<VALUE.REFARRAY>\n";
               _toXml(out, _u._referenceArray->data(), _u._referenceArray->size);
               out << "</VALUE.REFARRAY>\n";
           }
           else
           {
               _u._referenceValue->toXml(out);
           }
       }
       else if (_isArray)
       {
         out << "<VALUE.ARRAY>\n";         out << "<VALUE.ARRAY>\n";
  
         switch (_type)         switch (_type)
Line 846 
Line 880 
  
         out << "</VALUE.ARRAY>\n";         out << "</VALUE.ARRAY>\n";
     }     }
     else if (_type == CIMType::REFERENCE)  
     {  
         _u._referenceValue->toXml(out);  
     }  
     else     else
     {     {
         out << "<VALUE>";         out << "<VALUE>";
Line 933 
Line 963 
     if (_isNull)     if (_isNull)
         return;         return;
  
       if (_type == CIMType::REFERENCE)
       {
     if (_isArray)     if (_isArray)
     {     {
               // ATTN-RK-P2-20020220: How to output an array of references in MOF?
           }
           else
           {
               _u._referenceValue->toMof(out);
           }
       }
       else if (_isArray)
       {
         switch (_type)         switch (_type)
         {         {
             case CIMType::BOOLEAN:             case CIMType::BOOLEAN:
Line 998 
Line 1039 
                 throw CIMValueInvalidType();                 throw CIMValueInvalidType();
         }         }
     }     }
     else if (_type == CIMType::REFERENCE)  
     {  
         _u._referenceValue->toMof(out);  
     }  
     else     else
     {     {
         switch (_type)         switch (_type)
Line 1329 
Line 1366 
     _isNull = false;     _isNull = false;
 } }
  
   void CIMValue::set(const Array<CIMReference>& x)
   {
       clear();
       _Inc(_u._referenceArray = x._rep);
       _type = CIMType::REFERENCE;
       _isArray = true;
       _isNull = false;
   }
   
 void CIMValue::get(Boolean& x) const void CIMValue::get(Boolean& x) const
 { {
     if (_type != CIMType::BOOLEAN || _isArray)     if (_type != CIMType::BOOLEAN || _isArray)
Line 1566 
Line 1612 
     x.set(_u._dateTimeArray);     x.set(_u._dateTimeArray);
 } }
  
   void CIMValue::get(Array<CIMReference>& x) const
   {
       if (_type != CIMType::REFERENCE || !_isArray)
           throw TypeMismatch();
   
       x.set(_u._referenceArray);
   }
   
 void CIMValue::_init() void CIMValue::_init()
 { {
     _type = CIMType::NONE;     _type = CIMType::NONE;
Line 1641 
Line 1695 
             case CIMType::DATETIME:             case CIMType::DATETIME:
                 return Array<CIMDateTime>(x._u._dateTimeArray) ==                 return Array<CIMDateTime>(x._u._dateTimeArray) ==
                     Array<CIMDateTime>(y._u._dateTimeArray);                     Array<CIMDateTime>(y._u._dateTimeArray);
   
               case CIMType::REFERENCE:
                   return Array<CIMReference>(x._u._referenceArray) ==
                       Array<CIMReference>(y._u._referenceArray);
             default:             default:
                 throw CIMValueInvalidType();                 throw CIMValueInvalidType();
         }         }
Line 1768 
Line 1826 
             case CIMType::DATETIME:             case CIMType::DATETIME:
                 set(Array<CIMDateTime>(arraySize));                 set(Array<CIMDateTime>(arraySize));
                 break;                 break;
   
               case CIMType::REFERENCE:
                   set(Array<CIMReference>(arraySize));
                   break;
             default:             default:
                 throw CIMValueInvalidType();                 throw CIMValueInvalidType();
         }         }
Line 1920 
Line 1982 
             case CIMType::DATETIME:             case CIMType::DATETIME:
                 _toString(out, _u._dateTimeArray->data(), _u._dateTimeArray->size);                 _toString(out, _u._dateTimeArray->data(), _u._dateTimeArray->size);
                 break;                 break;
   
               case CIMType::REFERENCE:
                   _toString(out, _u._referenceArray->data(), _u._referenceArray->size);
                   break;
   
             default:             default:
                 throw CIMValueInvalidType();                 throw CIMValueInvalidType();
         }         }
     }     }
     else if (_type == CIMType::REFERENCE)  
     {  
         return _u._referenceValue->toString();  
     }  
     else     else
     {     {
         switch (_type)         switch (_type)
Line 1987 
Line 2050 
             case CIMType::DATETIME:             case CIMType::DATETIME:
                 _toString(out, *_u._dateTimeValue);                 _toString(out, *_u._dateTimeValue);
                 break;                 break;
   
               case CIMType::REFERENCE:
                   _toString(out, *_u._referenceValue);
                   break;
   
             default:             default:
                 throw CIMValueInvalidType();                 throw CIMValueInvalidType();
         }         }


Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2