/srv/build/STABLE_8/pkgs/tog-pegasus/BUILD/pegasus/src/Pegasus/Common/CIMObject.h
00001 //%LICENSE////////////////////////////////////////////////////////////////
00002 //
00003 // Licensed to The Open Group (TOG) under one or more contributor license
00004 // agreements.  Refer to the OpenPegasusNOTICE.txt file distributed with
00005 // this work for additional information regarding copyright ownership.
00006 // Each contributor licenses this file to you under the OpenPegasus Open
00007 // Source License; you may not use this file except in compliance with the
00008 // License.
00009 //
00010 // Permission is hereby granted, free of charge, to any person obtaining a
00011 // copy of this software and associated documentation files (the "Software"),
00012 // to deal in the Software without restriction, including without limitation
00013 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
00014 // and/or sell copies of the Software, and to permit persons to whom the
00015 // Software is furnished to do so, subject to the following conditions:
00016 //
00017 // The above copyright notice and this permission notice shall be included
00018 // in all copies or substantial portions of the Software.
00019 //
00020 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00021 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00022 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00023 // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
00024 // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
00025 // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
00026 // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00027 //
00029 //
00030 //%/////////////////////////////////////////////////////////////////////////////
00031 
00032 #ifndef Pegasus_Object_h
00033 #define Pegasus_Object_h
00034 
00035 #include <Pegasus/Common/Config.h>
00036 #include <Pegasus/Common/Linkage.h>
00037 #include <Pegasus/Common/String.h>
00038 #include <Pegasus/Common/CIMName.h>
00039 #include <Pegasus/Common/Array.h>
00040 #include <Pegasus/Common/CIMProperty.h>
00041 #include <Pegasus/Common/CIMQualifier.h>
00042 
00043 PEGASUS_NAMESPACE_BEGIN
00044 
00045 class CIMConstObject;
00046 class CIMObjectRep;
00047 class CIMClass;
00048 class CIMConstClass;
00049 class CIMInstance;
00050 class CIMConstInstance;
00051 class CIMProperty;
00052 class CIMConstProperty;
00053 class CIMQualifier;
00054 class CIMConstQualifier;
00055 
00057 //
00058 // CIMObject
00059 //
00061 
00074 class PEGASUS_COMMON_LINKAGE CIMObject
00075 {
00076 public:
00077 
00085     CIMObject();
00086 
00093     CIMObject(const CIMObject& x);
00094 
00101     CIMObject(const CIMClass& x);
00102 
00109     CIMObject(const CIMInstance& x);
00110 
00118     CIMObject& operator=(const CIMObject& x);
00119 
00123     ~CIMObject();
00124 
00131     const CIMName& getClassName() const;
00132 
00139     const CIMObjectPath& getPath() const;
00140 
00147     void setPath (const CIMObjectPath & path);
00148 
00158     CIMObject& addQualifier(const CIMQualifier& qualifier);
00159 
00167     Uint32 findQualifier(const CIMName& name) const;
00168 
00178     CIMQualifier getQualifier(Uint32 index);
00179 
00189     CIMConstQualifier getQualifier(Uint32 index) const;
00190 
00199     void removeQualifier(Uint32 index);
00200 
00207     Uint32 getQualifierCount() const;
00208 
00218     CIMObject& addProperty(const CIMProperty& x);
00219 
00227     Uint32 findProperty(const CIMName& name) const;
00228 
00238     CIMProperty getProperty(Uint32 index);
00239 
00249     CIMConstProperty getProperty(Uint32 index) const;
00250 
00259     void removeProperty(Uint32 index);
00260 
00267     Uint32 getPropertyCount() const;
00268 
00276     CIMObject clone() const;
00277 
00286     Boolean identical(const CIMConstObject& x) const;
00287 
00292     Boolean isUninitialized() const;
00293 
00302     String toString() const;
00303 
00308     Boolean isClass() const;
00309 
00314     Boolean isInstance() const;
00315 
00316 private:
00317 
00318     CIMObjectRep* _rep;
00319 
00320     CIMObject(CIMObjectRep* rep);
00321 
00322     friend class CIMConstObject;
00323     friend class CIMClass;
00324     friend class CIMConstClass;
00325     friend class CIMInstance;
00326     friend class CIMConstInstance;
00327 };
00328 
00329 #define PEGASUS_ARRAY_T CIMObject
00330 # include <Pegasus/Common/ArrayInter.h>
00331 #undef PEGASUS_ARRAY_T
00332 
00333 
00335 //
00336 // CIMConstObject
00337 //
00339 
00347 class PEGASUS_COMMON_LINKAGE CIMConstObject
00348 {
00349 public:
00350 
00358     CIMConstObject();
00359 
00367     CIMConstObject(const CIMConstObject& x);
00368 
00375     CIMConstObject(const CIMObject& x);
00376 
00383     CIMConstObject(const CIMClass& x);
00384 
00391     CIMConstObject(const CIMInstance& x);
00392 
00399     CIMConstObject(const CIMConstClass& x);
00400 
00408     CIMConstObject(const CIMConstInstance& x);
00409 
00417     CIMConstObject& operator=(const CIMConstObject& x);
00418 
00422     ~CIMConstObject();
00423 
00430     const CIMName& getClassName() const;
00431 
00438     const CIMObjectPath& getPath() const;
00439 
00447     Uint32 findQualifier(const CIMName& name) const;
00448 
00458     CIMConstQualifier getQualifier(Uint32 index) const;
00459 
00466     Uint32 getQualifierCount() const;
00467 
00475     Uint32 findProperty(const CIMName& name) const;
00476 
00486     CIMConstProperty getProperty(Uint32 index) const;
00487 
00494     Uint32 getPropertyCount() const;
00495 
00504     CIMObject clone() const;
00505 
00514     Boolean identical(const CIMConstObject& x) const;
00515 
00520     Boolean isUninitialized() const;
00521 
00530     String toString () const;
00531 
00536     Boolean isClass() const;
00537 
00543     Boolean isInstance() const;
00544 
00545 private:
00546 
00547     CIMObjectRep* _rep;
00548 
00549     friend class CIMObject;
00550     friend class CIMClass;
00551     friend class CIMConstClass;
00552     friend class CIMInstance;
00553     friend class CIMConstInstance;
00554 };
00555 
00556 PEGASUS_NAMESPACE_END
00557 
00558 #endif /* Pegasus_Object_h */