version 1.19, 2002/05/24 01:36:59
|
version 1.41, 2007/09/03 11:27:02
|
|
|
//%///////////////////////////////////////////////////////////////////////////// |
//%2006//////////////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000, 2001 The Open group, BMC Software, Tivoli Systems, IBM |
// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development |
|
// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. |
|
// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.; |
|
// 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. |
|
// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
|
// EMC Corporation; VERITAS Software Corporation; The Open Group. |
|
// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
|
// EMC Corporation; Symantec 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 |
|
|
// | // |
//============================================================================== | //============================================================================== |
// | // |
// Author: Mike Brasher (mbrasher@bmc.com) |
|
// |
|
// Modified By: Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com) |
|
// Carol Ann Krug Graves, Hewlett-Packard Company |
|
// (carolann_graves@hp.com) |
|
// |
|
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
#include "CIMClassRep.h" | #include "CIMClassRep.h" |
|
|
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(_rep); |
return _rep->getClassName(); | return _rep->getClassName(); |
} | } |
| |
const CIMObjectPath& CIMObject::getPath() const | const CIMObjectPath& CIMObject::getPath() const |
{ | { |
_checkRep(); |
CheckRep(_rep); |
return _rep->getPath(); | return _rep->getPath(); |
} | } |
| |
void CIMObject::setPath (const CIMObjectPath & path) | void CIMObject::setPath (const CIMObjectPath & path) |
{ | { |
_checkRep (); |
CheckRep(_rep); |
_rep->setPath (path); | _rep->setPath (path); |
} | } |
| |
CIMObject& CIMObject::addQualifier(const CIMQualifier& qualifier) | CIMObject& CIMObject::addQualifier(const CIMQualifier& qualifier) |
{ | { |
_checkRep(); |
CheckRep(_rep); |
_rep->addQualifier(qualifier); | _rep->addQualifier(qualifier); |
return *this; | return *this; |
} | } |
| |
Uint32 CIMObject::findQualifier(const String& name) const |
Uint32 CIMObject::findQualifier(const CIMName& name) const |
{ | { |
_checkRep(); |
CheckRep(_rep); |
return _rep->findQualifier(name); | return _rep->findQualifier(name); |
} | } |
| |
Boolean CIMObject::existsQualifier(const String& name) const |
CIMQualifier CIMObject::getQualifier(Uint32 index) |
{ |
|
_checkRep(); |
|
return _rep->existsQualifier(name); |
|
} |
|
|
|
CIMQualifier CIMObject::getQualifier(Uint32 pos) |
|
{ | { |
_checkRep(); |
CheckRep(_rep); |
return _rep->getQualifier(pos); |
return _rep->getQualifier(index); |
} | } |
| |
CIMConstQualifier CIMObject::getQualifier(Uint32 pos) const |
CIMConstQualifier CIMObject::getQualifier(Uint32 index) const |
{ | { |
_checkRep(); |
CheckRep(_rep); |
return _rep->getQualifier(pos); |
return _rep->getQualifier(index); |
} | } |
| |
void CIMObject::removeQualifier(Uint32 pos) |
void CIMObject::removeQualifier(Uint32 index) |
{ | { |
_checkRep(); |
CheckRep(_rep); |
_rep->removeQualifier(pos); |
_rep->removeQualifier(index); |
} | } |
| |
Uint32 CIMObject::getQualifierCount() const | Uint32 CIMObject::getQualifierCount() const |
{ | { |
_checkRep(); |
CheckRep(_rep); |
return _rep->getQualifierCount(); | return _rep->getQualifierCount(); |
} | } |
| |
CIMObject& CIMObject::addProperty(const CIMProperty& x) | CIMObject& CIMObject::addProperty(const CIMProperty& x) |
{ | { |
_checkRep(); |
CheckRep(_rep); |
_rep->addProperty(x); | _rep->addProperty(x); |
return *this; | return *this; |
} | } |
| |
Uint32 CIMObject::findProperty(const String& name) const |
Uint32 CIMObject::findProperty(const CIMName& name) const |
{ | { |
_checkRep(); |
CheckRep(_rep); |
return _rep->findProperty(name); | return _rep->findProperty(name); |
} | } |
| |
Boolean CIMObject::existsProperty(const String& name) const |
CIMProperty CIMObject::getProperty(Uint32 index) |
{ | { |
_checkRep(); |
CheckRep(_rep); |
return _rep->existsProperty(name); |
return _rep->getProperty(index); |
} | } |
| |
CIMProperty CIMObject::getProperty(Uint32 pos) |
CIMConstProperty CIMObject::getProperty(Uint32 index) const |
{ | { |
_checkRep(); |
CheckRep(_rep); |
return _rep->getProperty(pos); |
return _rep->getProperty(index); |
} | } |
| |
CIMConstProperty CIMObject::getProperty(Uint32 pos) const |
void CIMObject::removeProperty(Uint32 index) |
{ | { |
_checkRep(); |
CheckRep(_rep); |
return _rep->getProperty(pos); |
_rep->removeProperty(index); |
} | } |
| |
void CIMObject::removeProperty(Uint32 pos) |
Uint32 CIMObject::getPropertyCount() const |
{ | { |
_checkRep(); |
CheckRep(_rep); |
_rep->removeProperty(pos); |
return _rep->getPropertyCount(); |
} | } |
| |
Uint32 CIMObject::getPropertyCount() const |
Boolean CIMObject::isUninitialized() const |
{ | { |
_checkRep(); |
return _rep == 0; |
return _rep->getPropertyCount(); |
} |
|
|
|
String CIMObject::toString() const |
|
{ |
|
Buffer out; |
|
|
|
CheckRep(_rep); |
|
_rep->toXml(out); |
|
|
|
return out.getData(); |
|
} |
|
|
|
Boolean CIMObject::isClass() const |
|
{ |
|
try |
|
{ |
|
const CIMClass c(*this); |
|
return true; |
|
} |
|
catch (DynamicCastFailedException&) |
|
{ |
|
return false; |
|
} |
} | } |
| |
Boolean CIMObject::isNull() const |
Boolean CIMObject::isInstance() const |
|
{ |
|
try |
|
{ |
|
const CIMInstance i(*this); |
|
return true; |
|
} |
|
catch (DynamicCastFailedException&) |
{ | { |
return (_rep == 0)? true : false; |
return false; |
|
} |
} | } |
| |
Boolean CIMObject::identical(const CIMConstObject& x) const | Boolean CIMObject::identical(const CIMConstObject& x) const |
{ | { |
x._checkRep(); |
CheckRep(x._rep); |
_checkRep(); |
CheckRep(_rep); |
return _rep->identical(x._rep); | return _rep->identical(x._rep); |
} | } |
| |
CIMObject CIMObject::clone() const | CIMObject CIMObject::clone() const |
{ | { |
_checkRep(); |
CheckRep(_rep); |
return CIMObject(_rep->clone()); | return CIMObject(_rep->clone()); |
} | } |
| |
void CIMObject::_checkRep() const | void CIMObject::_checkRep() const |
{ | { |
if (!_rep) | if (!_rep) |
ThrowUninitializedHandle(); |
throw UninitializedObjectException(); |
} | } |
| |
//////////////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////////////// |
|
|
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(_rep); |
return _rep->getClassName(); | return _rep->getClassName(); |
} | } |
| |
const CIMObjectPath& CIMConstObject::getPath() const | const CIMObjectPath& CIMConstObject::getPath() const |
{ | { |
_checkRep(); |
CheckRep(_rep); |
return _rep->getPath(); | return _rep->getPath(); |
} | } |
| |
Uint32 CIMConstObject::findQualifier(const String& name) const |
Uint32 CIMConstObject::findQualifier(const CIMName& name) const |
{ | { |
_checkRep(); |
CheckRep(_rep); |
return _rep->findQualifier(name); | return _rep->findQualifier(name); |
} | } |
| |
CIMConstQualifier CIMConstObject::getQualifier(Uint32 pos) const |
CIMConstQualifier CIMConstObject::getQualifier(Uint32 index) const |
{ | { |
_checkRep(); |
CheckRep(_rep); |
return _rep->getQualifier(pos); |
return _rep->getQualifier(index); |
} | } |
| |
Uint32 CIMConstObject::getQualifierCount() const | Uint32 CIMConstObject::getQualifierCount() const |
{ | { |
_checkRep(); |
CheckRep(_rep); |
return _rep->getQualifierCount(); | return _rep->getQualifierCount(); |
} | } |
| |
Uint32 CIMConstObject::findProperty(const String& name) const |
Uint32 CIMConstObject::findProperty(const CIMName& name) const |
{ | { |
_checkRep(); |
CheckRep(_rep); |
return _rep->findProperty(name); | return _rep->findProperty(name); |
} | } |
| |
CIMConstProperty CIMConstObject::getProperty(Uint32 pos) const |
CIMConstProperty CIMConstObject::getProperty(Uint32 index) const |
{ | { |
_checkRep(); |
CheckRep(_rep); |
return _rep->getProperty(pos); |
return _rep->getProperty(index); |
} | } |
| |
Uint32 CIMConstObject::getPropertyCount() const | Uint32 CIMConstObject::getPropertyCount() const |
{ | { |
_checkRep(); |
CheckRep(_rep); |
return _rep->getPropertyCount(); | return _rep->getPropertyCount(); |
} | } |
| |
Boolean CIMConstObject::isNull() const |
Boolean CIMConstObject::isUninitialized() const |
{ | { |
return (_rep == 0)? true : false; |
return _rep == 0; |
} | } |
| |
Boolean CIMConstObject::identical(const CIMConstObject& x) const |
String CIMConstObject::toString() const |
{ | { |
x._checkRep(); |
Buffer out; |
_checkRep(); |
|
return _rep->identical(x._rep); |
|
} |
|
| |
CIMObject CIMConstObject::clone() const |
CheckRep(_rep); |
{ |
_rep->toXml(out); |
return CIMObject(_rep->clone()); |
|
} |
|
| |
void CIMConstObject::_checkRep() const |
return out.getData(); |
{ |
|
if (!_rep) |
|
ThrowUninitializedHandle(); |
|
} | } |
| |
//////////////////////////////////////////////////////////////////////////////// |
Boolean CIMConstObject::isClass() const |
// |
|
// CIMObjectWithPath |
|
// |
|
//////////////////////////////////////////////////////////////////////////////// |
|
|
|
#define PEGASUS_ARRAY_T CIMObjectWithPath |
|
# include "ArrayImpl.h" |
|
#undef PEGASUS_ARRAY_T |
|
|
|
CIMObjectWithPath::CIMObjectWithPath() |
|
{ | { |
} |
try |
|
|
CIMObjectWithPath::CIMObjectWithPath( |
|
const CIMObjectPath& 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 CIMObjectPath& reference, |
|
const CIMObject& object) |
|
{ | { |
_reference = reference; |
return false; |
_object = object; |
|
} | } |
|
|
const CIMObjectPath& CIMObjectWithPath::getReference() const |
|
{ |
|
return _reference; |
|
} | } |
| |
const CIMObject& CIMObjectWithPath::getObject() const |
Boolean CIMConstObject::identical(const CIMConstObject& x) const |
{ | { |
return _object; |
CheckRep(x._rep); |
|
CheckRep(_rep); |
|
return _rep->identical(x._rep); |
} | } |
| |
CIMObjectPath& CIMObjectWithPath::getReference() |
CIMObject CIMConstObject::clone() const |
{ | { |
return _reference; |
return CIMObject(_rep->clone()); |
} | } |
| |
CIMObject& CIMObjectWithPath::getObject() |
void CIMConstObject::_checkRep() const |
{ | { |
return _object; |
if (!_rep) |
|
throw UninitializedObjectException(); |
} | } |
| |
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |