1 mike 1.1 //%/////////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (c) 2000, 2001 The Open group, BMC Software, Tivoli Systems, IBM
4 //
5 // Permission is hereby granted, free of charge, to any person obtaining a copy
|
6 chip 1.2 // of this software and associated documentation files (the "Software"), to
7 // deal in the Software without restriction, including without limitation the
8 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
9 mike 1.1 // sell copies of the Software, and to permit persons to whom the Software is
10 // furnished to do so, subject to the following conditions:
|
11 chip 1.2 //
12 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
|
13 mike 1.1 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
14 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
15 chip 1.2 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
16 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
18 mike 1.1 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
19 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20 //
21 //==============================================================================
22 //
23 // Author: Mike Brasher (mbrasher@bmc.com)
24 //
25 // Modified By:
26 //
27 //%/////////////////////////////////////////////////////////////////////////////
28
29 #ifndef Pegasus_CIMObjectRep_h
30 #define Pegasus_CIMObjectRep_h
31
32 #include <Pegasus/Common/Config.h>
33 #include <Pegasus/Common/String.h>
|
34 kumpf 1.10 #include <Pegasus/Common/Sharable.h>
|
35 mike 1.1 #include <Pegasus/Common/CIMProperty.h>
36 #include <Pegasus/Common/CIMQualifier.h>
|
37 kumpf 1.8 #include <Pegasus/Common/CIMQualifierList.h>
|
38 mike 1.1 #include <Pegasus/Common/Array.h>
39
40 PEGASUS_NAMESPACE_BEGIN
41
42 /** This class defines the internal representation of the CIMObject class.
43
44 This base class has two implementations: CIMClassRep CIMInstanceRep. The
45 CIMObjectRep pointer member of CIMObject points to one of these.
46
47 This class contains what is common to CIMClass and CIMInstance.
48 */
49 class PEGASUS_COMMON_LINKAGE CIMObjectRep : public Sharable
50 {
51 public:
52
|
53 chip 1.4 CIMObjectRep(const CIMReference& className);
|
54 mike 1.1
55 virtual ~CIMObjectRep();
56
|
57 chip 1.3 const String& getClassName() const
|
58 chip 1.2 {
|
59 chip 1.4 return _reference.getClassName();
60 }
61
|
62 karl 1.7 const Boolean equalClassName(const String& classname) const
|
63 karl 1.6 {
64 return (String::equalNoCase(classname, _reference.getClassName()));
65 }
66
67 const CIMReference& getPath() const
|
68 chip 1.4 {
69 return _reference;
|
70 mike 1.1 }
71
72 void addQualifier(const CIMQualifier& qualifier)
73 {
74 _qualifiers.add(qualifier);
75 }
76
77 Uint32 findQualifier(const String& name) const
78 {
79 return _qualifiers.find(name);
80 }
81
82 Boolean existsQualifier(const String& name) const
83 {
84 return ((_qualifiers.find(name) != PEG_NOT_FOUND) ? true : false);
85 }
86
87 CIMQualifier getQualifier(Uint32 pos)
88 {
89 return _qualifiers.getQualifier(pos);
90 }
91 mike 1.1
92 CIMConstQualifier getQualifier(Uint32 pos) const
93 {
94 return _qualifiers.getQualifier(pos);
95 }
96
|
97 karl 1.5 Boolean isTrueQualifer(String& name) const
98 {
99 return _qualifiers.isTrue(name);
100 }
101
|
102 mike 1.1 Uint32 getQualifierCount() const
103 {
104 return _qualifiers.getCount();
105 }
106
107 void removeQualifier(Uint32 pos)
108 {
109 _qualifiers.removeQualifier(pos);
110 }
111
112 virtual void addProperty(const CIMProperty& x);
113
|
114 kumpf 1.9 Uint32 findProperty(const String& name) const;
|
115 mike 1.1
|
116 kumpf 1.9 Boolean existsProperty(const String& name) const;
|
117 mike 1.1
118 CIMProperty getProperty(Uint32 pos);
119
120 CIMConstProperty getProperty(Uint32 pos) const
121 {
122 return ((CIMObjectRep*)this)->getProperty(pos);
123 }
124
125 void removeProperty(Uint32 pos);
126
127 Uint32 getPropertyCount() const;
128
129 virtual Boolean identical(const CIMObjectRep* x) const;
130
131 virtual void toXml(Array<Sint8>& out) const = 0;
132
133 virtual void print(PEGASUS_STD(ostream)& os = PEGASUS_STD(cout)) const = 0;
134
135 virtual CIMObjectRep* clone() const = 0;
136
137 protected:
138 mike 1.1
139 CIMObjectRep();
140
141 CIMObjectRep(const CIMObjectRep& x);
142
|
143 kumpf 1.9 CIMReference _reference;
144 CIMQualifierList _qualifiers;
145 Array<CIMProperty> _properties;
146 Boolean _resolved;
147
148 private:
149
150 // This method is declared and made private so that the compiler does
151 // not implicitly define a default copy constructor.
|
152 mike 1.1 CIMObjectRep& operator=(const CIMObjectRep& x)
153 {
|
154 kumpf 1.9 PEGASUS_ASSERT(0);
|
155 mike 1.1 return *this;
156 }
157
158 friend class CIMObject;
159 };
160
161 PEGASUS_NAMESPACE_END
162
163 #endif /* Pegasus_CIMObjectRep_h */
|