1351a1352,1356
> def __len__(self):
> # Return the number of connected ports, i.e. 0 is we have no
> # peer and 1 if we do.
> return int(self.peer != None)
>
1464a1470,1474
> def __len__(self):
> # Return the number of connected peers, corresponding the the
> # length of the elements.
> return len(self.elements)
>
1527a1538,1548
> # No need for any pre-declarations at the moment as we merely rely
> # on an unsigned int.
> def cxx_predecls(self, code):
> pass
>
> # Declare an unsigned int with the same name as the port, that
> # will eventually hold the number of connected ports (and thus the
> # number of elements for a VectorPort).
> def cxx_decl(self, code):
> code('unsigned int port_${{self.name}}_connection_count;')
>