BonoboProgressiveDataSink

Name

BonoboProgressiveDataSink -- an interface implementation that allows components to sink data slowly

Synopsis



struct      BonoboProgressiveDataSink;
int         (*BonoboProgressiveDataSinkStartFn)
                                            (BonoboProgressiveDataSink *psink,
                                             void *closure);
int         (*BonoboProgressiveDataSinkEndFn)
                                            (BonoboProgressiveDataSink *psink,
                                             void *closure);
int         (*BonoboProgressiveDataSinkAddDataFn)
                                            (BonoboProgressiveDataSink *psink,
                                             const Bonobo_ProgressiveDataSink_iobuf *buffer,
                                             void *closure);
int         (*BonoboProgressiveDataSinkSetSizeFn)
                                            (BonoboProgressiveDataSink *psink,
                                             const CORBA_long count,
                                             void *closure);
typedef     BonoboProgressiveDataSinkClass;
BonoboProgressiveDataSink* bonobo_progressive_data_sink_new
                                            (BonoboProgressiveDataSinkStartFn start_fn,
                                             BonoboProgressiveDataSinkEndFn end_fn,
                                             BonoboProgressiveDataSinkAddDataFn add_data_fn,
                                             BonoboProgressiveDataSinkSetSizeFn set_size_fn,
                                             void *closure);
BonoboProgressiveDataSink* bonobo_progressive_data_sink_construct
                                            (BonoboProgressiveDataSink *psink,
                                             BonoboProgressiveDataSinkStartFn start_fn,
                                             BonoboProgressiveDataSinkEndFn end_fn,
                                             BonoboProgressiveDataSinkAddDataFn add_data_fn,
                                             BonoboProgressiveDataSinkSetSizeFn set_size_fn,
                                             void *closure);

Description

This interface is very little used, few containers support it. It is intended to allow asynchronous dumping of data to a sub-component in such a fashion as to minimize blocking. It transpires that this is not a good way to achieve this.

Deprecated - please use Stream / PersistStream instead.

Details

struct BonoboProgressiveDataSink

struct BonoboProgressiveDataSink;


BonoboProgressiveDataSinkStartFn ()

int         (*BonoboProgressiveDataSinkStartFn)
                                            (BonoboProgressiveDataSink *psink,
                                             void *closure);

psink : 
closure : 
Returns : 


BonoboProgressiveDataSinkEndFn ()

int         (*BonoboProgressiveDataSinkEndFn)
                                            (BonoboProgressiveDataSink *psink,
                                             void *closure);

psink : 
closure : 
Returns : 


BonoboProgressiveDataSinkAddDataFn ()

int         (*BonoboProgressiveDataSinkAddDataFn)
                                            (BonoboProgressiveDataSink *psink,
                                             const Bonobo_ProgressiveDataSink_iobuf *buffer,
                                             void *closure);

psink : 
buffer : 
closure : 
Returns : 


BonoboProgressiveDataSinkSetSizeFn ()

int         (*BonoboProgressiveDataSinkSetSizeFn)
                                            (BonoboProgressiveDataSink *psink,
                                             const CORBA_long count,
                                             void *closure);

psink : 
count : 
closure : 
Returns : 


BonoboProgressiveDataSinkClass

typedef struct {
	BonoboXObjectClass parent_class;

	POA_Bonobo_ProgressiveDataSink__epv epv;

	/* Methods. */
	int (*start_fn)    (BonoboProgressiveDataSink *psink);
	int (*end_fn)      (BonoboProgressiveDataSink *psink);
	int (*add_data_fn) (BonoboProgressiveDataSink *psink,
			    const Bonobo_ProgressiveDataSink_iobuf *buffer);
	int (*set_size_fn) (BonoboProgressiveDataSink *psink,
			    const CORBA_long count);
			 
} BonoboProgressiveDataSinkClass;


bonobo_progressive_data_sink_new ()

BonoboProgressiveDataSink* bonobo_progressive_data_sink_new
                                            (BonoboProgressiveDataSinkStartFn start_fn,
                                             BonoboProgressiveDataSinkEndFn end_fn,
                                             BonoboProgressiveDataSinkAddDataFn add_data_fn,
                                             BonoboProgressiveDataSinkSetSizeFn set_size_fn,
                                             void *closure);

This function creates a new BonoboProgressiveDataSink object and the corresponding CORBA interface object. The new object is initialized with the callback functionss specified by start_fn, end_fn, add_data_fn and set_size_fn.

start_fn : A callback which is invoked when the start method is called on the interface. The start method is used to indicate that a new set of data is being loaded into the Bonobo_ProgressiveDataSink interface.
end_fn : A callback which is invoked when the end method is called on the interface. The end method is called after the entire data transmission is complete.
add_data_fn : A callback which is invoked when the add_data method is called on the interface. This method is called whenever new data is available for the current transmission. The new data is passed as an argument to the method
set_size_fn : A callback which is invoked when the set_size method is called on the interface. The set_size method is used by the caller to specify the total size of the current transmission. This method may be used at any point after start has been called. Objects implementing Bonobo_ProgressiveDataSink may want to use this to know what percentage of the data has been received.
closure : A closure which pis passed to all the callback functions.
Returns : the newly-constructed BonoboProgressiveDataSink object.


bonobo_progressive_data_sink_construct ()

BonoboProgressiveDataSink* bonobo_progressive_data_sink_construct
                                            (BonoboProgressiveDataSink *psink,
                                             BonoboProgressiveDataSinkStartFn start_fn,
                                             BonoboProgressiveDataSinkEndFn end_fn,
                                             BonoboProgressiveDataSinkAddDataFn add_data_fn,
                                             BonoboProgressiveDataSinkSetSizeFn set_size_fn,
                                             void *closure);

This function initializes psink with the CORBA interface provided in corba_psink and the callback functions specified by start_fn, end_fn, add_data_fn and set_size_fn.

psink : The BonoboProgressiveDataSink object to initialize.
start_fn : A callback which is invoked when the start method is called on the interface. The start method is used to indicate that a new set of data is being loaded into the Bonobo_ProgressiveDataSink interface.
end_fn : A callback which is invoked when the end method is called on the interface. The end method is called after the entire data transmission is complete.
add_data_fn : A callback which is invoked when the add_data method is called on the interface. This method is called whenever new data is available for the current transmission. The new data is passed as an argument to the method
set_size_fn : A callback which is invoked when the set_size method is called on the interface. The set_size method is used by the caller to specify the total size of the current transmission. This method may be used at any point after start has been called. Objects implementing Bonobo_ProgressiveDataSink may want to use this to know what percentage of the data has been received.
closure : A closure which pis passed to all the callback functions.
Returns : the initialized BonoboProgressiveDataSink object.

See Also

PersistStream, PersistFile