version 1.30, 2004/04/14 22:18:56
|
version 1.36.2.1, 2005/09/30 16:28:15
|
|
|
//%2003//////////////////////////////////////////////////////////////////////// |
//%2005//////////////////////////////////////////////////////////////////////// |
// | // |
// 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. |
|
// Copyright (c) 2005 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 |
|
|
// | // |
// Modified By: Carol Ann Krug Graves, Hewlett-Packard Company | // Modified By: Carol Ann Krug Graves, Hewlett-Packard Company |
// (carolann_graves@hp.com) | // (carolann_graves@hp.com) |
|
// David Dillard, VERITAS Software Corp. |
|
// (david.dillard@veritas.com) |
// | // |
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
|
|
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
|
CIMParameterRep::CIMParameterRep() |
|
{ |
|
} |
|
|
|
CIMParameterRep::CIMParameterRep(const CIMParameterRep& x) : |
|
Sharable(), |
|
_name(x._name), |
|
_type(x._type), |
|
_isArray(x._isArray), |
|
_arraySize(x._arraySize), |
|
_referenceClassName(x._referenceClassName) |
|
{ |
|
x._qualifiers.cloneTo(_qualifiers); |
|
} |
|
|
CIMParameterRep::CIMParameterRep( | CIMParameterRep::CIMParameterRep( |
const CIMName& name, | const CIMName& name, |
CIMType type, | CIMType type, |
|
|
_isArray(isArray), _arraySize(arraySize), | _isArray(isArray), _arraySize(arraySize), |
_referenceClassName(referenceClassName) | _referenceClassName(referenceClassName) |
{ | { |
if (_arraySize && !_isArray) |
// ensure name is not null |
|
if(name.isNull()) |
|
{ |
|
throw UninitializedObjectException(); |
|
} |
|
|
|
if((_arraySize != 0) && !_isArray) |
|
{ |
throw TypeMismatchException(); | throw TypeMismatchException(); |
|
} |
| |
if (!referenceClassName.isNull()) | if (!referenceClassName.isNull()) |
{ | { |
|
|
} | } |
else | else |
{ | { |
// ATTN: revisit this later! (Make consistent with CIMPropertyRep) |
|
#if 0 |
|
if (_type == CIMTYPE_REFERENCE) | if (_type == CIMTYPE_REFERENCE) |
|
{ |
throw TypeMismatchException(); | throw TypeMismatchException(); |
#endif |
} |
} | } |
} | } |
| |
CIMParameterRep::~CIMParameterRep() | CIMParameterRep::~CIMParameterRep() |
{ | { |
|
|
} | } |
| |
void CIMParameterRep::setName(const CIMName& name) | void CIMParameterRep::setName(const CIMName& name) |
{ | { |
|
// ensure name is not null |
|
if(name.isNull()) |
|
{ |
|
throw UninitializedObjectException(); |
|
} |
|
|
_name = name; | _name = name; |
} | } |
| |
|
|
true); | true); |
} | } |
| |
void CIMParameterRep::toXml(Array<Sint8>& out) const |
void CIMParameterRep::toXml(Buffer& out) const |
{ | { |
if (_isArray) | if (_isArray) |
{ | { |
|
|
<< "\""; | << "\""; |
} | } |
| |
|
if (_arraySize) |
|
{ |
|
char buffer[32]; |
|
sprintf(buffer, "%d", _arraySize); |
|
out << " ARRAYSIZE=\"" << buffer << "\""; |
|
} |
|
|
out << ">\n"; | out << ">\n"; |
| |
_qualifiers.toXml(out); | _qualifiers.toXml(out); |
|
|
| |
Format on a single line. | Format on a single line. |
*/ | */ |
void CIMParameterRep::toMof(Array<Sint8>& out) const |
void CIMParameterRep::toMof(Buffer& out) const |
{ | { |
// Output the qualifiers for the parameter | // Output the qualifiers for the parameter |
_qualifiers.toMof(out); | _qualifiers.toMof(out); |
|
|
return true; | return true; |
} | } |
| |
CIMParameterRep::CIMParameterRep() |
|
{ |
|
|
|
} |
|
|
|
CIMParameterRep::CIMParameterRep(const CIMParameterRep& x) : |
|
Sharable(), |
|
_name(x._name), |
|
_type(x._type), |
|
_isArray(x._isArray), |
|
_arraySize(x._arraySize), |
|
_referenceClassName(x._referenceClassName) |
|
{ |
|
x._qualifiers.cloneTo(_qualifiers); |
|
} |
|
|
|
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |