version 1.16, 2001/05/23 21:57:14
|
version 1.25.2.1, 2001/08/01 11:17:35
|
|
|
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000 The Open Group, BMC Software, Tivoli Systems, IBM |
// Copyright (c) 2000, 2001 The Open group, BMC Software, Tivoli Systems, IBM |
// | // |
// Permission is hereby granted, free of charge, to any person obtaining a |
// Permission is hereby granted, free of charge, to any person obtaining a copy |
// copy of this software and associated documentation files (the "Software"), |
// of this software and associated documentation files (the "Software"), to |
// to deal in the Software without restriction, including without limitation |
// deal in the Software without restriction, including without limitation the |
// the rights to use, copy, modify, merge, publish, distribute, sublicense, |
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
// and/or sell copies of the Software, and to permit persons to whom the |
// sell copies of the Software, and to permit persons to whom the Software is |
// Software is furnished to do so, subject to the following conditions: |
// furnished to do so, subject to the following conditions: |
// | // |
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
// THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN |
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED |
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT |
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR |
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
// DEALINGS IN THE SOFTWARE. |
// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
|
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
// | // |
//============================================================================== | //============================================================================== |
// | // |
|
|
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
class CIMConstClass; | class CIMConstClass; |
|
class CIMObject; |
| |
/** The CIMClass class is used to represent CIM classes in Pegasus. In CIM, | /** The CIMClass class is used to represent CIM classes in Pegasus. In CIM, |
a class object may be a class or an associator. A CIM class must contain a | a class object may be a class or an associator. A CIM class must contain a |
|
|
association class include pointers, or references, to the two (or | association class include pointers, or references, to the two (or |
more) instances. All CIM classes can be included in one or more | more) instances. All CIM classes can be included in one or more |
associations. | 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. |
*/ | */ |
|
|
return _rep->isAssociation(); | return _rep->isAssociation(); |
} | } |
| |
/// CIMMethod isAbstract |
/** isAbstract Test if the CIMClass is abstract. |
|
@return - True if the CIMClass Object is abstract |
|
SeeAlso: Abstract |
|
*/ |
Boolean isAbstract() const | Boolean isAbstract() const |
{ | { |
_checkRep(); | _checkRep(); |
|
|
return _rep->getClassName(); | return _rep->getClassName(); |
} | } |
| |
/** CIMMethod getSuperClassName - Gets the name of the Parent |
/** getSuperClassName - Gets the name of the Parent |
@return String with parent class name. | @return String with parent class name. |
*/ | */ |
const String& getSuperClassName() const | const String& getSuperClassName() const |
|
|
return _rep->getSuperClassName(); | return _rep->getSuperClassName(); |
} | } |
| |
/** CIMMethod setSuperClassName - Sets the name of the parent class from |
/** setSuperClassName - Sets the name of the parent class from |
the input parameter. \REF{CLASSNAME}. ATTN: Define legal classnames | the input parameter. \REF{CLASSNAME}. 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 |
|
|
| |
| |
| |
/** CIMMethod findProperty - Finds the property object with the |
/** 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. |
@return position representing the property object found or | @return position representing the property object found or |
|
|
| |
/** getMethod - Gets the method object defined by the | /** getMethod - Gets the method object defined by the |
input parameter. | input parameter. |
@param pos Index to the CIMMethod object to get |
@param pos Index to the method object to get |
@return Returns handle of the CIMMethod requested |
@return Returns handle of the method requested |
@exception Throws OutofBounds if the index represented by pos is greater | @exception Throws OutofBounds if the index represented by pos is greater |
than the number of methods defined in the class object | than the number of methods defined in the class object |
*/ | */ |
|
|
_rep->removeMethod(pos); | _rep->removeMethod(pos); |
} | } |
| |
/** CIMMethod getMethodCount - Count of the number of methods in the class |
/** getMethodCount - Count of the number of methods in the class |
@return integer representing the number of methods in the class object. | @return integer representing the number of methods in the class object. |
*/ | */ |
Uint32 getMethodCount() const | Uint32 getMethodCount() const |
|
|
/// operator - ATTN: | /// operator - ATTN: |
operator int() const { return _rep != 0; } | operator int() const { return _rep != 0; } |
| |
/// CIMMethod toXML |
/** toXML - prepares an XML representation of the CIMClass object |
|
in the provided Sint8 variable. |
|
@param out Sint8 array for the XML representation |
|
*/ |
void toXml(Array<Sint8>& out) const | void toXml(Array<Sint8>& out) const |
{ | { |
_checkRep(); | _checkRep(); |
_rep->toXml(out); | _rep->toXml(out); |
} | } |
| |
/// CIMMethod print |
/** print - Prints the toXML output to cout |
|
*/ |
void print(PEGASUS_STD(ostream) &o=PEGASUS_STD(cout)) const | void print(PEGASUS_STD(ostream) &o=PEGASUS_STD(cout)) const |
{ | { |
_checkRep(); | _checkRep(); |
_rep->print(o); | _rep->print(o); |
} | } |
| |
/** CIMMethod identical - Compares with another class |
/** toMof - prepares a MOF representation of the CIMClass object |
|
in the provided Sint8 variable. |
|
@param out Sint8 array for the XML representation |
|
*/ |
|
void toMof(Array<Sint8>& out) const |
|
{ |
|
_checkRep(); |
|
_rep->toMof(out); |
|
} |
|
/** printMof - Prints the toMof output to cout |
|
*/ |
|
void printMof(PEGASUS_STD(ostream) &o=PEGASUS_STD(cout)) const |
|
{ |
|
_checkRep(); |
|
_rep->printMof(o); |
|
} |
|
|
|
|
|
/** identical - Compares with another class |
ATTN: Clarify exactly what identical means | ATTN: Clarify exactly what identical means |
@param Class object for the class to be compared | @param 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 CIMConstClass& x) const; | Boolean identical(const CIMConstClass& x) const; |
| |
/// CIMMethod clone - ATTN: |
/** Makes a deep copy (clone) of the given object. */ |
CIMClass clone() const | CIMClass clone() const |
{ | { |
return CIMClass(_rep->clone()); | return CIMClass(_rep->clone()); |
} | } |
| |
|
/** Get names of all keys of this class. */ |
void getKeyNames(Array<String>& keyNames) const | void getKeyNames(Array<String>& keyNames) const |
{ | { |
_checkRep(); | _checkRep(); |
_rep->getKeyNames(keyNames); | _rep->getKeyNames(keyNames); |
} | } |
| |
|
Boolean hasKeys() const |
|
{ |
|
_checkRep(); |
|
return _rep->hasKeys(); |
|
} |
|
|
private: | private: |
| |
CIMClass(CIMClassRep* rep) : _rep(rep) | CIMClass(CIMClassRep* rep) : _rep(rep) |
|
|
| |
CIMClassRep* _rep; | CIMClassRep* _rep; |
friend class CIMConstClass; | friend class CIMConstClass; |
|
friend class CIMObject; |
}; | }; |
| |
|
#define PEGASUS_ARRAY_T CIMClass |
|
# include "ArrayInter.h" |
|
#undef PEGASUS_ARRAY_T |
|
|
/** CIMConstClass - ATTN: define this. | /** CIMConstClass - ATTN: define this. |
| |
*/ | */ |
|
|
class PEGASUS_COMMON_LINKAGE CIMConstClass | class PEGASUS_COMMON_LINKAGE CIMConstClass |
{ | { |
public: | public: |
|
|
_rep->getKeyNames(keyNames); | _rep->getKeyNames(keyNames); |
} | } |
| |
|
Boolean hasKeys() const |
|
{ |
|
_checkRep(); |
|
return _rep->hasKeys(); |
|
} |
|
|
private: | private: |
| |
void _checkRep() const | void _checkRep() const |
|
|
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |
| |
#endif /* Pegasus_CIMClass_h */ | #endif /* Pegasus_CIMClass_h */ |
|
|
|
|