version 1.48, 2005/11/07 23:15:59
|
version 1.51.18.1, 2008/01/16 13:22:59
|
|
|
//%2005//////////////////////////////////////////////////////////////////////// |
//%2006//////////////////////////////////////////////////////////////////////// |
// | // |
// 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. |
|
|
// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. | // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. |
// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; | // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
// EMC Corporation; VERITAS Software Corporation; The Open Group. | // 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: Carol Ann Krug Graves, Hewlett-Packard Company |
|
// (carolann_graves@hp.com) |
|
// David Dillard, VERITAS Software Corp. |
|
// (david.dillard@veritas.com) |
|
// |
|
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
#include <Pegasus/Common/Config.h> | #include <Pegasus/Common/Config.h> |
|
|
#include "CIMScope.h" | #include "CIMScope.h" |
#include "XmlWriter.h" | #include "XmlWriter.h" |
#include "MofWriter.h" | #include "MofWriter.h" |
#include <Pegasus/Common/MessageLoader.h> //l10n |
#include <Pegasus/Common/MessageLoader.h> |
#include "StrLit.h" | #include "StrLit.h" |
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
|
|
_name(x._name), | _name(x._name), |
_type(x._type), | _type(x._type), |
_classOrigin(x._classOrigin), | _classOrigin(x._classOrigin), |
_propagated(x._propagated) |
_propagated(x._propagated), |
|
_ownerCount(0) |
{ | { |
x._qualifiers.cloneTo(_qualifiers); | x._qualifiers.cloneTo(_qualifiers); |
|
// Set the CIM name tag. |
|
_nameTag = generateCIMNameTag(_name); |
| |
_parameters.reserveCapacity(x._parameters.size()); | _parameters.reserveCapacity(x._parameters.size()); |
| |
|
|
const CIMName& classOrigin, | const CIMName& classOrigin, |
Boolean propagated) | Boolean propagated) |
: _name(name), _type(type), | : _name(name), _type(type), |
_classOrigin(classOrigin), _propagated(propagated) |
_classOrigin(classOrigin), |
|
_propagated(propagated), |
|
_ownerCount(0) |
{ | { |
// ensure name is not null | // ensure name is not null |
if(name.isNull()) | if(name.isNull()) |
{ | { |
throw UninitializedObjectException(); | throw UninitializedObjectException(); |
} | } |
|
// Set the CIM name tag. |
|
_nameTag = generateCIMNameTag(_name); |
} | } |
| |
CIMMethodRep::~CIMMethodRep() | CIMMethodRep::~CIMMethodRep() |
|
|
{ | { |
throw UninitializedObjectException(); | throw UninitializedObjectException(); |
} | } |
|
if (_ownerCount != 0 && _name != name) |
|
{ |
|
MessageLoaderParms parms( |
|
"Common.CIMMethodRep.CONTAINED_METHOD_NAMECHANGEDEXCEPTION", |
|
"Attempted to change the name of a method" |
|
" already in a container."); |
|
throw Exception(parms); |
|
} |
_name = name; | _name = name; |
|
// Set the CIM name tag. |
|
_nameTag = generateCIMNameTag(_name); |
} | } |
| |
void CIMMethodRep::setClassOrigin(const CIMName& classOrigin) | void CIMMethodRep::setClassOrigin(const CIMName& classOrigin) |
|
|
if (x.isUninitialized()) | if (x.isUninitialized()) |
throw UninitializedObjectException(); | throw UninitializedObjectException(); |
| |
if (findParameter(x.getName()) != PEG_NOT_FOUND){ |
if (findParameter(x.getName()) != PEG_NOT_FOUND) |
//l10n |
{ |
//throw AlreadyExistsException |
|
//("parameter \"" + x.getName().getString () + "\""); |
|
MessageLoaderParms parms("Common.CIMMethodRep.PARAMETER", | MessageLoaderParms parms("Common.CIMMethodRep.PARAMETER", |
"parameter \"$0\"", | "parameter \"$0\"", |
x.getName().getString()); | x.getName().getString()); |
|
|
| |
Uint32 CIMMethodRep::findParameter(const CIMName& name) const | Uint32 CIMMethodRep::findParameter(const CIMName& name) const |
{ | { |
for (Uint32 i = 0, n = _parameters.size(); i < n; i++) |
return _parameters.find(name, generateCIMNameTag(name)); |
{ |
|
if (name.equal(_parameters[i].getName())) |
|
return i; |
|
} |
|
|
|
return PEG_NOT_FOUND; |
|
} | } |
| |
CIMParameter CIMMethodRep::getParameter(Uint32 index) | CIMParameter CIMMethodRep::getParameter(Uint32 index) |