| 195 | == Interface Class == |
| 196 | |
| 197 | This class defines the attachment of an entity, e.g., a [TopdlLibrary#ComputerClass Computer], to a [TopdlLibrary#SubstrateClass Substrate]. As with Substrates and entities, each Interface should be attached to only one entity and be unique across a [TopdlLibrary#Topology Topology]. An Interface has the following members: |
| 198 | |
| 199 | {{{substrate}}}:: |
| 200 | A list of strings, each naming a substrate to which this interface is connected. The list must have at least one entry. |
| 201 | {{{capacity}}}:: |
| 202 | A [TopdlLibrary#CapacityObject Capacity object] indicating the communications capacity of the interface. It may be None to use the substrate default. |
| 203 | {{{latency}}}:: |
| 204 | A [TopdlLibrary#LatencyObject Latency object] indicating the communications delay of the interface. It may be None to use the substrate default. |
| 205 | {{{attribute}}}:: |
| 206 | A list of [TopdlLibrary#AttributeClass Attribute objects] that are attached to the interface. The list may be empty. |
| 207 | {{{element}}}:: |
| 208 | The entity to which this interface is attached. It may be a [TopdlLibrary#ComputerClass Computer object], [TopdlLibrary#TestbedClass Testbed object], [TopdlLibrary#SegmentClass Segment object], or [TopdlLibrary#OtherClass Other object]. This is generally managed by the {{{Topology}}} holding the entity and substrate with which the {{{Interface}}} is attached. It is wise to treat the field as read-only and valid only after a {{{Topology}}} has called {{{incorporate_elements()}}}. |
| 209 | {{{subs}}}:: |
| 210 | A list of [TopdlLibrary#SubstrateClass Substrates] to which the interface is attached. It '''cannot ''' be set through the constructor. This is generally managed by the {{{Topology}}} holding the entity and substrate with which the {{{Interface}}} is attached. It is wise to treat the field as read-only and valid only after a {{{Topology}}} has called {{{incorporate_elements()}}}. |
| 211 | |
| 212 | The constructor takes all the member names '''except subs''' as parameters. Most programs will not need to use {{{element}}} as a parameter to the constructor, either. |
| 213 | |
| 214 | == Attribute Class == |
| 215 | |
| 216 | An attribute is a user-defined annotation of one of the other classes: a key/value pair. An attribute has the following members: |
| 217 | |
| 218 | {{{attribute}}}:: |
| 219 | A string, the key used to find the attribute. |
| 220 | {{{value}}}:: |
| 221 | A string, the value |
| 222 | |
| 223 | While attributes can be manipulated directly liek any of the other topdl classes, it is most common to use the [Topdl#TopdlClassFeatures attribute manipulation functions] of the annotated class to access them. |
| 224 | |
| 225 | Should a program need to call the constructor, it takes the member names as named parameters. |
| 226 | |