CIMObjectPath.h
1 //%LICENSE////////////////////////////////////////////////////////////////
2 //
3 // Licensed to The Open Group (TOG) under one or more contributor license
4 // agreements. Refer to the OpenPegasusNOTICE.txt file distributed with
5 // this work for additional information regarding copyright ownership.
6 // Each contributor licenses this file to you under the OpenPegasus Open
7 // Source License; you may not use this file except in compliance with the
8 // License.
9 //
10 // Permission is hereby granted, free of charge, to any person obtaining a
11 // copy of this software and associated documentation files (the "Software"),
12 // to deal in the Software without restriction, including without limitation
13 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 // and/or sell copies of the Software, and to permit persons to whom the
15 // Software is furnished to do so, subject to the following conditions:
16 //
17 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
19 //
20 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23 // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24 // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25 // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26 // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 //
29 //
30 //%/////////////////////////////////////////////////////////////////////////////
31 
32 #ifndef Pegasus_ObjectPath_h
33 #define Pegasus_ObjectPath_h
34 
35 #include <Pegasus/Common/Config.h>
36 #include <Pegasus/Common/Linkage.h>
37 #include <Pegasus/Common/String.h>
38 #include <Pegasus/Common/CIMName.h>
39 #include <Pegasus/Common/Array.h>
40 #include <Pegasus/Common/Exception.h>
41 
42 PEGASUS_NAMESPACE_BEGIN
43 
44 class CIMObjectPath;
45 class CIMKeyBindingRep;
46 class CIMObjectPathRep;
47 class CIMValue;
48 
53 class PEGASUS_COMMON_LINKAGE CIMKeyBinding
54 {
55 public:
56 
61  enum Type
62  {
70  REFERENCE
71  };
72 
76  CIMKeyBinding();
77 
84  CIMKeyBinding(const CIMKeyBinding& x);
85 
92  CIMKeyBinding(const CIMName& name, const String& value, Type type);
93 
124  CIMKeyBinding(const CIMName& name, const CIMValue& value);
125 
129  ~CIMKeyBinding();
130 
137  CIMKeyBinding& operator=(const CIMKeyBinding& x);
138 
143  const CIMName& getName() const;
144 
149  void setName(const CIMName& name);
150 
155  const String& getValue() const;
156 
161  void setValue(const String& value);
162 
167  Type getType() const;
168 
173  void setType(Type type);
174 
182  Boolean equal(CIMValue value);
183 
184 private:
185 
186  CIMKeyBindingRep* _rep;
187 
188  friend class CIMObjectPath;
189 };
190 
198 PEGASUS_COMMON_LINKAGE Boolean operator==(
199  const CIMKeyBinding& x,
200  const CIMKeyBinding& y);
201 
202 #define PEGASUS_ARRAY_T CIMKeyBinding
203 # include <Pegasus/Common/ArrayInter.h>
204 #undef PEGASUS_ARRAY_T
205 
388 class PEGASUS_COMMON_LINKAGE CIMObjectPath
389 {
390 public:
391 
395  CIMObjectPath();
396 
403  CIMObjectPath(const CIMObjectPath& x);
404 
415  CIMObjectPath(const String& objectName);
416 
432  const String& host,
433  const CIMNamespaceName& nameSpace,
434  const CIMName& className,
435  const Array<CIMKeyBinding>& keyBindings = Array<CIMKeyBinding>());
436 
440  ~CIMObjectPath();
441 
448  CIMObjectPath& operator=(const CIMObjectPath& x);
449 
454  void clear();
455 
470  void set(
471  const String& host,
472  const CIMNamespaceName& nameSpace,
473  const CIMName& className,
474  const Array<CIMKeyBinding>& keyBindings = Array<CIMKeyBinding>());
475 
482  void set(const String& objectName);
483 
490  CIMObjectPath& operator=(const String& objectName);
491 
496  const String& getHost() const;
497 
509  void setHost(const String& host);
510 
515  const CIMNamespaceName& getNameSpace() const;
516 
521  void setNameSpace(const CIMNamespaceName& nameSpace);
522 
527  const CIMName& getClassName() const;
528 
533  void setClassName(const CIMName& className);
534 
539  const Array<CIMKeyBinding>& getKeyBindings() const;
540 
546  void setKeyBindings(const Array<CIMKeyBinding>& keyBindings);
547 
563  String toString() const;
564 
573  Boolean identical(const CIMObjectPath& x) const;
574 
580  Uint32 makeHashCode() const;
581 
582 private:
583 
592  String _toStringCanonical() const;
593 
594  CIMObjectPathRep* _rep;
595 
596  friend class SQLiteStore;
597  friend class SCMOInstance;
598  friend class SCMOClass;
599 };
600 
607 PEGASUS_COMMON_LINKAGE Boolean operator==(
608  const CIMObjectPath& x,
609  const CIMObjectPath& y);
610 
617 PEGASUS_COMMON_LINKAGE Boolean operator!=(
618  const CIMObjectPath& x,
619  const CIMObjectPath& y);
620 
621 #define PEGASUS_ARRAY_T CIMObjectPath
622 # include <Pegasus/Common/ArrayInter.h>
623 #undef PEGASUS_ARRAY_T
624 
625 PEGASUS_NAMESPACE_END
626 
627 #endif /* Pegasus_ObjectPath_h */
628 
629 
Definition: CIMObjectPath.h:388
Definition: CIMValue.h:63
Definition: String.h:119
Definition: CIMName.h:64
Definition: CIMObjectPath.h:64
Definition: ArrayInter.h:44
Definition: CIMName.h:255
Type
Definition: CIMObjectPath.h:61
Definition: CIMObjectPath.h:53
Definition: CIMObjectPath.h:68
Definition: CIMObjectPath.h:66