version 1.21, 2002/07/30 16:14:53
|
version 1.29.4.1, 2004/04/14 22:20:12
|
|
|
//%///////////////////////////////////////////////////////////////////////////// |
//%2003//////////////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM, |
// Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Development |
// 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.; |
|
// IBM Corp.; EMC 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 |
|
|
_isArray(isArray), _arraySize(arraySize), | _isArray(isArray), _arraySize(arraySize), |
_referenceClassName(referenceClassName) | _referenceClassName(referenceClassName) |
{ | { |
if (!CIMName::legal(name)) |
|
throw IllegalName(); |
|
|
|
if (_type == CIMTYPE_NONE) |
|
throw NullType(); |
|
|
|
if (_arraySize && !_isArray) | if (_arraySize && !_isArray) |
throw IncompatibleTypes(); |
throw TypeMismatchException(); |
| |
if (!referenceClassName.isNull()) | if (!referenceClassName.isNull()) |
{ | { |
if (_type != CIMTYPE_REFERENCE) | if (_type != CIMTYPE_REFERENCE) |
{ | { |
throw ExpectedReferenceValue(); |
throw TypeMismatchException(); |
} | } |
} | } |
else | else |
{ | { |
// ATTN: revisit this later! |
// ATTN: revisit this later! (Make consistent with CIMPropertyRep) |
#if 0 | #if 0 |
if (_type == CIMTYPE_REFERENCE) | if (_type == CIMTYPE_REFERENCE) |
throw MissingReferenceClassName(); |
throw TypeMismatchException(); |
#endif | #endif |
} | } |
} | } |
|
|
| |
void CIMParameterRep::setName(const CIMName& name) | void CIMParameterRep::setName(const CIMName& name) |
{ | { |
if (!CIMName::legal(name)) |
|
throw IllegalName(); |
|
|
|
_name = name; | _name = name; |
} | } |
| |
|
void CIMParameterRep::removeQualifier(Uint32 index) |
|
{ |
|
if (index >= _qualifiers.getCount()) |
|
throw IndexOutOfBoundsException(); |
|
|
|
_qualifiers.removeQualifier (index); |
|
} |
|
|
void CIMParameterRep::resolve( | void CIMParameterRep::resolve( |
DeclContext* declContext, | DeclContext* declContext, |
const CIMNamespaceName& nameSpace) | const CIMNamespaceName& nameSpace) |
|
|
{ | { |
if (_isArray) | if (_isArray) |
{ | { |
out << "<PARAMETER.ARRAY"; |
if (_type == CIMTYPE_REFERENCE) |
|
{ |
|
out << "<PARAMETER.REFARRAY"; |
out << " NAME=\"" << _name << "\" "; | out << " NAME=\"" << _name << "\" "; |
| |
|
if (!_referenceClassName.isNull()) |
|
{ |
|
out << " REFERENCECLASS=\"" << _referenceClassName.getString() |
|
<< "\""; |
|
} |
|
|
|
out << ">\n"; |
|
|
|
_qualifiers.toXml(out); |
|
|
|
out << "</PARAMETER.REFARRAY>\n"; |
|
} |
|
else |
|
{ |
|
out << "<PARAMETER.ARRAY"; |
|
out << " NAME=\"" << _name << "\" "; |
out << " TYPE=\"" << cimTypeToString (_type) << "\""; | out << " TYPE=\"" << cimTypeToString (_type) << "\""; |
| |
if (_arraySize) | if (_arraySize) |
|
|
| |
out << "</PARAMETER.ARRAY>\n"; | out << "</PARAMETER.ARRAY>\n"; |
} | } |
|
} |
else if (_type == CIMTYPE_REFERENCE) | else if (_type == CIMTYPE_REFERENCE) |
{ | { |
out << "<PARAMETER.REFERENCE"; | out << "<PARAMETER.REFERENCE"; |
out << " NAME=\"" << _name << "\" "; | out << " NAME=\"" << _name << "\" "; |
out << " REFERENCECLASS=\"" << _referenceClassName << "\""; |
if (!_referenceClassName.isNull()) |
|
{ |
|
out << " REFERENCECLASS=\"" << _referenceClassName.getString() << |
|
"\""; |
|
} |
out << ">\n"; | out << ">\n"; |
| |
_qualifiers.toXml(out); | _qualifiers.toXml(out); |
|
|
| |
Boolean CIMParameterRep::identical(const CIMParameterRep* x) const | Boolean CIMParameterRep::identical(const CIMParameterRep* x) const |
{ | { |
if (_name != x->_name) |
if (!_name.equal (x->_name)) |
return false; | return false; |
| |
if (_type != x->_type) | if (_type != x->_type) |
return false; | return false; |
| |
if (_referenceClassName != x->_referenceClassName) |
if (!_referenceClassName.equal (x->_referenceClassName)) |
return false; | return false; |
| |
if (!_qualifiers.identical(x->_qualifiers)) | if (!_qualifiers.identical(x->_qualifiers)) |
|
|
x._qualifiers.cloneTo(_qualifiers); | x._qualifiers.cloneTo(_qualifiers); |
} | } |
| |
void CIMParameterRep::setType(CIMType type) |
|
{ |
|
_type = type; |
|
|
|
if (_referenceClassName.isNull() && _type == CIMTYPE_REFERENCE) |
|
{ |
|
throw MissingReferenceClassName(); |
|
} |
|
} |
|
|
|
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |