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

Diff for /pegasus/src/Pegasus/Common/CIMObject.cpp between version 1.13 and 1.27

version 1.13, 2002/05/14 03:27:25 version 1.27, 2002/08/20 17:39:37
Line 1 
Line 1 
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
 // //
 // Copyright (c) 2000, 2001 The Open group, BMC Software, Tivoli Systems, IBM  // Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM,
   // The Open Group, Tivoli Systems
 // //
 // 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 23 
Line 24 
 // Author: Mike Brasher (mbrasher@bmc.com) // Author: Mike Brasher (mbrasher@bmc.com)
 // //
 // Modified By: Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com) // Modified By: Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
   //              Carol Ann Krug Graves, Hewlett-Packard Company
   //                  (carolann_graves@hp.com)
 // //
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
Line 36 
Line 39 
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
   #define PEGASUS_ARRAY_T CIMObject
   # include "ArrayImpl.h"
   #undef PEGASUS_ARRAY_T
   
 //////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
 // //
 // CIMObject // CIMObject
Line 77 
Line 84 
     return *this;     return *this;
 } }
  
 CIMObject& CIMObject::operator=(const CIMClass& x)  
 {  
     if (x._rep != _rep)  
     {  
         Dec(_rep);  
         Inc(_rep = x._rep);  
     }  
     return *this;  
 }  
   
 CIMObject& CIMObject::operator=(const CIMInstance& x)  
 {  
     if (x._rep != _rep)  
     {  
         Dec(_rep);  
         Inc(_rep = x._rep);  
     }  
     return *this;  
 }  
   
 CIMObject::~CIMObject() CIMObject::~CIMObject()
 { {
     Dec(_rep);     Dec(_rep);
 } }
  
 const String& CIMObject::getClassName() const  const CIMName& CIMObject::getClassName() const
 { {
     _checkRep();     _checkRep();
     return _rep->getClassName();     return _rep->getClassName();
 } }
  
 const Boolean CIMObject::equalClassName(const String& classname) const  const CIMObjectPath& CIMObject::getPath() const
 { {
     _checkRep();     _checkRep();
     return _rep->equalClassName(classname);      return _rep->getPath();
 } }
  
 const CIMReference& CIMObject::getPath() const  void CIMObject::setPath (const CIMObjectPath & path)
 { {
     _checkRep();     _checkRep();
     return _rep->getPath();      _rep->setPath (path);
 } }
  
 CIMObject& CIMObject::addQualifier(const CIMQualifier& qualifier) CIMObject& CIMObject::addQualifier(const CIMQualifier& qualifier)
Line 127 
Line 114 
     return *this;     return *this;
 } }
  
 Uint32 CIMObject::findQualifier(const String& name) const  Uint32 CIMObject::findQualifier(const CIMName& name) const
 { {
     _checkRep();     _checkRep();
     return _rep->findQualifier(name);     return _rep->findQualifier(name);
 } }
  
 Boolean CIMObject::existsQualifier(const String& name) const  
 {  
     _checkRep();  
     return _rep->existsQualifier(name);  
 }  
   
 CIMQualifier CIMObject::getQualifier(Uint32 pos) CIMQualifier CIMObject::getQualifier(Uint32 pos)
 { {
     _checkRep();     _checkRep();
Line 170 
Line 151 
     return *this;     return *this;
 } }
  
 Uint32 CIMObject::findProperty(const String& name) const  Uint32 CIMObject::findProperty(const CIMName& name) const
 { {
     _checkRep();     _checkRep();
     return _rep->findProperty(name);     return _rep->findProperty(name);
 } }
  
 Boolean CIMObject::existsProperty(const String& name) const  
 {  
     _checkRep();  
     return _rep->existsProperty(name);  
 }  
   
 CIMProperty CIMObject::getProperty(Uint32 pos) CIMProperty CIMObject::getProperty(Uint32 pos)
 { {
     _checkRep();     _checkRep();
Line 206 
Line 181 
     return _rep->getPropertyCount();     return _rep->getPropertyCount();
 } }
  
 Boolean CIMObject::isNull() const  Boolean CIMObject::isUninitialized() const
 { {
     return (_rep == 0)? true : false;     return (_rep == 0)? true : false;
 } }
  
 Boolean CIMObject::identical(const CIMConstObject& x) const  Boolean CIMObject::isClass () const
 { {
     x._checkRep();      try
     _checkRep();      {
     return _rep->identical(x._rep);          const CIMClass c (*this);
           return true;
       }
       catch (DynamicCastFailedException)
       {
           return false;
       }
 } }
  
 void CIMObject::toXml(Array<Sint8>& out) const  Boolean CIMObject::isInstance () const
 { {
       try
       {
           const CIMInstance i (*this);
           return true;
       }
       catch (DynamicCastFailedException)
       {
           return false;
       }
   }
   
   Boolean CIMObject::identical(const CIMConstObject& x) const
   {
       x._checkRep();
     _checkRep();     _checkRep();
     _rep->toXml(out);      return _rep->identical(x._rep);
 } }
  
 CIMObject CIMObject::clone() const CIMObject CIMObject::clone() const
