Class: Pocolog::Format::V2::IndexStreamInfo
- Inherits:
-
Struct
- Object
- Struct
- Pocolog::Format::V2::IndexStreamInfo
- Defined in:
- lib/pocolog/format/v2.rb
Instance Attribute Summary collapse
-
#base_time ⇒ Object
Returns the value of attribute base_time.
-
#declaration_pos ⇒ Object
Returns the value of attribute declaration_pos.
-
#index_pos ⇒ Object
Returns the value of attribute index_pos.
-
#lg_max ⇒ Object
Returns the value of attribute lg_max.
-
#lg_min ⇒ Object
Returns the value of attribute lg_min.
-
#rt_max ⇒ Object
Returns the value of attribute rt_max.
-
#rt_min ⇒ Object
Returns the value of attribute rt_min.
-
#stream_size ⇒ Object
Returns the value of attribute stream_size.
Class Method Summary collapse
-
.unmarshal(data) ⇒ Object
rubocop:disable Metrics/AbcSize.
Instance Method Summary collapse
Instance Attribute Details
#base_time ⇒ Object
Returns the value of attribute base_time
229 230 231 |
# File 'lib/pocolog/format/v2.rb', line 229 def base_time @base_time end |
#declaration_pos ⇒ Object
Returns the value of attribute declaration_pos
229 230 231 |
# File 'lib/pocolog/format/v2.rb', line 229 def declaration_pos @declaration_pos end |
#index_pos ⇒ Object
Returns the value of attribute index_pos
229 230 231 |
# File 'lib/pocolog/format/v2.rb', line 229 def index_pos @index_pos end |
#lg_max ⇒ Object
Returns the value of attribute lg_max
229 230 231 |
# File 'lib/pocolog/format/v2.rb', line 229 def lg_max @lg_max end |
#lg_min ⇒ Object
Returns the value of attribute lg_min
229 230 231 |
# File 'lib/pocolog/format/v2.rb', line 229 def lg_min @lg_min end |
#rt_max ⇒ Object
Returns the value of attribute rt_max
229 230 231 |
# File 'lib/pocolog/format/v2.rb', line 229 def rt_max @rt_max end |
#rt_min ⇒ Object
Returns the value of attribute rt_min
229 230 231 |
# File 'lib/pocolog/format/v2.rb', line 229 def rt_min @rt_min end |
#stream_size ⇒ Object
Returns the value of attribute stream_size
229 230 231 |
# File 'lib/pocolog/format/v2.rb', line 229 def stream_size @stream_size end |
Class Method Details
.unmarshal(data) ⇒ Object
rubocop:disable Metrics/AbcSize
257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 |
# File 'lib/pocolog/format/v2.rb', line 257 def self.unmarshal(data) # rubocop:disable Metrics/AbcSize declaration_pos, index_pos, base_time, stream_size, interval_rt_min, interval_rt_max, interval_lg_min, interval_lg_max = data.unpack("Q>*") if stream_size == 0 base_time = nil interval_rt = [] interval_lg = [] else interval_rt = [interval_rt_min, interval_rt_max] interval_lg = [interval_lg_min, interval_lg_max] end IndexStreamInfo.new( declaration_pos: declaration_pos, index_pos: index_pos, base_time: base_time, stream_size: stream_size, rt_min: interval_rt[0], rt_max: interval_rt[1], lg_min: interval_lg[0], lg_max: interval_lg[1] ) end |
Instance Method Details
#interval_lg ⇒ Object
245 246 247 248 249 250 251 |
# File 'lib/pocolog/format/v2.rb', line 245 def interval_lg if lg_min != lg_max || lg_min [lg_min, lg_max] else [] end end |
#interval_rt ⇒ Object
237 238 239 240 241 242 243 |
# File 'lib/pocolog/format/v2.rb', line 237 def interval_rt if rt_min != rt_max || rt_min [rt_min, rt_max] else [] end end |
#marshal ⇒ Object
253 254 255 |
# File 'lib/pocolog/format/v2.rb', line 253 def marshal to_a.pack("Q>*") end |