Package NetworkEditor :: Module datatypes :: Class TypeManager
[hide private]
[frames] | no frames]

Class TypeManager

source code

Port type object manager

This object is used to register port type instances which are associated with port. new types can be registered by passing an instance of port type object to the .addType(instance) method.

The .portTypeInstances dictionary provides a mapping between the a name used to describe the data acceptable for a port and an instance of a subclass of AnyArrayType. This name can be

The .reverseLookUp dictionary is used to obtain a port type from the class of and object. This is used top propagate data types to ports that are mutatable

Instance Methods [hide private]
  __init__(self)
  addSynonym(self, synonymName, existingTypeName=None, datashape=None, color=None, shape=None, width=None, height=None)
method to create synonym types...
  getSynonymDict(self, synonymName)
  addSynonymDict(self, aDict)
  addType(self, dtypeinstance)
register a port type instance
  getType(self, fullName)
  getTypeFromClass(self, klass)
return the data type object for types that can be looked up i.e.
  get(self, key, default=None)

Method Details [hide private]

__init__(self)
(Constructor)

source code 
None

addSynonym(self, synonymName, existingTypeName=None, datashape=None, color=None, shape=None, width=None, height=None)

source code 
method to create synonym types
synonymName: can be an existing name with a diferent datashape:
           (existingTypeName must be None, and the basename 'coord3' must be registered)
           self.addSynonym('coord3(3,4)') 
existingTypeName: must be a registered name 
           (it can be datatshaped, if it is already registered like that)
           self.addSynonym('coordinates3D', existingTypeName='coord3',datashape='(3,4)')
           self.addSynonym('coordinates3D', existingTypeName='coord3(4)',datashape='(3)')
           self.addSynonym('coordinates3D', existingTypeName='coord3(3,4)')

getSynonymDict(self, synonymName)

source code 
None

addSynonymDict(self, aDict)

source code 
None

addType(self, dtypeinstance)

source code 
register a port type instance

getType(self, fullName)

source code 
None

getTypeFromClass(self, klass)

source code 
return the data type object for types that can be looked up i.e. have a class attribute

get(self, key, default=None)

source code 
None