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

Abstract interface to report cluster status changes. More...

#include <ihost_callback.h>

Inheritance diagram for mi::neuraylib::IHost_callback:

Public Member Functions

virtual void connection_callback (Uint32 host_id, bool flag)=0
 This function is called when this host established or lost the connection to the cluster. More...
 
virtual void membership_callback (Uint32 host_id, bool flag)=0
 This function is called when a remote host joined or left the cluster. More...
 
virtual void property_callback (Uint32 host_id, const IHost_properties *properties)=0
 This function is called when a remote host communicates its properties. More...
 
virtual void synchronizer_callback (Uint32 host_id)=0
 This function is called whenever the synchronizer host changes. More...
 
virtual void database_status_callback (const char *status)=0
 This function is called when the database changes status. 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< 0x39163199, ... >
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< 0x39163199, ... >
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

Abstract interface to report cluster status changes.

Each of the methods below deals with a certain type of cluster status changes, for example, hosts joining or leaving a cluster.

Users can implement this interface and register an instance of the implementation class as callback object to be notified in case of cluster status changes (see mi::neuraylib::INetwork_configuration::register_host_callback()).

Note
Instances of this interface should not be created on the stack, since this might lead to premature destruction of such instances while still being in use by DiCE.

Member Function Documentation

 connection_callback()

virtual void mi::neuraylib::IHost_callback::connection_callback ( Uint32  host_id,
bool  flag 
)
pure virtual

This function is called when this host established or lost the connection to the cluster.

It should return as soon as possible because it may block further network operations.

Parameters
host_idThe host ID of this host. This ID is guaranteed to be unique in a cluster and will never be reused for another host.
flagtrue in case of an established connection, false in case of a lost connection.

 database_status_callback()

virtual void mi::neuraylib::IHost_callback::database_status_callback ( const char *  status)
pure virtual

This function is called when the database changes status.

When the database is fully operational the function will be called first with the status "ok". When the database is recovering from a host failure the function will be called with the status "recovery". When the recovery is finished the function will be called with the status "ok" again.

Note that the database can switch to recovery mode when a host is started. This happens when the configured redundancy level could not be reached because simply not enough hosts where present before.

Parameters
statusThe status of the database.

 membership_callback()

virtual void mi::neuraylib::IHost_callback::membership_callback ( Uint32  host_id,
bool  flag 
)
pure virtual

This function is called when a remote host joined or left the cluster.

It should return as soon as possible because it may block further network operations.

Parameters
host_idThe host ID of the host joining or leaving. This ID is guaranteed to be unique in a cluster and will never be reused for another host.
flagtrue in case of a joining host, false in case of a leaving host.

 property_callback()

virtual void mi::neuraylib::IHost_callback::property_callback ( Uint32  host_id,
const IHost_properties properties 
)
pure virtual

This function is called when a remote host communicates its properties.

It should return as soon as possible because it may block further network operations.

Parameters
host_idThe host ID of the remote host. This ID is guaranteed to be unique in a cluster and will never be reused for another host.
propertiesThe properties of the remote host, e.g., its address.

 synchronizer_callback()

virtual void mi::neuraylib::IHost_callback::synchronizer_callback ( Uint32  host_id)
pure virtual

This function is called whenever the synchronizer host changes.

It can be used to record the synchronizer ID for display usages. Since it is guaranteed that there is at any point in time exactly one synchronizer in a working cluster it can also be used to do certain tasks only on the synchronizer.

Parameters
host_idThe host ID of the new synchronizer.