Class: OMX::OMXAttr
- Inherits:
-
Object
- Object
- OMX::OMXAttr
- Extended by:
- FFI::Library
- Defined in:
- lib/OpenMatriX.rb
Overview
A Class to read and return the OMX version and shape (number of zones) attribute
Defined Under Namespace
Classes: InvalidFile
Instance Method Summary collapse
-
#getVersion ⇒ Object
A function to return the OMX Version number.
-
#getZones ⇒ Object
A function to return the number of zones.
-
#initialize(file) ⇒ OMXAttr
constructor
A new instance of OMXAttr.
Constructor Details
#initialize(file) ⇒ OMXAttr
190 191 192 |
# File 'lib/OpenMatriX.rb', line 190 def initialize(file) @id = file.id end |
Instance Method Details
#getVersion ⇒ Object
A function to return the OMX Version number
195 196 197 198 199 200 201 202 |
# File 'lib/OpenMatriX.rb', line 195 def getVersion() aid = basic_openattr(@id,"OMX_VERSION") attrOut = FFI::MemoryPointer.new(H5Types.hsize_t) sv = get_type(aid) oo = basic_readattr(aid,sv,attrOut) raise InvalidFile.new("OMX_VERSION Attribute not found") if oo < 0 return(attrOut.read_string()) end |
#getZones ⇒ Object
A function to return the number of zones
205 206 207 208 209 210 211 212 |
# File 'lib/OpenMatriX.rb', line 205 def getZones() aid = basic_openattr(@id,"SHAPE") attrOut = FFI::MemoryPointer.new(H5Types.hsize_t) sv = get_type(aid) oo = basic_readattr(aid,sv,attrOut) raise InvalidFile.new("SHAPE Attribute not found") if oo < 0 return(attrOut.read_int()) end |