version 1.12, 2001/07/10 22:31:09
|
version 1.17, 2002/03/28 02:57:54
|
|
|
// | // |
// Author: Mike Brasher (mbrasher@bmc.com) | // Author: Mike Brasher (mbrasher@bmc.com) |
// | // |
// Modified By: |
// Modified By: Karl Schopmeyer (k.schopmeyer@opengroup.org) |
// | // |
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
|
|
| |
#include <Pegasus/Common/Config.h> | #include <Pegasus/Common/Config.h> |
#include <Pegasus/Common/CIMQualifierRep.h> | #include <Pegasus/Common/CIMQualifierRep.h> |
|
#include <Pegasus/Common/CIMFlavor.h> |
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
|
|
defined on input. | defined on input. |
@param String representing CIMName for the new qualifier | @param String representing CIMName for the new qualifier |
@param value | @param value |
@param flavor - ATTN: |
@param flavor - Flavor defined for this qualifier definition. Default for this |
@param propoagated - ATTN: |
parameter is CIMFlavor::NONE. |
|
@param propoagated - Boolean defining whether this is a propagated qualifier. |
|
This is an optional parameter with default = false |
@return -Returns the instantiated qualifier object or throws an exception | @return -Returns the instantiated qualifier object or throws an exception |
if the name argument is illegal | if the name argument is illegal |
| |
|
|
CIMQualifier( | CIMQualifier( |
const String& name, | const String& name, |
const CIMValue& value, | const CIMValue& value, |
Uint32 flavor = CIMFlavor::DEFAULTS, |
Uint32 flavor = CIMFlavor::NONE, |
Boolean propagated = false) | Boolean propagated = false) |
{ | { |
_rep = new CIMQualifierRep(name, value, flavor, propagated); | _rep = new CIMQualifierRep(name, value, flavor, propagated); |
|
|
return _rep->getName(); | return _rep->getName(); |
} | } |
| |
/** CIMMethod |
/** setName - Sets the qualifier name field in the qualifier object. |
Throws IllegalName if name argument not legal CIM identifier. |
@param name - String containing the name for the qualifier |
|
@exception Throws IllegalName if name argument not legal CIM identifier. |
*/ | */ |
void setName(const String& name) | void setName(const String& name) |
{ | { |
|
|
_rep->setName(name); | _rep->setName(name); |
} | } |
| |
/** CIMMethod |
/** getType - Gets the ATTN: |
| |
*/ | */ |
CIMType getType() const | CIMType getType() const |
|
|
return _rep->getType(); | return _rep->getType(); |
} | } |
| |
/** CIMMethod |
/** isArray - Returns true if the qualifier is an array |
|
@return Boolean try if array qualifier. |
*/ | */ |
Boolean isArray() const | Boolean isArray() const |
{ | { |
|
|
return _rep->isArray(); | return _rep->isArray(); |
} | } |
| |
/** CIMMethod |
/** getValue - Gets the value component of the qualifier object |
|
@return CIMValue containing the value component |
| |
*/ | */ |
const CIMValue& getValue() const | const CIMValue& getValue() const |
|
|
return _rep->getValue(); | return _rep->getValue(); |
} | } |
| |
/** CIMMethod |
/** setValue - Puts a CIMValue object into a CIMQualifier object |
|
@param value - The CIMValue object to install |
| |
*/ | */ |
void setValue(const CIMValue& value) | void setValue(const CIMValue& value) |
|
|
_rep->setValue(value); | _rep->setValue(value); |
} | } |
| |
/** CIMMethod |
/* setFlavor - Sets the bits defined on input into the Flavor variable |
|
for the Qualifier Object. |
|
@param flavor - Uint32 defines the flavor bits to be set. |
|
*/ |
|
void setFlavor(Uint32 flavor) |
|
{ |
|
_checkRep(); |
|
_rep->setFlavor(flavor); |
|
} |
|
/* unsetFlavor - Resets the bits defined for the flavor |
|
for the Qualifier Object with the input. |
|
@param flavor - Uint32 defines the flavor bits to be set. |
|
*/ |
|
void unsetFlavor(Uint32 flavor) |
|
{ |
|
_checkRep(); |
|
_rep->unsetFlavor(flavor); |
|
} |
| |
|
/** getFlavor - Gets the Flavor field from a Qualifier |
|
@return - Uint32 with the Flavor flags that can be tested |
|
against the CIMFlavor constants. |
*/ | */ |
Uint32 getFlavor() const | Uint32 getFlavor() const |
{ | { |
_checkRep(); | _checkRep(); |
return _rep->getFlavor(); | return _rep->getFlavor(); |
} | } |
|
/** isFlavor - Boolean function that determines if particular flavor |
|
flags are set in the flavor variable of a qualifier. |
|
@param flavor - The flavor bits to test. |
|
Return True if the defined flavor is set. |
|
<pre> |
|
if (q.isFlavor(CIMType::TOSUBCLASS) |
|
do something based on TOSUBCLASS being true |
|
</pre> |
| |
/** CIMMethod |
*/ |
|
Boolean isFlavor(Uint32 flavor) const |
|
{ |
|
return _rep->isFlavor(flavor); |
|
} |
|
/* resolveFlavor - Function used only in object creation to |
|
resolve the combination of a qualifer flavor input and |
|
the corresponding inherited flavor from declaration or |
|
superclass and set the current qualifier to that |
|
definition. The functions changes the current flavor based |
|
on the characteristics of the inheritance. |
|
@param inheritedFlavor - The flavor inherited from higher level |
|
@param inherited - True if inherited from definition. False if this |
|
is definition that inherits from the declaration |
|
*/ |
|
void resolveFlavor(Uint32 inheritedFlavor, Boolean inherited) |
|
{ |
|
_checkRep(); |
|
_rep->resolveFlavor(inheritedFlavor, inherited); |
|
} |
|
/** getPropagated returns the propagated indicator |
|
@return Uint32 - TBD |
| |
*/ | */ |
const Uint32 getPropagated() const | const Uint32 getPropagated() const |
|
|
*/ | */ |
operator int() const { return _rep != 0; } | operator int() const { return _rep != 0; } |
| |
/** CIMMethod |
/** toXml- Converts the CIMQualifier object to XML. |
| |
*/ | */ |
void toXml(Array<Sint8>& out) const | void toXml(Array<Sint8>& out) const |
|
|
_rep->toXml(out); | _rep->toXml(out); |
} | } |
| |
/** CIMMethod |
/** print - Converts the CIMQualifier object to XML and |
|
sends it to cout. |
| |
*/ | */ |
void print(PEGASUS_STD(ostream) &o=PEGASUS_STD(cout)) const | void print(PEGASUS_STD(ostream) &o=PEGASUS_STD(cout)) const |
|
|
_rep->print(o); | _rep->print(o); |
} | } |
| |
/** CIMMethod |
/** toXml- Converts the CIMQualifier object to MOF. |
|
|
|
*/ |
|
void toMof(Array<Sint8>& out) const |
|
{ |
|
_checkRep(); |
|
_rep->toMof(out); |
|
} |
|
|
|
/** printMOF - Converts the CIMQualifier object to XML and |
|
sends it to cout. |
|
|
|
*/ |
|
void printMof(PEGASUS_STD(ostream) &o=PEGASUS_STD(cout)) const |
|
{ |
|
_checkRep(); |
|
_rep->printMof(o); |
|
} |
|
|
| |
|
/** identical - compares two CIMQualifier objects. |
|
@return - True if the objects are identical. |
*/ | */ |
Boolean identical(const CIMConstQualifier& x) const; | Boolean identical(const CIMConstQualifier& x) const; |
| |
|
|
return _rep->getFlavor(); | return _rep->getFlavor(); |
} | } |
| |
|
Boolean isFlavor(Uint32 flavor) const |
|
{ |
|
return ((getFlavor() & flavor) !=0); |
|
} |
|
|
|
Boolean isFlavorToSubclass() const |
|
{ |
|
return ((getFlavor() & CIMFlavor::TOSUBCLASS) != 0); |
|
} |
|
|
|
Boolean isFlavorToInstance() const |
|
{ |
|
return ((getFlavor() & CIMFlavor::TOINSTANCE) != 0); |
|
} |
|
|
|
Boolean isFlavorOverridable() const |
|
{ |
|
return ((getFlavor() & CIMFlavor::OVERRIDABLE) != 0); |
|
} |
|
|
const Uint32 getPropagated() const | const Uint32 getPropagated() const |
{ | { |
_checkRep(); | _checkRep(); |