version 1.32, 2002/08/14 17:41:16
|
version 1.37.14.1, 2003/08/13 19:39:50
|
|
|
#include "CIMScope.h" | #include "CIMScope.h" |
#include "XmlWriter.h" | #include "XmlWriter.h" |
#include "MofWriter.h" | #include "MofWriter.h" |
|
#include <Pegasus/Common/MessageLoader.h> //l10n |
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
|
|
: _name(name), _type(type), | : _name(name), _type(type), |
_classOrigin(classOrigin), _propagated(propagated) | _classOrigin(classOrigin), _propagated(propagated) |
{ | { |
if (type == CIMTYPE_NONE) |
|
throw NullType(); |
|
} | } |
| |
CIMMethodRep::~CIMMethodRep() | CIMMethodRep::~CIMMethodRep() |
|
|
void CIMMethodRep::addParameter(const CIMParameter& x) | void CIMMethodRep::addParameter(const CIMParameter& x) |
{ | { |
if (x.isUninitialized()) | if (x.isUninitialized()) |
throw UninitializedObject(); |
throw UninitializedObjectException(); |
| |
if (findParameter(x.getName()) != PEG_NOT_FOUND) |
if (findParameter(x.getName()) != PEG_NOT_FOUND){ |
throw AlreadyExists(); |
//l10n |
|
//throw AlreadyExistsException |
|
//("parameter \"" + x.getName().getString () + "\""); |
|
MessageLoaderParms parms("Common.CIMMethodRep.PARAMETER", |
|
"parameter \"$0\"", |
|
x.getName().getString()); |
|
throw AlreadyExistsException(parms); |
|
} |
| |
_parameters.append(x); | _parameters.append(x); |
} | } |
|
|
return PEG_NOT_FOUND; | return PEG_NOT_FOUND; |
} | } |
| |
CIMParameter CIMMethodRep::getParameter(Uint32 pos) |
CIMParameter CIMMethodRep::getParameter(Uint32 index) |
{ | { |
if (pos >= _parameters.size()) |
if (index >= _parameters.size()) |
throw OutOfBounds(); |
throw IndexOutOfBoundsException(); |
| |
return _parameters[pos]; |
return _parameters[index]; |
} | } |
| |
void CIMMethodRep::removeParameter (Uint32 pos) |
void CIMMethodRep::removeParameter(Uint32 index) |
{ | { |
if (pos >= _parameters.size ()) |
if (index >= _parameters.size()) |
throw OutOfBounds (); |
throw IndexOutOfBoundsException(); |
| |
_parameters.remove (pos); |
_parameters.remove (index); |
} | } |
| |
Uint32 CIMMethodRep::getParameterCount() const | Uint32 CIMMethodRep::getParameterCount() const |
|
|
| |
Boolean CIMMethodRep::identical(const CIMMethodRep* x) const | Boolean CIMMethodRep::identical(const CIMMethodRep* x) const |
{ | { |
if (_name != x->_name) |
if (!_name.equal (x->_name)) |
return false; | return false; |
| |
if (_type != x->_type) | if (_type != x->_type) |
|
|
void CIMMethodRep::setType(CIMType type) | void CIMMethodRep::setType(CIMType type) |
{ | { |
_type = type; | _type = type; |
|
|
if (type == CIMTYPE_NONE) |
|
throw NullType(); |
|
} | } |
| |
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |