Package mrv :: Module util :: Class InterfaceMaster
[hide private]
[frames] | no frames]

Class InterfaceMaster

source code

         object --+        
                  |        
interface.Interface --+    
                      |    
interface.iDuplicatable --+
                          |
                         InterfaceMaster

Base class making the derived class an interface provider, allowing interfaces to be set, queried and used including build-in use
Nested Classes [hide private]
  InterfaceBase
If your interface class is derived from this base, you get access to access to call to the number of your current caller.
  InterfaceDescriptor
Descriptor handing out interfaces from our interface dict They allow access to interfaces directly through the InterfaceMaster without calling extra functions
  _InterfaceHandler
Utility class passing all calls to the stored InterfaceBase, updating the internal caller-id
Instance Methods [hide private]
 
__init__(self)
Initialize the interface base with some tracking variables
source code
 
interface(self, interfaceName)
Returns: an interface registered with interfaceName
source code
 
listInterfaces(self)
Returns: list of names indicating interfaces available at our InterfaceMaster
source code
 
setInterface(self, interfaceName, interfaceInstance)
Set the given interfaceInstance to be handed out once an interface with interfaceName is requested from the provider base
source code

Inherited from interface.iDuplicatable: copyTo, copyToOther, duplicate

Inherited from interface.Interface: supports

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

    Interface
 
copyFrom(self, other, *args, **kwargs)
Copy all interface from other to self, use they duplciate method if possibly
source code

Inherited from interface.iDuplicatable: createInstance

Class Variables [hide private]
  im_provide_on_instance = True
Properties [hide private]
  _idict

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 
Initialize the interface base with some tracking variables
Overrides: object.__init__

copyFrom(self, other, *args, **kwargs)

source code 
Copy all interface from other to self, use they duplciate method if possibly
Overrides: interface.iDuplicatable.copyFrom

interface(self, interfaceName)

source code 
Returns:
an interface registered with interfaceName
Raises:
  • ValueError - if no such interface exists

listInterfaces(self)

source code 
Returns:
list of names indicating interfaces available at our InterfaceMaster

setInterface(self, interfaceName, interfaceInstance)

source code 
Set the given interfaceInstance to be handed out once an interface with interfaceName is requested from the provider base
Parameters:
  • interfaceName - should start with i..., i.e. names would be iInterface The name can be used to refer to the interface later on
  • interfaceInstance - instance to be handed out once an interface with the given name is requested by the InterfaceMaster or None if None, the interface will effectively be deleted
Raises:
  • ValueError - if given InterfaceBase has a master already