qubx :: tree :: NodeStorage :: Class NodeStorage
[hide private]
[frames] | no frames]

Class NodeStorage

source code

object --+
         |
        NodeStorage
Known Subclasses:

Abstract base class for managing a concrete representation of one qubtree node.

Subclasses NodeInFile and NodeInMem are instantiated as needed by class Node.

Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
set_clean(self, x)
Called by subclass methods when they make a change to the node structure from what's on disk.
source code
 
get_ondirtied(self) source code
 
set_ondirtied(self, x) source code
 
get_data_item(self, i) source code
 
set_data_item(self, i, x) source code
 
get_dataPos(self) source code
 
get_childPos(self) source code
 
set_childPos(self, x) source code
 
get_siblingPos(self) source code
 
set_siblingPos(self, x) source code
 
setup_data(self, type, rows, cols) source code
 
resize_data(self, nr, type_if_none) source code
 
clear_data(self) source code
 
map_data(self) source code
 
set_string_data(self, s) source code
 
load_rows(self, first, last, do_read) source code
 
unload_rows(self, do_write) source code
 
read_rows(self, first, last) source code
 
write_rows(self, first, last, arr) source code
 
get_rows(self, first, last) source code
 
get_file(self) source code
 
get_offset(self) source code
 
read(self) source code
 
write(self) source code
 
measure(self)
Returns the number of bytes required for this node and its data (not children etc).
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]
  clean
whether this node has an up-to-date representation on disk.
  OnDirtied
  name
the node's name
  preload
whether to load all data elements on file open
  dataCount
total number of data elements; rows*cols
  dataSize
size of one data element, in bytes
  dataType
type of data, in QTR_TYPE_*
  dataPos
position of data in a file, in bytes
  childPos
position of child node in file, in bytes, or 0
  siblingPos
position of sibling node in file, in bytes, or 0
  rows
number of rows of data
  cols
number of columns of data
  loaded
indices of (first, last) loaded rows
  loadedRows
indices of (first, last) loaded data elements
  data
the actual data, mutable if possible.
  file
the NodeFile containing this node, or None
  offset
the location of this node (frame) in file, in bytes
  __clean
  __dirtied

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

Property Details [hide private]

clean

whether this node has an up-to-date representation on disk.

Get Method:
unreachable(self)
Set Method:
unreachable(self, x)

OnDirtied

Get Method:
unreachable(self)
Set Method:
unreachable(self, x)
Delete Method:
'client-provided f(storage) is called when clean becomes False.'

name

the node's name

Get Method:
unreachable(self)
Set Method:
unreachable(self, x)

preload

whether to load all data elements on file open

Get Method:
unreachable(self)
Set Method:
unreachable(self, x)

dataCount

total number of data elements; rows*cols

Get Method:
unreachable(self)

dataSize

size of one data element, in bytes

Get Method:
unreachable(self)

dataType

type of data, in QTR_TYPE_*

Get Method:
unreachable(self)

dataPos

position of data in a file, in bytes

Get Method:
unreachable(self)

childPos

position of child node in file, in bytes, or 0

Get Method:
unreachable(self)
Set Method:
unreachable(self, x)

siblingPos

position of sibling node in file, in bytes, or 0

Get Method:
unreachable(self)
Set Method:
unreachable(self, x)

rows

number of rows of data

Get Method:
unreachable(self)

cols

number of columns of data

Get Method:
unreachable(self)

loaded

indices of (first, last) loaded rows

Get Method:
unreachable(self)

loadedRows

indices of (first, last) loaded data elements

Get Method:
unreachable(self)

data

the actual data, mutable if possible. Depending on data type and storage type, can be an mmap.mmap, a slice of an mmap.mmap, a numpy.array, a numpy array onto a slice of an mmap.mmap, or a plain string.

Get Method:
unreachable(self)

file

the NodeFile containing this node, or None

Get Method:
unreachable(self)

offset

the location of this node (frame) in file, in bytes

Get Method:
unreachable(self)