DiCE API nvidia_logo_transpbg.gif Up
mi::neuraylib::INode_manager_worker Class Referenceabstract

The node manager worker class allows to set properties and announce them to other nodes. More...

#include <inode_manager.h>

Inheritance diagram for mi::neuraylib::INode_manager_worker:

Public Member Functions

virtual Sint32 start (const char *listen_address=0, bool tcp=false, const char *discovery_address=0, const char *cluster_interface=0)=0
 Starts the operation of the node manager. More...
 
virtual Sint32 shutdown ()=0
 Shuts down the operation of the node manager. More...
 
virtual const IStringget_listen_address () const =0
 Returns the listen address used by the node manager. More...
 
virtual Sint32 set_multicast_base_address (const char *base_address)=0
 Sets the multicast base address. More...
 
virtual const IStringget_multicast_base_address () const =0
 Returns the multicast base address. More...
 
virtual Sint32 set_property (const char *name, const char *value)=0
 Sets a property of a worker node. More...
 
virtual const IStringget_property (const char *name) const =0
 Returns a property of a worker node. More...
 
virtual Sint32 remove_property (const char *name)=0
 Removes a property of a worker node. More...
 
virtual void set_child_process_resolver (IChild_process_resolver *child_process_resolver)=0
 Sets the child process resolver. More...
 
virtual IChild_process_resolverget_child_process_resolver () const =0
 Returns the child process resolver. More...
 
virtual void add_shutdown_node_managers_callback (IShutdown_node_managers_callback *callback)=0
 Adds a callback to be called when a request to shutdown all clients and workers is received. More...
 
virtual void remove_shutdown_node_managers_callback (IShutdown_node_managers_callback *callback)=0
 Removes a previously added callback to be called when a request to shutdown all clients and workers is received. More...
 
- Public Member Functions inherited from mi::base::IInterface
virtual Uint32 retain () const =0
 Increments the reference count. More...
 
virtual Uint32 release () const =0
 Decrements the reference count. More...
 
virtual const IInterfaceget_interface (const Uuid &interface_id) const =0
 Acquires a const interface from another. More...
 
template<class T>
const T * get_interface () const
 Acquires a const interface from another. More...
 
virtual IInterfaceget_interface (const Uuid &interface_id)=0
 Acquires a mutable interface from another. More...
 
template<class T>
T * get_interface ()
 Acquires a mutable interface from another. More...
 
virtual Uuid get_iid () const =0
 Returns the interface ID of the most derived interface. More...
 

Additional Inherited Members

- Public Types inherited from mi::base::Interface_declare< 0xeb232bd5, ... >
typedef Interface_declare< id1, ... > Self
 Own type. More...
 
typedef Uuid_t< id1, ... > IID
 Declares the interface ID (IID) of this interface. More...
 
- Public Types inherited from mi::base::IInterface
typedef Uuid_t<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0> IID
 Declares the interface ID (IID) of this interface. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0xeb232bd5, ... >
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
 
- Static Public Member Functions inherited from mi::base::IInterface
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface. More...
 

Detailed Description

The node manager worker class allows to set properties and announce them to other nodes.

It also allows a client node to start child processes. It should be used in a process running on the worker nodes.

Member Function Documentation

 add_shutdown_node_managers_callback()

virtual void mi::neuraylib::INode_manager_worker::add_shutdown_node_managers_callback ( IShutdown_node_managers_callback callback)
pure virtual

Adds a callback to be called when a request to shutdown all clients and workers is received.

Parameters
callbackThe callback to be added.
See also
remove_shutdown_node_managers_callback()

 get_child_process_resolver()

virtual IChild_process_resolver * mi::neuraylib::INode_manager_worker::get_child_process_resolver ( ) const
pure virtual

Returns the child process resolver.

See also
set_child_process_resolver()
Returns
The child process resolver.

 get_listen_address()

virtual const IString * mi::neuraylib::INode_manager_worker::get_listen_address ( ) const
pure virtual

Returns the listen address used by the node manager.

Returns
The listen address and port.

 get_multicast_base_address()

virtual const IString * mi::neuraylib::INode_manager_worker::get_multicast_base_address ( ) const
pure virtual

