Package mrv :: Module dge :: Class plug
[hide private]
[frames] | no frames]

Class plug

source code

object --+    
         |    
     iPlug --+
             |
            plug
Known Subclasses:

Defines an interface allowing to compare compatabilies according to types.

Plugs are implemented as descriptors, thus they will be defined on node class level, and all static information will remain static

As descriptors, they are defined statically on the class, and some additional information such as connectivity, is stored on the respective class instance. These special methods are handled using NodeBase class

Plugs are implemented as descriptors as all type information can be kept per class, whereas only connection information changes per node instance.

Plugs can either be input plugs or output plugs - output plugs affect no other plug on a node, but are affected by 0 or more plugs


Note: class is lowercase as it is used as descriptor ( acting more like a function )

Instance Methods [hide private]
 
setName(self, name)
Set the name of this plug - can be set only once
source code

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

    Overridden object methods
 
__init__(self, attribute)
Intialize the plug with a distinctive name
source code
    Value access
 
__get__(self, obj, cls=None)
A value has been requested - return our plugshell that brings together both, the object and the static plug
source code
    Base Implementation

Inherited from iPlug: __str__

    Interface
 
name(self)
Returns: name of plug
source code
 
affects(self, otherplug)
Set an affects relation ship between this plug and otherplug, saying that this plug affects otherplug.
source code
 
affected(self)
Returns: tuple containing affected plugs ( plugs that are affected by our value )
source code
 
affectedBy(self)
Returns: tuple containing plugs that affect us ( plugs affecting our value )
source code
 
providesOutput(self)
Returns: True if this is an output plug that can trigger computations
source code
 
providesInput(self)
Returns: True if this is an input plug that will never cause computations
source code
Class Variables [hide private]

Inherited from iPlug: kGood, kNo, kPerfect

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, attribute)
(Constructor)

source code 
Intialize the plug with a distinctive name
Overrides: object.__init__

name(self)

source code 
Returns:
name of plug
Overrides: iPlug.name

affects(self, otherplug)

source code 
Set an affects relation ship between this plug and otherplug, saying that this plug affects otherplug.
Overrides: iPlug.affects

affected(self)

source code 
Returns:
tuple containing affected plugs ( plugs that are affected by our value )
Overrides: iPlug.affected

affectedBy(self)

source code 
Returns:
tuple containing plugs that affect us ( plugs affecting our value )
Overrides: iPlug.affectedBy

providesOutput(self)

source code 
Returns:
True if this is an output plug that can trigger computations
Overrides: iPlug.providesOutput

providesInput(self)

source code 
Returns:
True if this is an input plug that will never cause computations
Overrides: iPlug.providesInput