const nodelist_bn* GetNodeParents_bn ( const node_bn*  node )

Returns a list of the parents of node. Those are the nodes with a link going to node. If it has no parents then an empty list (rather than NULL) will be returned.

The order of the list is significant. Numbering each node in the list (starting from 0) provides a numbering for the links entering node, which is used by some other functions.

If there are several links from the same parent to node, then in the list returned that parent will be repeated once for each link.

To obtain the number of links entering node, use the length of the returned list.

If you need the list to persist, make a copy of the list returned (with DupNodeList_bn), since its contents may become invalid after further calls to Netica API (e.g., one that changes the links of a net, such as AddLink_bn). This is a list managed by Netica (declared const), so do not call any function to modify or free it (e.g., DeleteNodeList_bn).


This function is available in all versions.

See also:

GetNodeChildren_bn    Gets a list of the children
LengthNodeList_bn    Use on returned list to find the number of parents
AddLink_bn    Add a parent
DeleteLink_bn    Remove a parent
SwitchNodeParent_bn    Switch one of the parents for a different one
GetNodeKind_bn    To determine if a link is disconnected (returns DISCONNECTED_NODE)