1 karl 1.18 //%2006////////////////////////////////////////////////////////////////////////
|
2 mike 1.10 //
|
3 karl 1.16 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
4 // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
5 // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
|
6 karl 1.15 // IBM Corp.; EMC Corporation, The Open Group.
|
7 karl 1.16 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
8 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
|
9 karl 1.17 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
10 // EMC Corporation; VERITAS Software Corporation; The Open Group.
|
11 karl 1.18 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
12 // EMC Corporation; Symantec Corporation; The Open Group.
|
13 mike 1.10 //
14 // Permission is hereby granted, free of charge, to any person obtaining a copy
|
15 kumpf 1.12 // of this software and associated documentation files (the "Software"), to
16 // deal in the Software without restriction, including without limitation the
17 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
18 mike 1.10 // sell copies of the Software, and to permit persons to whom the Software is
19 // furnished to do so, subject to the following conditions:
20 //
|
21 kumpf 1.12 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
|
22 mike 1.10 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
23 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
24 kumpf 1.12 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
25 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
26 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
27 mike 1.10 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 //
30 //==============================================================================
31 //
32 // Author: Bob Blair (bblair@bmc.com)
33 //
34 // Modified By:
35 //
36 //%/////////////////////////////////////////////////////////////////////////////
37
38
39 //
40 // Header for a class to generate CIMValue objects from String values
41 //
42 //
43 //
44 // Make an object reference available in its parts.
45 //
46 // An object name has 3 parts: namespaceType, namespaceHandle and modelPath
47 // For example, in the object name
48 mike 1.10 // http://somehost:1234/a/b/c:myobj.first="top", last="cat"
49 // the parts are
50 // namespaceType -- http:
51 // namespaceHandle -- /somehost:a/b/c
52 // modelPath -- myobj.first="top", last="cat"
53 //
54 // The namespaceHandle has two components: host and path.
55 // In the example above, this divides as
56 // host -- somehost
57 // path -- /a/b/c
58 //
59 // The host may have two components: a host name and a port.
60 // host -- hostname:1234
61 //
|
62 kumpf 1.14 // The modelPath has two components as well: className and CIMKeyBindings.
|
63 mike 1.10
64 // In the example,
65 // className -- myobj
|
66 kumpf 1.14 // CIMKeyBindings -- first="top", last="cat"
|
67 mike 1.10 //
68 // This class allows you to convert among various forms of the object name:
69 // -- the String (as above)
70 // -- the decomposed pieces
71 // -- an instance object
72 // -- a reference object
73 //
74 // This class uses components from pegasus/Common
75
76 #ifndef _PEGASUS_COMPILER_OBJNAME_H_
77 #define _PEGASUS_COMPILER_OBJNAME_H_
78
79
|
80 kumpf 1.11 #include <Pegasus/Common/CIMObjectPath.h>
|
81 mike 1.10 #include <Pegasus/Common/CIMInstance.h>
82 #include <Pegasus/Common/String.h>
|
83 kumpf 1.13 #include <Pegasus/Compiler/Linkage.h>
|
84 mike 1.10
85 PEGASUS_NAMESPACE_BEGIN
86
87 class PEGASUS_COMPILER_LINKAGE namespaceHandle {
88 private:
89 String _Stringrep;
90 String _host;
91 String _path;
92 void namespaceHandleRepToComponents(const String &rep);
93 const String &namespaceHandleComponentsToRep();
94 public:
95 namespaceHandle(const String &Stringrep);
96 namespaceHandle(const String &host, const String &path);
97 ~namespaceHandle() {;}
98 const String &Stringrep() { return _Stringrep == "" ?
99 namespaceHandleComponentsToRep() :
100 _Stringrep; }
101 const String &host() { return _host; }
102 const String &path() { return _path; }
103 };
104
105 mike 1.10 class PEGASUS_COMPILER_LINKAGE modelPath {
106 private:
107 String _Stringrep;
108 String _className;
109 String _keyString;
|
110 kumpf 1.14 Array<CIMKeyBinding> _KeyBindings;
|
111 mike 1.10 void modelPathRepToComponents(const String &rep);
112 const String &modelPathComponentsToRep();
113 public:
114 modelPath(const String &Stringrep);
115 modelPath(const String &classname, const String &keyString);
|
116 kumpf 1.14 modelPath(const String &classname, const Array<CIMKeyBinding>&bindings);
|
117 mike 1.10 ~modelPath();
|
118 kumpf 1.14 static CIMKeyBinding::Type KeyBindingTypeOf(const String &s);
|
119 mike 1.10 const String &Stringrep() { return modelPathComponentsToRep(); }
120 const String &className() { return _className; }
121 const String &keyString() { return KeyBindingsToKeyString(); }
122 const String &KeyBindingsToKeyString();
|
123 kumpf 1.14 const Array<CIMKeyBinding>& KeyBindings() { return _KeyBindings; }
|
124 mike 1.10 };
125
126 class PEGASUS_COMPILER_LINKAGE objectName {
127 private:
128 String _Stringrep;
129 String _namespaceType;
130 namespaceHandle *_namespaceHandle;
131 modelPath *_modelPath;
|
132 kumpf 1.11 CIMObjectPath *_reference;
|
133 mike 1.10 CIMInstance *_instance;
|
134 kumpf 1.14 Array<CIMKeyBinding> _empty;
|
135 mike 1.10
136 public:
137 objectName();
138 objectName(const String &Stringrep);
139 objectName(const String &namespaceType, const String &namespaceHandle,
140 const String &modelPath);
141 objectName(const String &namespaceType, const String &host,
142 const String &path, const String &modelpath);
143 objectName(const String &namespaceType, const String &host,
144 const String &path, const String &classname,
145 const String &keyString);
146 objectName(const CIMInstance &instance);
147 ~objectName();
148 void set(const String &rep);
149 void set(const String &namespaceType,
150 const String &namespaceHandle,
151 const String &modelPath);
152 const String &Stringrep() { return _Stringrep; }
153 const String &namespaceType() { return _namespaceType; }
154 const String &handle() const {
155 return _namespaceHandle ? _namespaceHandle->Stringrep() : String::EMPTY; }
156 mike 1.10 const String &host() const {
157 return _namespaceHandle ? _namespaceHandle->host() : String::EMPTY; }
158 const String &path() {
159 return _namespaceHandle ? _namespaceHandle->path() : String::EMPTY; }
160 const String &modelpath() {
161 return _modelPath ? _modelPath->Stringrep() : String::EMPTY; }
162 const String &className() const {
163 return _modelPath ? _modelPath->className() : String::EMPTY; }
164 const String &keyString() {
165 return _modelPath ? _modelPath->keyString() : String::EMPTY; }
|
166 kumpf 1.14 const Array<CIMKeyBinding> &KeyBindings() const {
|
167 mike 1.10 return _modelPath ? _modelPath->KeyBindings() : _empty; }
168 const CIMInstance *instance() { return _instance; }
169 };
170
171 PEGASUS_NAMESPACE_END
172
173
174 #endif
|