Line 233 
Line 228 
 void CIMObject::_checkRep() const void CIMObject::_checkRep() const
 { {
     if (!_rep)     if (!_rep)
         ThrowUninitializedHandle();          throw UninitializedObjectException();
 } }
  
 //////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
Line 287 
Line 282 
     return *this;     return *this;
 } }
  
 CIMConstObject& CIMConstObject::operator=(const CIMObject& x)  
 {  
     if (x._rep != _rep)  
     {  
         Dec(_rep);  
         Inc(_rep = x._rep);  
     }  
     return *this;  
 }  
   
 CIMConstObject& CIMConstObject::operator=(const CIMClass& x)  
 {  
     if (x._rep != _rep)  
     {  
         Dec(_rep);  
         Inc(_rep = x._rep);  
     }  
     return *this;  
 }  
   
 CIMConstObject& CIMConstObject::operator=(const CIMInstance& x)  
 {  
     if (x._rep != _rep)  
     {  
         Dec(_rep);  
         Inc(_rep = x._rep);  
     }  
     return *this;  
 }  
   
 CIMConstObject& CIMConstObject::operator=(const CIMConstClass& x)  
 {  
     if (x._rep != _rep)  
     {  
         Dec(_rep);  
         Inc(_rep = x._rep);  
     }  
     return *this;  
 }  
   
 CIMConstObject& CIMConstObject::operator=(const CIMConstInstance& x)  
 {  
     if (x._rep != _rep)  
     {  
         Dec(_rep);  
         Inc(_rep = x._rep);  
     }  
     return *this;  
 }  
   
 CIMConstObject::~CIMConstObject() CIMConstObject::~CIMConstObject()
 { {
     Dec(_rep);     Dec(_rep);
 } }
  
 const String& CIMConstObject::getClassName() const  const CIMName& CIMConstObject::getClassName() const
 { {
     _checkRep();     _checkRep();
     return _rep->getClassName();     return _rep->getClassName();
 } }
  
 const CIMReference& CIMConstObject::getPath() const  const CIMObjectPath& CIMConstObject::getPath() const
 { {
     _checkRep();     _checkRep();
     return _rep->getPath();     return _rep->getPath();
 } }
  
 Uint32 CIMConstObject::findQualifier(const String& name) const  Uint32 CIMConstObject::findQualifier(const CIMName& name) const
 { {
     _checkRep();     _checkRep();
     return _rep->findQualifier(name);     return _rep->findQualifier(name);
Line 372 
Line 317 
     return _rep->getQualifierCount();     return _rep->getQualifierCount();
 } }
  
 Uint32 CIMConstObject::findProperty(const String& name) const  Uint32 CIMConstObject::findProperty(const CIMName& name) const
 { {
     _checkRep();     _checkRep();
     return _rep->findProperty(name);     return _rep->findProperty(name);
Line 390 
Line 335 
     return _rep->getPropertyCount();     return _rep->getPropertyCount();
 } }
  
 Boolean CIMConstObject::isNull() const  Boolean CIMConstObject::isUninitialized() const
 { {
     return (_rep == 0)? true : false;     return (_rep == 0)? true : false;
 } }
  
 void CIMConstObject::toXml(Array<Sint8>& out) const  Boolean CIMConstObject::isClass() const
 {  
     _checkRep();  
     _rep->toXml(out);  
 }  
   
 void CIMConstObject::print(PEGASUS_STD(ostream)& o) const  
 {  
     _checkRep();  
     _rep->print(o);  
 }  
   
 Boolean CIMConstObject::identical(const CIMConstObject& x) const  
 {  
     x._checkRep();  
     _checkRep();  
     return _rep->identical(x._rep);  
 }  
   
 CIMObject CIMConstObject::clone() const  
 {  
     return CIMObject(_rep->clone());  
 }  
   
 void CIMConstObject::_checkRep() const  
 {  
     if (!_rep)  
         ThrowUninitializedHandle();  
 }  
   
 ////////////////////////////////////////////////////////////////////////////////  
 //  
 // CIMObjectWithPath  
 //  
 ////////////////////////////////////////////////////////////////////////////////  
   
 CIMObjectWithPath::CIMObjectWithPath()  
 { {
 }      try
   
 CIMObjectWithPath::CIMObjectWithPath(  
     const CIMReference& reference,  
     const CIMObject& object)  
     : _reference(reference), _object(object)  
 { {
           const CIMConstClass c(*this);
           return true;
 } }
       catch (DynamicCastFailedException)
 CIMObjectWithPath::CIMObjectWithPath(const CIMObjectWithPath& x)  
     : _reference(x._reference), _object(x._object)  
 { {
           return false;
 } }
   
 CIMObjectWithPath::~CIMObjectWithPath()  
 {  
 } }
  
 CIMObjectWithPath& CIMObjectWithPath::operator=(const CIMObjectWithPath& x)  Boolean CIMConstObject::isInstance() const
 { {
     if (this != &x)      try
     {     {
         _reference = x._reference;          const CIMConstInstance i(*this);
         _object = x._object;          return true;
     }     }
     return *this;      catch (DynamicCastFailedException)
 }  
   
 void CIMObjectWithPath::set(  
     const CIMReference& reference,  
     const CIMObject& object)  
 { {
     _reference = reference;          return false;
     _object = object;  
 } }
   
 const CIMReference& CIMObjectWithPath::getReference() const  
 {  
     return _reference;  
 } }
  
 const CIMObject& CIMObjectWithPath::getObject() const  Boolean CIMConstObject::identical(const CIMConstObject& x) const
 {  
     return _object;  
 }  
   
 CIMReference& CIMObjectWithPath::getReference()  
 { {
     return _reference;      x._checkRep();
       _checkRep();
       return _rep->identical(x._rep);
 } }
  
 CIMObject& CIMObjectWithPath::getObject()  CIMObject CIMConstObject::clone() const
 { {
     return _object;      return CIMObject(_rep->clone());
 } }
  
 void CIMObjectWithPath::toXml(Array<Sint8>& out) const  void CIMConstObject::_checkRep() const
 { {
     out << "<VALUE.OBJECTWITHPATH>\n";      if (!_rep)
           throw UninitializedObjectException();
     _reference.toXml(out, false);  
     _object.toXml(out);  
   
     out << "</VALUE.OBJECTWITHPATH>\n";  
 } }
  
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END


Legend:
Removed from v.1.13  
changed lines
  Added in v.1.27

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2