Module: Cmpi
- Defined in:
- lib/cmpi.rb,
lib/cmpi/provider.rb,
ext/cmpi-bindings/cmpi_wrap.c
Overview
Cmpi is the module namespace for cmpi-bindings.
cmpi-bindings implements a CMPI providers in any target language by using the SWIG bindings generator.
Defined Under Namespace
Modules: AssociationProviderIF, IndicationProviderIF, InstanceProviderIF, MethodProviderIF, ProviderIF
Classes: AssociationProvider, CMPIArgs, CMPIArray, CMPIBroker, CMPIContext, CMPIData, CMPIDateTime, CMPIEnumeration, CMPIError, CMPIException, CMPIInstance, CMPIMsgFileHandle, CMPIObjectPath, CMPIPredicate, CMPIResult, CMPISelectCond, CMPISelectExp, CMPIStatus, CMPIString, CMPISubCond, CMPIValue, CMPIValuePtr, IndicationProvider, InstanceProvider, MethodProvider, ValueMap
Constant Summary
collapse
- CMPI_ARRAY =
((1)<<13)
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.args ⇒ Object
84
85
86
|
# File 'lib/cmpi.rb', line 84
def self.args
((16+2)<<8)
end
|
.argsA ⇒ Object
164
165
166
|
# File 'lib/cmpi.rb', line 164
def self.argsA
CMPI_ARRAY | self.args
end
|
.boolean ⇒ Object
40
41
42
|
# File 'lib/cmpi.rb', line 40
def self.boolean
(2+0)
end
|
.booleanA ⇒ Object
120
121
122
|
# File 'lib/cmpi.rb', line 120
def self.booleanA
CMPI_ARRAY | self.boolean
end
|
.broker ⇒ Object
20
21
22
|
# File 'lib/cmpi/provider.rb', line 20
def self.broker
@@broker
end
|
.char16 ⇒ Object
43
44
45
|
# File 'lib/cmpi.rb', line 43
def self.char16
(2+1)
end
|
.char16A ⇒ Object
123
124
125
|
# File 'lib/cmpi.rb', line 123
def self.char16A
CMPI_ARRAY | self.char16
end
|
.chars ⇒ Object
96
97
98
|
# File 'lib/cmpi.rb', line 96
def self.chars
((16+7)<<8)
end
|
.charsA ⇒ Object
176
177
178
|
# File 'lib/cmpi.rb', line 176
def self.charsA
CMPI_ARRAY | self.chars
end
|
.charsptr ⇒ Object
105
106
107
|
# File 'lib/cmpi.rb', line 105
def self.charsptr
((16+10)<<8)
end
|
.charsptrA ⇒ Object
185
186
187
|
# File 'lib/cmpi.rb', line 185
def self.charsptrA
CMPI_ARRAY | self.charsptrA
end
|
.cimdatetime_to_ruby(str) ⇒ Object
Convert CIM DateTime string representation (see DSP0004, 2.2.1) to Ruby Time (timestamp) or Float (interval, as seconds with fraction)
00000000001111111111222222
01234567890123456789012345
East: yyyymmddhhmmss.mmmmmm+utc -> Time (utc = offset in minutes) West: yyyymmddhhmmss.mmmmmm-utc -> Time Interval: ddddddddhhmmss.mmmmmm:000 -> Float (interval in seconds, with fraction)
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
|
# File 'lib/cmpi.rb', line 204
def self.cimdatetime_to_ruby str
case str[21,1]
when '+', '-'
t = Time.new(str[0,4].to_i, str[4,2].to_i, str[6,2].to_i, str[8,2].to_i, str[10,2].to_i, str[12,2].to_i, str[22,3].to_i * ((str[21,1]=='+')?60:-60))
off = str[15,6].to_i / 1000
return t + off
when ':'
off = str[0,8].to_i * 24 * 60 * 60
off += str[8,2].to_i * 60 * 60 + str[10,2].to_i * 60 + str[12,2].to_i
off += str[15,6].to_i / 1000
return off
else
raise "Invalid CIM DateTime '#{str}'"
end
end
|
.dateTime ⇒ Object
99
100
101
|
# File 'lib/cmpi.rb', line 99
def self.dateTime
((16+8)<<8)
end
|
.dateTimeA ⇒ Object
179
180
181
|
# File 'lib/cmpi.rb', line 179
def self.dateTimeA
CMPI_ARRAY | self.dateTime
end
|
.embedded_instance ⇒ Object
111
112
113
|
# File 'lib/cmpi.rb', line 111
def self.embedded_instance
((1)<<15)
end
|
.embedded_instanceA ⇒ Object
191
192
193
|
# File 'lib/cmpi.rb', line 191
def self.embedded_instanceA
CMPI_ARRAY | self.embedded_instance
end
|
.embedded_object ⇒ Object
108
109
110
|
# File 'lib/cmpi.rb', line 108
def self.embedded_object
((1)<<14)
end
|
.embedded_objectA ⇒ Object
188
189
190
|
# File 'lib/cmpi.rb', line 188
def self.embedded_objectA
CMPI_ARRAY | self.embedded_object
end
|
.enumeration ⇒ Object
90
91
92
|
# File 'lib/cmpi.rb', line 90
def self.enumeration
((16+5)<<8)
end
|
.enumerationA ⇒ Object
170
171
172
|
# File 'lib/cmpi.rb', line 170
def self.enumerationA
CMPI_ARRAY | self.enumeration
end
|
.filter ⇒ Object
87
88
89
|
# File 'lib/cmpi.rb', line 87
def self.filter
((16+4)<<8)
end
|
.filterA ⇒ Object
167
168
169
|
# File 'lib/cmpi.rb', line 167
def self.filterA
CMPI_ARRAY | self.filter
end
|
.instance ⇒ Object
78
79
80
|
# File 'lib/cmpi.rb', line 78
def self.instance
((16+0)<<8)
end
|
.instanceA ⇒ Object
158
159
160
|
# File 'lib/cmpi.rb', line 158
def self.instanceA
CMPI_ARRAY | self.instance
end
|
.null ⇒ Object
37
38
39
|
# File 'lib/cmpi.rb', line 37
def self.null
0
end
|
.ptr ⇒ Object
102
103
104
|
# File 'lib/cmpi.rb', line 102
def self.ptr
((16+9)<<8)
end
|
.ptrA ⇒ Object
182
183
184
|
# File 'lib/cmpi.rb', line 182
def self.ptrA
CMPI_ARRAY | self.ptr
end
|
.real32 ⇒ Object
47
48
49
|
# File 'lib/cmpi.rb', line 47
def self.real32
((2+0)<<2)
end
|
.real32A ⇒ Object
127
128
129
|
# File 'lib/cmpi.rb', line 127
def self.real32A
CMPI_ARRAY | self.real32
end
|
.real64 ⇒ Object
50
51
52
|
# File 'lib/cmpi.rb', line 50
def self.real64
((2+1)<<2)
end
|
.real64A ⇒ Object
130
131
132
|
# File 'lib/cmpi.rb', line 130
def self.real64A
CMPI_ARRAY | self.real64
end
|
.ref ⇒ Object
81
82
83
|
# File 'lib/cmpi.rb', line 81
def self.ref
((16+1)<<8)
end
|
.refA ⇒ Object
161
162
163
|
# File 'lib/cmpi.rb', line 161
def self.refA
CMPI_ARRAY | self.ref
end
|
.ruby_to_cimdatetime(val) ⇒ Object
Convert Ruby value to CIM DateTime string representation (see DSP0004, 2.2.1)
00000000001111111111222222
01234567890123456789012345
East: yyyymmddhhmmss.mmmmmm+utc -> Time (utc = offset in minutes, mmmmmm is the microsecond within the second West: yyyymmddhhmmss.mmmmmm-utc -> Time Interval: ddddddddhhmmss.mmmmmm:000 -> Float (interval in seconds, with fraction)
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
|
# File 'lib/cmpi.rb', line 232
def self.ruby_to_cimdatetime val
require 'date'
t = nil
case val
when Time
s = val.strftime "%Y%m%d%H%M%S.%6N"
utc = val.utc_offset if utc < 0
s << "-"
utc = -utc
else
s << "+"
end
val = s + ("%03d" % (utc/60))
when Numeric
if val < 0
val = self.ruby_to_cimdatetime( Time.at(val) )
else
secs = (val / 1000000).to_i
usecs = (val % 1000000).to_i
days = secs / (24 * 60 * 60)
secs = secs % (24 * 60 * 60) hours = (secs / (60 * 60)).to_i
secs = secs % (60 * 60)
mins = (secs / 60).to_i
secs = secs % 60
val = "%08d%02d%02d%02d.%06d:000" % [ days, hours, mins, secs, usecs ]
end
when /^\d{14}\.\d{6}[-+:]\d{3}$/
when String
val = self.ruby_to_cimdatetime val.to_f else
val = self.ruby_to_cimdatetime val.to_s end
val
end
|
.sint16 ⇒ Object
69
70
71
|
# File 'lib/cmpi.rb', line 69
def self.sint16
((8+5)<<4)
end
|
.sint16A ⇒ Object
149
150
151
|
# File 'lib/cmpi.rb', line 149
def self.sint16A
CMPI_ARRAY | self.sint16
end
|
.sint32 ⇒ Object
72
73
74
|
# File 'lib/cmpi.rb', line 72
def self.sint32
((8+6)<<4)
end
|
.sint32A ⇒ Object
152
153
154
|
# File 'lib/cmpi.rb', line 152
def self.sint32A
CMPI_ARRAY | self.sint32
end
|
.sint64 ⇒ Object
75
76
77
|
# File 'lib/cmpi.rb', line 75
def self.sint64
((8+7)<<4)
end
|
.sint64A ⇒ Object
155
156
157
|
# File 'lib/cmpi.rb', line 155
def self.sint64A
CMPI_ARRAY | self.sint64
end
|
.sint8 ⇒ Object
66
67
68
|
# File 'lib/cmpi.rb', line 66
def self.sint8
((8+4)<<4)
end
|
.sint8A ⇒ Object
146
147
148
|
# File 'lib/cmpi.rb', line 146
def self.sint8A
CMPI_ARRAY | self.sint8
end
|
.string ⇒ Object
93
94
95
|
# File 'lib/cmpi.rb', line 93
def self.string
((16+6)<<8)
end
|
.stringA ⇒ Object
173
174
175
|
# File 'lib/cmpi.rb', line 173
def self.stringA
CMPI_ARRAY | self.string
end
|
.uint16 ⇒ Object
57
58
59
|
# File 'lib/cmpi.rb', line 57
def self.uint16
((8+1)<<4)
end
|
.uint16A ⇒ Object
137
138
139
|
# File 'lib/cmpi.rb', line 137
def self.uint16A
CMPI_ARRAY | self.uint16
end
|
.uint32 ⇒ Object
60
61
62
|
# File 'lib/cmpi.rb', line 60
def self.uint32
((8+2)<<4)
end
|
.uint32A ⇒ Object
140
141
142
|
# File 'lib/cmpi.rb', line 140
def self.uint32A
CMPI_ARRAY | self.uint32
end
|
.uint64 ⇒ Object
63
64
65
|
# File 'lib/cmpi.rb', line 63
def self.uint64
((8+3)<<4)
end
|
.uint64A ⇒ Object
143
144
145
|
# File 'lib/cmpi.rb', line 143
def self.uint64A
CMPI_ARRAY | self.uint64
end
|
.uint8 ⇒ Object
54
55
56
|
# File 'lib/cmpi.rb', line 54
def self.uint8
((8+0)<<4)
end
|
.uint8A ⇒ Object
134
135
136
|
# File 'lib/cmpi.rb', line 134
def self.uint8A
CMPI_ARRAY | self.uint8
end
|
Instance Method Details
#not_implemented(klass, name) ⇒ Object
23
24
25
26
|
# File 'lib/cmpi/provider.rb', line 23
def not_implemented klass, name
STDERR.puts "#{klass}.#{name}: not implemented"
nil
end
|