00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00036 #ifndef OW_CIMCLASS_HPP_INCLUDE_GUARD_
00037 #define OW_CIMCLASS_HPP_INCLUDE_GUARD_
00038 #include "OW_config.h"
00039 #include "OW_COWIntrusiveReference.hpp"
00040 #include "OW_CIMElement.hpp"
00041 #include "OW_CIMFwd.hpp"
00042 #include "OW_String.hpp"
00043 #include "OW_Array.hpp"
00044 #include "OW_CIMNULL.hpp"
00045 #include "OW_WBEMFlags.hpp"
00046 #include "OW_CIMName.hpp"
00047
00048 namespace OW_NAMESPACE
00049 {
00050
00058 class OW_COMMON_API CIMClass : public CIMElement
00059 {
00060 public:
00061 struct CLSData;
00063 static const char* const NAMESPACECLASS OW_DEPRECATED;
00064
00070 enum { SERIALIZATION_VERSION = 2 };
00074 CIMClass();
00079 explicit CIMClass(CIMNULL_t);
00084 explicit CIMClass(const CIMName& name);
00090 explicit CIMClass(const char* name);
00091 CIMClass(const CIMClass& x);
00092
00097 ~CIMClass();
00098 CIMClass& operator=(const CIMClass& x);
00103 virtual void setNull();
00108 String getSuperClass() const;
00113 String getKeyClass() const;
00119 CIMClass& setSuperClass(const CIMName& pname);
00123 bool isKeyed() const;
00129 CIMClass& setIsAssociation(bool isAssocFlag);
00135 CIMClass& setIsKeyed(bool isKeyedParm=true);
00140 CIMPropertyArray getKeys() const;
00147 CIMQualifier getQualifier(const CIMName& name) const;
00157 CIMProperty getProperty(const CIMName& name) const;
00165 CIMProperty getProperty(const CIMName& name,
00166 const CIMName& originClass) const;
00177 CIMMethod getMethod(const CIMName& name) const;
00187 CIMMethod getMethod(const CIMName& name,
00188 const CIMName& originClass) const;
00192 bool isAssociation() const;
00196 CIMQualifierArray getQualifiers() const;
00200 CIMPropertyArray getAllProperties() const;
00204 CIMPropertyArray getProperties() const;
00208 CIMMethodArray getAllMethods() const;
00212 CIMMethodArray getMethods() const;
00218 CIMClass& addProperty(const CIMProperty& prop);
00222 int numberOfProperties() const;
00229 CIMClass& setProperties(const CIMPropertyArray& props);
00236 CIMClass& setProperty(const CIMProperty& prop);
00242 CIMClass& addQualifier(const CIMQualifier& qual);
00248 bool hasQualifier(const CIMQualifier& qual) const;
00252 int numberOfQualifiers() const;
00258 bool removeQualifier(const CIMQualifier& qual);
00264 bool removeQualifier(const CIMName& name);
00270 bool removeProperty(const CIMName& name);
00277 CIMClass& setQualifiers(const CIMQualifierArray& quals);
00284 CIMClass& setQualifier(const CIMQualifier& qual);
00290 CIMClass& addMethod(const CIMMethod& meth);
00297 CIMClass& setMethods(const CIMMethodArray& meths);
00303 CIMClass& setMethod(const CIMMethod& meth);
00309 CIMInstance newInstance() const;
00322 CIMClass clone(
00323 WBEMFlags::ELocalOnlyFlag localOnly = WBEMFlags::E_NOT_LOCAL_ONLY,
00324 WBEMFlags::EIncludeQualifiersFlag includeQualifiers = WBEMFlags::E_INCLUDE_QUALIFIERS,
00325 WBEMFlags::EIncludeClassOriginFlag includeClassOrigin = WBEMFlags::E_INCLUDE_CLASS_ORIGIN,
00326 const StringArray& propertyList=StringArray(),
00327 bool noProps=false) const;
00338 CIMClass filterProperties(const StringArray& propertyList,
00339 WBEMFlags::EIncludeQualifiersFlag includeQualifiers, WBEMFlags::EIncludeClassOriginFlag includeClassOrigin) const;
00352 StringArray getCloneProps(
00353 WBEMFlags::ELocalOnlyFlag localOnly,
00354 WBEMFlags::EDeepFlag deep,
00355 const StringArray* propertyList,
00356 const CIMClass& requestedClass) const;
00357
00368 StringArray getCloneProps(WBEMFlags::ELocalOnlyFlag localOnly,
00369 const StringArray* propertyList) const;
00371
00373
00378 virtual String getName() const;
00383 virtual void setName(const CIMName& name);
00388 virtual void readObject(std::istream &istrm);
00393 virtual void writeObject(std::ostream &ostrm) const;
00398 virtual String toMOF() const;
00403 virtual String toString() const;
00404
00405 typedef COWIntrusiveReference<CLSData> CIMClass::*safe_bool;
00409 operator safe_bool () const
00410 {
00411 return m_pdata ? &CIMClass::m_pdata : 0;
00412 }
00413 bool operator!() const
00414 {
00415 return !this->m_pdata;
00416 }
00417 private:
00418
00419 #ifdef OW_WIN32
00420 #pragma warning (push)
00421 #pragma warning (disable: 4251)
00422 #endif
00423
00424 COWIntrusiveReference<CLSData> m_pdata;
00425
00426 #ifdef OW_WIN32
00427 #pragma warning (pop)
00428 #endif
00429
00430 friend OW_COMMON_API bool operator<(const CIMClass& x, const CIMClass& y);
00431 friend OW_COMMON_API bool operator==(const CIMClass& x, const CIMClass& y);
00432 };
00433
00434 OW_COMMON_API bool operator<=(const CIMClass& x, const CIMClass& y);
00435 OW_COMMON_API bool operator>(const CIMClass& x, const CIMClass& y);
00436 OW_COMMON_API bool operator>=(const CIMClass& x, const CIMClass& y);
00437 OW_COMMON_API bool operator!=(const CIMClass& x, const CIMClass& y);
00438
00439 }
00440
00441 #endif