| |
- builtins.object
-
- PortManager
- builtins.tuple(builtins.object)
-
- Port
- enum.Enum(builtins.object)
-
- PortType
class Port(builtins.tuple) |
|
Port(label: str, kind: vcorelib.graph.port.PortType = <PortType.INOUT: 3>, alias: Optional[str] = None, allocated: bool = False)
A simple implementation for generic, input and output ports. |
|
- Method resolution order:
- Port
- builtins.tuple
- builtins.object
Methods defined here:
- __getnewargs__(self)
- Return self as a plain tuple. Used by copy and pickle.
- __repr__(self)
- Return a nicely formatted representation string
- __str__(self) -> str
- Get this port as a string.
- _asdict(self)
- Return a new dict which maps field names to their values.
- _replace(self, /, **kwds)
- Return a new Port object replacing specified fields with new values
- allocate(self) -> 'Port'
- Allocate this port.
Class methods defined here:
- _make(iterable) from builtins.type
- Make a new Port object from a sequence or iterable
Static methods defined here:
- __new__(_cls, label: str, kind: vcorelib.graph.port.PortType = <PortType.INOUT: 3>, alias: Optional[str] = None, allocated: bool = False)
- Create new instance of Port(label, kind, alias, allocated)
Readonly properties defined here:
- is_input
- Determine if this is an input port.
- is_output
- Determine if this is an output port.
Data descriptors defined here:
- label
- Alias for field number 0
- kind
- Alias for field number 1
- alias
- Alias for field number 2
- allocated
- Alias for field number 3
Data and other attributes defined here:
- __annotations__ = {'alias': typing.Optional[str], 'allocated': <class 'bool'>, 'kind': <enum 'PortType'>, 'label': <class 'str'>}
- __match_args__ = ('label', 'kind', 'alias', 'allocated')
- __orig_bases__ = (<function NamedTuple>,)
- _field_defaults = {'alias': None, 'allocated': False, 'kind': <PortType.INOUT: 3>}
- _fields = ('label', 'kind', 'alias', 'allocated')
Methods inherited from builtins.tuple:
- __add__(self, value, /)
- Return self+value.
- __contains__(self, key, /)
- Return bool(key in self).
- __eq__(self, value, /)
- Return self==value.
- __ge__(self, value, /)
- Return self>=value.
- __getattribute__(self, name, /)
- Return getattr(self, name).
- __getitem__(self, key, /)
- Return self[key].
- __gt__(self, value, /)
- Return self>value.
- __hash__(self, /)
- Return hash(self).
- __iter__(self, /)
- Implement iter(self).
- __le__(self, value, /)
- Return self<=value.
- __len__(self, /)
- Return len(self).
- __lt__(self, value, /)
- Return self<value.
- __mul__(self, value, /)
- Return self*value.
- __ne__(self, value, /)
- Return self!=value.
- __rmul__(self, value, /)
- Return value*self.
- count(self, value, /)
- Return number of occurrences of value.
- index(self, value, start=0, stop=9223372036854775807, /)
- Return first index of value.
Raises ValueError if the value is not present.
Class methods inherited from builtins.tuple:
- __class_getitem__(...) from builtins.type
- See PEP 585
|
class PortManager(builtins.object) |
|
PortManager() -> None
An interface for managing input and output ports. |
|
Methods defined here:
- __init__(self) -> None
- Initialize this port manager.
- allocate(self, label: str) -> vcorelib.graph.port.Port
- Allocate a labeled port.
- create(self, label: str, **kwargs) -> vcorelib.graph.port.Port
- Add a new port to this port manager.
- inout_labels(self) -> Set[str]
- Get inout port labels.
- input_labels(self, exclude_inout: bool = True) -> Set[str]
- Get input port labels.
- label(self, stream: <class 'TextIO'>) -> None
- Create a record label based on the current port configuration.
- output_labels(self, exclude_inout: bool = True) -> Set[str]
- Get output port labels.
Data descriptors defined here:
- __dict__
- dictionary for instance variables
- __weakref__
- list of weak references to the object
|
class PortType(enum.Enum) |
|
PortType(*values)
An enumeration of port types. |
|
- Method resolution order:
- PortType
- enum.Enum
- builtins.object
Data and other attributes defined here:
- INOUT = <PortType.INOUT: 3>
- INPUT = <PortType.INPUT: 1>
- OUTPUT = <PortType.OUTPUT: 2>
Data descriptors inherited from enum.Enum:
- name
- The name of the Enum member.
- value
- The value of the Enum member.
Methods inherited from enum.EnumType:
- __contains__(value) from enum.EnumType
- Return True if `value` is in `cls`.
`value` is in `cls` if:
1) `value` is a member of `cls`, or
2) `value` is the value of one of the `cls`'s members.
- __getitem__(name) from enum.EnumType
- Return the member matching `name`.
- __iter__() from enum.EnumType
- Return members in definition order.
- __len__() from enum.EnumType
- Return the number of members (no aliases)
Readonly properties inherited from enum.EnumType:
- __members__
- Returns a mapping of member name->value.
This mapping lists all enum members, including aliases. Note that this
is a read-only view of the internal mapping.
| |