PartialView
Extends:
Structure containing the neighborhood of a peer. Each neigbhor entry comprises a list of ages and a descriptor. Map of {idPeer => {ages:[age_1, age_2.. age_k], descriptor: {x: exampleX} }} where age_1 <= age_2 <= .. <= age_k.
Member Summary
Public Members | ||
public get |
leastFrequent: string: * Get the least frequent peer. |
|
public get |
Get the oldest peer in the partial view. |
Method Summary
Public Methods | ||
public |
addNeighbor(peerId: string, descriptor: object) Add the peer to the partial view with an age of 0. |
|
public |
getDescriptor(peerId: string): object Get the descriptor of the peer in argument. |
|
public |
Increment the age of the whole partial view |
|
public |
removeAllNeighbor(peerId: string): number Remove all entries of the peer from the partial view. |
|
public |
removeOldest(peerId: string) Remove the newest entry of the peer from the partial view. |
|
public |
updateNeighbor(peerId: string, descriptor: object) Update the peer's descriptor. |
Public Members
Public Methods
public addNeighbor(peerId: string, descriptor: object) source
Add the peer to the partial view with an age of 0.
public getDescriptor(peerId: string): object source
Get the descriptor of the peer in argument.
Params:
Name | Type | Attribute | Description |
peerId | string | The identifier of the peer. |
public removeAllNeighbor(peerId: string): number source
Remove all entries of the peer from the partial view.
Params:
Name | Type | Attribute | Description |
peerId | string | The identifier of the peer to remove from the partial view. |