# Module node

- Description
- Data Types
- Function Index
- Function Details

node data structure + functions.

Copyright © 2007-2011 Zuse Institute Berlin

Version: $Id$

Authors: Thorsten Schuett (`schuett@zib.de`).

## Description

node data structure + functions

## Data Types

### node_type()

abstract datatype: `node_type()`

## Function Index

id/1 | Gets the node's ID.
id_version/1 | Gets the version of the node's ID.
is_me/1 | Checks whether the given node is the same as the node associated with the requesting process.
is_newer/2 | Determines whether Node1 is a newer instance of Node2.
is_valid/1 | Checks whether the given parameter is a valid node.
mk_interval_between_ids/2 | Creates an interval that covers all keys a node with MyKey is responsible for if his predecessor has PredKey, i.e.
mk_interval_between_nodes/2 | Creates an interval that covers all keys a node is responsible for given his predecessor, i.e.
new/3 | Creates a new node.
newer/2 | Determines the newer instance of two representations of the same node.
null/0 | Creates an invalid node.
pidX/1 | Gets the pid of the node.
same_process/2 | Checks whether two nodes are the same, i.e.
update_id/2 | Updates the node's id and increases the id's version accordingly.
yawsPort/1 |

## Function Details

### new/3

    new(Pid :: comm:mypid(),
        Id :: rt_chord:key(),
        IdVersion :: non_neg_integer()) ->
           node_type()

Creates a new node.

### null/0

    null() -> null

Creates an invalid node.

### pidX/1

    pidX(Node :: node_type()) -> comm:mypid()

Gets the pid of the node.

### yawsPort/1

    yawsPort(Node :: node_type()) -> non_neg_integer()

### id/1

    id(Node :: node_type()) -> rt_chord:key()

Gets the node's ID.

### id_version/1

    id_version(Node :: node_type()) -> non_neg_integer()

Gets the version of the node's ID.

### is_valid/1

    is_valid(X :: node_type()) -> true

Checks whether the given parameter is a valid node.

### same_process/2

    same_process(Node1 :: node_type() | comm:mypid() | pid(),
                 Node2 :: node_type()) ->
                    boolean()

Checks whether two nodes are the same, i.e. contain references to the. same process.

### is_me/1

    is_me(Node :: node_type() | null | unknown) -> boolean()

Checks whether the given node is the same as the node associated with the requesting process.

### is_newer/2

    is_newer(Node1 :: node_type(), Node2 :: node_type()) -> boolean()

Determines whether Node1 is a newer instance of Node2. Note: Both nodes need to share the same PID, otherwise an exception of type 'throw' is thrown!

### mk_interval_between_ids/2

    mk_interval_between_ids(PredKey :: rt_chord:key(),
                            MyKey :: rt_chord:key()) ->
                               intervals:interval()

Creates an interval that covers all keys a node with MyKey is responsible for if his predecessor has PredKey, i.e. (PredKey, MyKey]

### mk_interval_between_nodes/2

    mk_interval_between_nodes(Pred :: node:node_type(),
                              Node :: node:node_type()) ->
                                 intervals:interval()

Creates an interval that covers all keys a node is responsible for given his predecessor, i.e. (node:id(PredKey), node:id(MyKey)]

### newer/2

    newer(Node1 :: node_type(), Node2 :: node_type()) -> node_type()

Determines the newer instance of two representations of the same node. Note: Both nodes need to share the same PID, otherwise an exception of type 'throw' is thrown!

### update_id/2

    update_id(Node :: node_type(), NewId :: rt_chord:key()) ->
                 node_type()

Updates the node's id and increases the id's version accordingly.

Generated by EDoc, Apr 22 2017, 15:58:24.