version 1.2, 2001/02/19 01:47:16
|
version 1.3, 2001/02/20 05:16:57
|
|
|
// Author: | // Author: |
// | // |
// $Log$ | // $Log$ |
|
// Revision 1.3 2001/02/20 05:16:57 mike |
|
// Implemented CIMInstance::getInstanceName() |
|
// |
// Revision 1.2 2001/02/19 01:47:16 mike | // Revision 1.2 2001/02/19 01:47:16 mike |
// Renamed names of the form CIMConst to ConstCIM. | // Renamed names of the form CIMConst to ConstCIM. |
// | // |
|
|
| |
/** Constructor - Creates a Class from inputs of a classname and | /** Constructor - Creates a Class from inputs of a classname and |
SuperClassName | SuperClassName |
@param className - String representing the name of the class being created |
@param className - String representing name of the class being created |
@param superClassName - String representing the name of the SuperClass |
@param superClassName - String representing name of the SuperClass |
ATTN: Define what makes up legal name. | ATTN: Define what makes up legal name. |
@return Throws IllegalName if className argument not legal CIM identifier. |
@return Throws IllegalName if className argument illegal CIM identifier. |
*/ | */ |
CIMClass( | CIMClass( |
const String& className, | const String& className, |
|
|
{ | { |
_rep = new CIMClassRep(className, superClassName); | _rep = new CIMClassRep(className, superClassName); |
} | } |
|
|
/// Destructor | /// Destructor |
~CIMClass() | ~CIMClass() |
{ | { |
Dec(_rep); | Dec(_rep); |
} | } |
/** CIMMethod isAssociation - Identifies whether or not this CIM class is an |
|
association. An association is a relationship between two (or more) classes |
/** CIMMethod isAssociation - Identifies whether or not this CIM class |
or instances of two classes. The properties of an association class include |
is an association. An association is a relationship between two |
pointers, or references, to the two (or more) instances. All CIM classes can |
(or more) classes or instances of two classes. The properties of an |
be included in one or more associations. |
association class include pointers, or references, to the two (or |
ATTN: Move the association definition elsewhere |
more) instances. All CIM classes can be included in one or more |
|
associations. ATTN: Move the association definition elsewhere |
@return Boolean True if this CIM class belongs to an association; | @return Boolean True if this CIM class belongs to an association; |
otherwise, false. | otherwise, false. |
*/ | */ |
|
|
_checkRep(); | _checkRep(); |
return _rep->isAssociation(); | return _rep->isAssociation(); |
} | } |
|
|
/// CIMMethod isAbstract | /// CIMMethod isAbstract |
Boolean isAbstract() const | Boolean isAbstract() const |
{ | { |
_checkRep(); | _checkRep(); |
return _rep->isAbstract(); | return _rep->isAbstract(); |
} | } |
|
|
/** CIMMethod Gets the name of the class | /** CIMMethod Gets the name of the class |
ATTN: COMMENT. Why not just get name so we have common method for all. | ATTN: COMMENT. Why not just get name so we have common method for all. |
*/ | */ |
|
|
_checkRep(); | _checkRep(); |
return _rep->getClassName(); | return _rep->getClassName(); |
} | } |
|
|
/** CIMMethod getSuperClassName - Gets the name of the Parent | /** CIMMethod getSuperClassName - Gets the name of the Parent |
@return String with parent class name. | @return String with parent class name. |
*/ | */ |
|
|
_checkRep(); | _checkRep(); |
return _rep->getSuperClassName(); | return _rep->getSuperClassName(); |
} | } |
|
|
/** CIMMethod setSuperClassName - Sets the name of the parent class from | /** CIMMethod setSuperClassName - Sets the name of the parent class from |
the input parameter. \REF{CLASSNAME}. |
the input parameter. \REF{CLASSNAME}. ATTN: Define legal classnames |
ATTN: Define legal classnames |
|
@param - String defining parent name. | @param - String defining parent name. |
@return Throws IllegalName if superClassName argument not legal CIM | @return Throws IllegalName if superClassName argument not legal CIM |
identifier. */ |
identifier. |
|
*/ |
void setSuperClassName(const String& superClassName) | void setSuperClassName(const String& superClassName) |
{ | { |
_checkRep(); | _checkRep(); |
_rep->setSuperClassName(superClassName); | _rep->setSuperClassName(superClassName); |
} | } |
|
|
/** CIMMethod addQualifier - Adds the specified qualifier to the class | /** CIMMethod addQualifier - Adds the specified qualifier to the class |
and increments the qualifier count. It is illegal to add the same | and increments the qualifier count. It is illegal to add the same |
qualifier more than one time. | qualifier more than one time. |
|
|
_rep->addQualifier(qualifier); | _rep->addQualifier(qualifier); |
return *this; | return *this; |
} | } |
/** CIMMethod findQualifier - Finds a qualifier with the specified input name |
|
if it exists in the class |
/** CIMMethod findQualifier - Finds a qualifier with the specified input |
@param name CIMName of the qualifier to be found |
name if it exists in the class @param name CIMName of the qualifier |
@return Position of the qualifier in the Class |
to be found @return Position of the qualifier in the Class ATTN: |
ATTN: Clarify the return. What if not found, etc. |
Clarify the return. What if not found, etc. |
*/ | */ |
Uint32 findQualifier(const String& name) | Uint32 findQualifier(const String& name) |
{ | { |
_checkRep(); | _checkRep(); |
return _rep->findQualifier(name); | return _rep->findQualifier(name); |
} | } |
|
|
/** CIMMethod FindQualifier - ATTN: | /** CIMMethod FindQualifier - ATTN: |
@param name of the qualifier to be found | @param name of the qualifier to be found |
@return ATTN: Define this | @return ATTN: Define this |
|
|
_checkRep(); | _checkRep(); |
return _rep->findQualifier(name); | return _rep->findQualifier(name); |
} | } |
|
|
/** CIMMethod getQualifier - Gets the CIMQualifier object defined | /** CIMMethod getQualifier - Gets the CIMQualifier object defined |
by the input parameter | by the input parameter |
@param pos defines the position of the qualifier in the class from the | @param pos defines the position of the qualifier in the class from the |
|
|
_checkRep(); | _checkRep(); |
return _rep->getQualifier(pos); | return _rep->getQualifier(pos); |
} | } |
|
|
/// CIMMethod getQualifier - ATTN: | /// CIMMethod getQualifier - ATTN: |
CIMConstQualifier getQualifier(Uint32 pos) const | CIMConstQualifier getQualifier(Uint32 pos) const |
{ | { |
_checkRep(); | _checkRep(); |
return _rep->getQualifier(pos); | return _rep->getQualifier(pos); |
} | } |
|
|
/** CIMMethod getQualifierCount - Returns the number of qualifiers | /** CIMMethod getQualifierCount - Returns the number of qualifiers |
in the class. | in the class. |
@return ATTN: | @return ATTN: |
|
|
_checkRep(); | _checkRep(); |
return _rep->getQualifierCount(); | return _rep->getQualifierCount(); |
} | } |
|
|
/** CIMMethod addProperty - Adds the specified property object to the | /** CIMMethod addProperty - Adds the specified property object to the |
properties in the CIM class | properties in the CIM class |
|
|
*/ | */ |
CIMClass& addProperty(const CIMProperty& x) | CIMClass& addProperty(const CIMProperty& x) |
{ | { |
|
|
_rep->addProperty(x); | _rep->addProperty(x); |
return *this; | return *this; |
} | } |
|
|
/** CIMMethod removeProperty - Removes the property represented | /** CIMMethod removeProperty - Removes the property represented |
by the position input parameter from the class | by the position input parameter from the class |
@param position parameter for the property to be removed from the | @param position parameter for the property to be removed from the |
|
|
_checkRep(); | _checkRep(); |
_rep->removeProperty(pos); | _rep->removeProperty(pos); |
} | } |
|
|
/** CIMMethod findProperty - Finds the property object with the | /** CIMMethod findProperty - Finds the property object with the |
name defined by the input parameter in the class. | name defined by the input parameter in the class. |
@param String parameter with the property name. | @param String parameter with the property name. |
|
|
_checkRep(); | _checkRep(); |
return _rep->findProperty(name); | return _rep->findProperty(name); |
} | } |
|
|
/// CIMMethod findProperty | /// CIMMethod findProperty |
Uint32 findProperty(const String& name) const | Uint32 findProperty(const String& name) const |
{ | { |
_checkRep(); | _checkRep(); |
return _rep->findProperty(name); | return _rep->findProperty(name); |
} | } |
|
|
/** CIMMethod getProperty - Returns a property representing the property | /** CIMMethod getProperty - Returns a property representing the property |
defined by the input parameter | defined by the input parameter |
@param position for this property | @param position for this property |
|
|
_checkRep(); | _checkRep(); |
return _rep->getProperty(pos); | return _rep->getProperty(pos); |
} | } |
|
|
/// CIMMethod getProperty - ATTN | /// CIMMethod getProperty - ATTN |
CIMConstProperty getProperty(Uint32 pos) const |
ConstCIMProperty getProperty(Uint32 pos) const |
{ | { |
_checkRep(); | _checkRep(); |
return _rep->getProperty(pos); | return _rep->getProperty(pos); |
} | } |
|
|
/** CIMMethod getProperty - Gets the count of the number of properties | /** CIMMethod getProperty - Gets the count of the number of properties |
defined in the class. | defined in the class. |
@return count of number of proerties in the class | @return count of number of proerties in the class |
|
|
_checkRep(); | _checkRep(); |
return _rep->getPropertyCount(); | return _rep->getPropertyCount(); |
} | } |
|
|
/** CIMMethod addMethod - Adds the method object defined by the input | /** CIMMethod addMethod - Adds the method object defined by the input |
parameter to the class and increments the count of the number of methods in |
parameter to the class and increments the count of the number of |
the class |
methods in the class |
@param - method object representing the method to be added | @param - method object representing the method to be added |
/REF{METHODOBJECT} |
|
*/ | */ |
CIMClass& addMethod(const CIMMethod& x) | CIMClass& addMethod(const CIMMethod& x) |
{ | { |
|
|
_rep->addMethod(x); | _rep->addMethod(x); |
return *this; | return *this; |
} | } |
|
|
/** CIMMethod findMethod - Located the method object defined by the | /** CIMMethod findMethod - Located the method object defined by the |
name input | name input |
@param String representing the name of the method to be found | @param String representing the name of the method to be found |
|
|
_checkRep(); | _checkRep(); |
return _rep->findMethod(name); | return _rep->findMethod(name); |
} | } |
|
|
/// CIMMethod findMethod - ATTN: | /// CIMMethod findMethod - ATTN: |
Uint32 findMethod(const String& name) const | Uint32 findMethod(const String& name) const |
{ | { |
_checkRep(); | _checkRep(); |
return _rep->findMethod(name); | return _rep->findMethod(name); |
} | } |
|
|
/** CIMMethod getMethod - Gets the method object defined by the | /** CIMMethod getMethod - Gets the method object defined by the |
input parameter. | input parameter. |
@param ATTN: | @param ATTN: |
|
|
_checkRep(); | _checkRep(); |
return _rep->getMethod(pos); | return _rep->getMethod(pos); |
} | } |
|
|
/// CIMMethod getMethod - ATTN: | /// CIMMethod getMethod - ATTN: |
CIMConstMethod getMethod(Uint32 pos) const | CIMConstMethod getMethod(Uint32 pos) const |
{ | { |
_checkRep(); | _checkRep(); |
return _rep->getMethod(pos); | return _rep->getMethod(pos); |
} | } |
|
|
/** CIMMethod getMethodCount - Count of the number of methods in the class | /** CIMMethod getMethodCount - Count of the number of methods in the class |
@return integer representing the number of methods in the class | @return integer representing the number of methods in the class |
*/ | */ |
|
|
return _rep->getMethodCount(); | return _rep->getMethodCount(); |
} | } |
| |
|
|
/** CIMMethod Resolve - Resolve the class: inherit any properties and | /** CIMMethod Resolve - Resolve the class: inherit any properties and |
qualifiers. Make sure the superClass really exists and is consistent with |
qualifiers. Make sure the superClass really exists and is consistent |
this class. Also set the propagated flag class-origin for each |
with this class. Also set the propagated flag class-origin for each |
class feature. | class feature. |
ATTN: explain why this here | ATTN: explain why this here |
*/ | */ |
|
|
_checkRep(); | _checkRep(); |
_rep->resolve(declContext, nameSpace); | _rep->resolve(declContext, nameSpace); |
} | } |
|
|
/// operator - ATTN: | /// operator - ATTN: |
operator int() const { return _rep != 0; } | operator int() const { return _rep != 0; } |
|
|
/// CIMMethod toXML | /// CIMMethod toXML |
void toXml(Array<Sint8>& out) const | void toXml(Array<Sint8>& out) const |
{ | { |
_checkRep(); | _checkRep(); |
_rep->toXml(out); | _rep->toXml(out); |
} | } |
|
|
/// CIMMethod print | /// CIMMethod print |
void print() const | void print() const |
{ | { |
_checkRep(); | _checkRep(); |
_rep->print(); | _rep->print(); |
} | } |
|
|
/** CIMMethod identical - Compares with another class | /** CIMMethod identical - Compares with another class |
ATTN: Clarify exactly what identical means | ATTN: Clarify exactly what identical means |
@parm Class object for the class to be compared | @parm Class object for the class to be compared |
@return True if the classes are identical | @return True if the classes are identical |
*/ | */ |
Boolean identical(const ConstCIMClass& x) const; | Boolean identical(const ConstCIMClass& x) const; |
|
|
/// CIMMethod clone - ATTN: | /// CIMMethod clone - ATTN: |
CIMClass clone() const | CIMClass clone() const |
{ | { |
return CIMClass(_rep->clone()); | return CIMClass(_rep->clone()); |
} | } |
| |
|
void getKeyNames(Array<String>& keyNames) const |
|
{ |
|
_checkRep(); |
|
_rep->getKeyNames(keyNames); |
|
} |
|
|
private: | private: |
| |
CIMClass(CIMClassRep* rep) : _rep(rep) | CIMClass(CIMClassRep* rep) : _rep(rep) |
|
|
friend class ConstCIMClass; | friend class ConstCIMClass; |
}; | }; |
| |
//////////////////////////////////////////////////////////////////////////////// |
/** ConstCIMClass |
// |
|
// ConstCIMClass |
*/ |
// |
|
//////////////////////////////////////////////////////////////////////////////// |
|
| |
class PEGASUS_COMMON_LINKAGE ConstCIMClass | class PEGASUS_COMMON_LINKAGE ConstCIMClass |
{ | { |
|
|
return _rep->findProperty(name); | return _rep->findProperty(name); |
} | } |
| |
CIMConstProperty getProperty(Uint32 pos) const |
ConstCIMProperty getProperty(Uint32 pos) const |
{ | { |
_checkRep(); | _checkRep(); |
return _rep->getProperty(pos); | return _rep->getProperty(pos); |
|
|
return CIMClass(_rep->clone()); | return CIMClass(_rep->clone()); |
} | } |
| |
|
void getKeyNames(Array<String>& keyNames) const |
|
{ |
|
_checkRep(); |
|
_rep->getKeyNames(keyNames); |
|
} |
|
|
private: | private: |
| |
void _checkRep() const | void _checkRep() const |