version 1.28, 2002/07/25 16:19:45
|
version 1.29, 2002/07/30 16:14:53
|
|
|
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
CIMMethodRep::CIMMethodRep( | CIMMethodRep::CIMMethodRep( |
const String& name, |
const CIMName& name, |
CIMType type, | CIMType type, |
const String& classOrigin, |
const CIMName& classOrigin, |
Boolean propagated) | Boolean propagated) |
: _name(name), _type(type), | : _name(name), _type(type), |
_classOrigin(classOrigin), _propagated(propagated) | _classOrigin(classOrigin), _propagated(propagated) |
{ | { |
if (!CIMName::legal(name)) |
|
throw IllegalName(); |
|
|
|
if (classOrigin.size() && !CIMName::legal(classOrigin)) |
|
throw IllegalName(); |
|
|
|
if (type == CIMTYPE_NONE) | if (type == CIMTYPE_NONE) |
throw NullType(); | throw NullType(); |
} | } |
|
|
| |
} | } |
| |
void CIMMethodRep::setName(const String& name) |
void CIMMethodRep::setName(const CIMName& name) |
{ | { |
if (!CIMName::legal(name)) | if (!CIMName::legal(name)) |
throw IllegalName(); | throw IllegalName(); |
|
|
_name = name; | _name = name; |
} | } |
| |
void CIMMethodRep::setClassOrigin(const String& classOrigin) |
void CIMMethodRep::setClassOrigin(const CIMName& classOrigin) |
{ | { |
if (!CIMName::legal(classOrigin)) | if (!CIMName::legal(classOrigin)) |
throw IllegalName(); | throw IllegalName(); |
|
|
_parameters.append(x); | _parameters.append(x); |
} | } |
| |
Uint32 CIMMethodRep::findParameter(const String& name) const |
Uint32 CIMMethodRep::findParameter(const CIMName& name) const |
{ | { |
for (Uint32 i = 0, n = _parameters.size(); i < n; i++) | for (Uint32 i = 0, n = _parameters.size(); i < n; i++) |
{ | { |
if (CIMName::equal(_parameters[i].getName(), name)) |
if (name.equal(_parameters[i].getName())) |
return i; | return i; |
} | } |
| |
|
|
| |
void CIMMethodRep::resolve( | void CIMMethodRep::resolve( |
DeclContext* declContext, | DeclContext* declContext, |
const String& nameSpace, |
const CIMNamespaceName& nameSpace, |
const CIMConstMethod& inheritedMethod) | const CIMConstMethod& inheritedMethod) |
{ | { |
// ATTN: Check to see if this method has same signature as | // ATTN: Check to see if this method has same signature as |
|
|
| |
void CIMMethodRep::resolve( | void CIMMethodRep::resolve( |
DeclContext* declContext, | DeclContext* declContext, |
const String& nameSpace) |
const CIMNamespaceName& nameSpace) |
{ | { |
// Validate the qualifiers: | // Validate the qualifiers: |
| |
|
|
| |
out << " TYPE=\"" << cimTypeToString (_type) << "\""; | out << " TYPE=\"" << cimTypeToString (_type) << "\""; |
| |
if (_classOrigin.size()) |
if (!_classOrigin.isNull()) |
out << " CLASSORIGIN=\"" << _classOrigin << "\""; | out << " CLASSORIGIN=\"" << _classOrigin << "\""; |
| |
if (_propagated != false) | if (_propagated != false) |