• Main Page
  • Classes
  • Files
  • File List

/root/rpmbuild/BUILD/pegasus/src/Pegasus/Common/CIMObjectPath.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_ObjectPath_h
00033 #define Pegasus_ObjectPath_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/Exception.h>
00041 
00042 PEGASUS_NAMESPACE_BEGIN
00043 
00044 class CIMObjectPath;
00045 class CIMKeyBindingRep;
00046 class CIMObjectPathRep;
00047 class CIMValue;
00048 
00053 class PEGASUS_COMMON_LINKAGE CIMKeyBinding
00054 {
00055 public:
00056 
00061     enum Type
00062     {
00064         BOOLEAN,
00066         STRING,
00068         NUMERIC,
00070         REFERENCE
00071     };
00072 
00076     CIMKeyBinding();
00077 
00084     CIMKeyBinding(const CIMKeyBinding& x);
00085 
00092     CIMKeyBinding(const CIMName& name, const String& value, Type type);
00093 
00124     CIMKeyBinding(const CIMName& name, const CIMValue& value);
00125 
00129     ~CIMKeyBinding();
00130 
00137     CIMKeyBinding& operator=(const CIMKeyBinding& x);
00138 
00143     const CIMName& getName() const;
00144 
00149     void setName(const CIMName& name);
00150 
00155     const String& getValue() const;
00156 
00161     void setValue(const String& value);
00162 
00167     Type getType() const;
00168 
00173     void setType(Type type);
00174 
00182     Boolean equal(CIMValue value);
00183 
00184 private:
00185 
00186     CIMKeyBindingRep* _rep;
00187 
00188     friend class CIMObjectPath;
00189 };
00190 
00198 PEGASUS_COMMON_LINKAGE Boolean operator==(
00199     const CIMKeyBinding& x,
00200     const CIMKeyBinding& y);
00201 
00202 #define PEGASUS_ARRAY_T CIMKeyBinding
00203 # include <Pegasus/Common/ArrayInter.h>
00204 #undef PEGASUS_ARRAY_T
00205 
00388 class PEGASUS_COMMON_LINKAGE CIMObjectPath
00389 {
00390 public:
00391 
00395     CIMObjectPath();
00396 
00403     CIMObjectPath(const CIMObjectPath& x);
00404 
00415     CIMObjectPath(const String& objectName);
00416 
00431     CIMObjectPath(
00432         const String& host,
00433         const CIMNamespaceName& nameSpace,
00434         const CIMName& className,
00435         const Array<CIMKeyBinding>& keyBindings = Array<CIMKeyBinding>());
00436 
00440     ~CIMObjectPath();
00441 
00448     CIMObjectPath& operator=(const CIMObjectPath& x);
00449 
00454     void clear();
00455 
00470     void set(
00471         const String& host,
00472         const CIMNamespaceName& nameSpace,
00473         const CIMName& className,
00474         const Array<CIMKeyBinding>& keyBindings = Array<CIMKeyBinding>());
00475 
00482     void set(const String& objectName);
00483 
00490     CIMObjectPath& operator=(const String& objectName);
00491 
00496     const String& getHost() const;
00497 
00509     void setHost(const String& host);
00510 
00515     const CIMNamespaceName& getNameSpace() const;
00516 
00521     void setNameSpace(const CIMNamespaceName& nameSpace);
00522 
00527     const CIMName& getClassName() const;
00528 
00533     void setClassName(const CIMName& className);
00534 
00539     const Array<CIMKeyBinding>& getKeyBindings() const;
00540 
00546     void setKeyBindings(const Array<CIMKeyBinding>& keyBindings);
00547 
00563     String toString() const;
00564 
00573     Boolean identical(const CIMObjectPath& x) const;
00574 
00580     Uint32 makeHashCode() const;
00581 
00582 private:
00583 
00592     String _toStringCanonical() const;
00593 
00594     CIMObjectPathRep* _rep;
00595 
00596     friend class SQLiteStore;
00597 };
00598 
00605 PEGASUS_COMMON_LINKAGE Boolean operator==(
00606     const CIMObjectPath& x,
00607     const CIMObjectPath& y);
00608 
00615 PEGASUS_COMMON_LINKAGE Boolean operator!=(
00616     const CIMObjectPath& x,
00617     const CIMObjectPath& y);
00618 
00619 #define PEGASUS_ARRAY_T CIMObjectPath
00620 # include <Pegasus/Common/ArrayInter.h>
00621 #undef PEGASUS_ARRAY_T
00622 
00623 PEGASUS_NAMESPACE_END
00624 
00625 #endif /* Pegasus_ObjectPath_h */
00626 
00627