NA_IFACTORY_PROVIDER_GET_INTERFACE()
#define NA_IFACTORY_PROVIDER_GET_INTERFACE( instance ) ( G_TYPE_INSTANCE_GET_INTERFACE(( instance ), NA_IFACTORY_PROVIDER_TYPE, NAIFactoryProviderInterface ))
NAIFactoryProviderInterface
typedef struct {
GTypeInterface parent;
NAIFactoryProviderInterfacePrivate *private;
/**
* get_version:
* @instance: this #NAIFactoryProvider instance.
*
* Returns: the version of this interface supported by @instance implementation.
*
* Defaults to 1.
*/
guint ( *get_version )( const NAIFactoryProvider *instance );
/**
* read_start:
* @reader: this #NAIFactoryProvider instance.
* @reader_data: the data associated to this instance.
* @object: the #NAIFactoryObject object which comes to be readen.
* @messages: a pointer to a #GSList list of strings; the provider
* may append messages to this list, but shouldn't reinitialize it.
*
* API called by #NAIFactoryObject just before starting with reading data.
*/
void ( *read_start ) ( const NAIFactoryProvider *reader, void *reader_data, const NAIFactoryObject *object, GSList **messages );
/**
* read_data:
* @reader: this #NAIFactoryProvider instance.
* @reader_data: the data associated to this instance.
* @object: the #NAIFactoryobject being unserialized.
* @def: a #NADataDef structure which identifies the data to be unserialized.
* @messages: a pointer to a #GSList list of strings; the provider
* may append messages to this list, but shouldn't reinitialize it.
*
* Returns: a newly allocated NADataBoxed which contains the readen value.
* Should return %NULL if data is not found.
*
* This method must be implemented in order any data be read.
*/
NADataBoxed * ( *read_data ) ( const NAIFactoryProvider *reader, void *reader_data, const NAIFactoryObject *object, const NADataDef *def, GSList **messages );
/**
* read_done:
* @reader: this #NAIFactoryProvider instance.
* @reader_data: the data associated to this instance.
* @object: the #NAIFactoryObject object which comes to be readen.
* @messages: a pointer to a #GSList list of strings; the provider
* may append messages to this list, but shouldn't reinitialize it.
*
* API called by #NAIFactoryObject when all data have been readen.
* Implementor may take advantage of this to do some cleanup.
*/
void ( *read_done ) ( const NAIFactoryProvider *reader, void *reader_data, const NAIFactoryObject *object, GSList **messages );
/**
* write_start:
* @writer: this #NAIFactoryProvider instance.
* @writer_data: the data associated to this instance.
* @object: the #NAIFactoryObject object which comes to be written.
* @messages: a pointer to a #GSList list of strings; the provider
* may append messages to this list, but shouldn't reinitialize it.
*
* Returns: a NAIIOProvider operation return code.
*
* API called by #NAIFactoryObject just before starting with writing data.
*/
guint ( *write_start )( const NAIFactoryProvider *writer, void *writer_data, const NAIFactoryObject *object, GSList **messages );
/**
* write_data:
* @writer: this #NAIFactoryProvider instance.
* @writer_data: the data associated to this instance.
* @object: the #NAIFactoryObject object being written.
* @def: the description of the data to be written.
* @value: the #NADataBoxed to be written down.
* @messages: a pointer to a #GSList list of strings; the provider
* may append messages to this list, but shouldn't reinitialize it.
*
* Write the data embedded in @value down to @instance.
*
* Returns: a NAIIOProvider operation return code.
*
* This method must be implemented in order any data be written.
*/
guint ( *write_data ) ( const NAIFactoryProvider *writer, void *writer_data, const NAIFactoryObject *object, const NADataBoxed *boxed, GSList **messages );
/**
* write_done:
* @writer: this #NAIFactoryProvider instance.
* @writer_data: the data associated to this instance.
* @object: the #NAIFactoryObject object which comes to be written.
* @messages: a pointer to a #GSList list of strings; the provider
* may append messages to this list, but shouldn't reinitialize it.
*
* Returns: a NAIIOProvider operation return code.
*
* API called by #NAIFactoryObject when all data have been written.
* Implementor may take advantage of this to do some cleanup.
*/
guint ( *write_done ) ( const NAIFactoryProvider *writer, void *writer_data, const NAIFactoryObject *object, GSList **messages );
} NAIFactoryProviderInterface;