Returns the multicast base address.

The node manager reserves a unique multicast address for each cluster that it manages. These multicast addresses start at the multicast base address and are obtained by incrementing the last octet, then the second-last octet, and so on.

Returns
The currently set multicast base address.
See also
set_multicast_base_address(), mi::neuraylib::ICluster_descriptor::get_multicast_address()

 get_property()

virtual const IString * mi::neuraylib::INode_manager_worker::get_property ( const char *  name) const
pure virtual

Returns a property of a worker node.

See also
set_property(), remove_property()
Parameters
nameThe name of the property to get.
Returns
A string representing the value of the property, or NULL if there is no property with the given name.

 remove_property()

virtual Sint32 mi::neuraylib::INode_manager_worker::remove_property ( const char *  name)
pure virtual

Removes a property of a worker node.

This change will be forwarded immediately to all clients.

See also
set_property(), get_property()
Parameters
nameThe name of the property to remove.
Returns
  • 0: Success.
  • -1: Invalid parameters (NULL pointer).
  • -2: There is no property with the given name.

 remove_shutdown_node_managers_callback()

virtual void mi::neuraylib::INode_manager_worker::remove_shutdown_node_managers_callback ( IShutdown_node_managers_callback callback)
pure virtual

Removes a previously added callback to be called when a request to shutdown all clients and workers is received.

Parameters
callbackThe callback to be removed.
See also
add_shutdown_node_managers_callback()

 set_child_process_resolver()

virtual void mi::neuraylib::INode_manager_worker::set_child_process_resolver ( IChild_process_resolver child_process_resolver)
pure virtual

Sets the child process resolver.

See also
get_child_process_resolver()
Parameters
child_process_resolverThe new child process resolver. The value NULL can be used to remove the current child process resolver (which effectively is the same as a child process resolver instance that returns its first argument unchanged).

 set_multicast_base_address()

virtual Sint32 mi::neuraylib::INode_manager_worker::set_multicast_base_address ( const char *  base_address)
pure virtual

Sets the multicast base address.

The node manager reserves a unique multicast address for each cluster that it manages. These multicast addresses start at the multicast base address and are obtained by incrementing the last octet, then the second-last octet, and so on.

Parameters
base_addressA multicast address to be used as a base when reserving cluster multicast addresses.
Returns
0 in case of success, -1 otherwise
See also
get_multicast_base_address(), mi::neuraylib::ICluster_descriptor::get_multicast_address()

 set_property()

virtual Sint32 mi::neuraylib::INode_manager_worker::set_property ( const char *  name,
const char *  value 
)
pure virtual

Sets a property of a worker node.

This change will be forwarded immediately to all clients.

See also
get_property(), remove_property()
Parameters
nameThe name of the property.
valueThe value to set for the property.
Returns
  • 0: Success.
  • -1: Invalid parameters (NULL pointers).

 shutdown()

virtual Sint32 mi::neuraylib::INode_manager_worker::shutdown ( )
pure virtual

Shuts down the operation of the node manager.

Returns
0 in case of success, -1 otherwise.

 start()

virtual Sint32 mi::neuraylib::INode_manager_worker::start ( const char *  listen_address = 0,
bool  tcp = false,
const char *  discovery_address = 0,
const char *  cluster_interface = 0 
)
pure virtual

Starts the operation of the node manager.

For the optional cluster_interface parameter, the address can also be specified as a sub net using the CIDR notation a.b.c.d/xx. If there is an interface on the host with an address inside this range the first match will be used. This is useful for example when configuring several hosts. This means that on a host which has the address 192.168.1.1, specifying the address as 192.168.0.0/16:10000 would make the host bind to the 192.168.1.1 address on port 10000.

Parameters
listen_addressThe address used to communicate with other node manager instances. Should be a multicast address unless TCP networking is selected.
tcpIndicates whether TCP or UDP should be used.
discovery_addressThe address of the TCP head node used for host discovery. If this is the same as the listen address, the node will be head node.
cluster_interfaceThe address of the cluster interface for listening.
Returns
0 in case of success, -1 otherwise