| Libmatecomponent Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
matecomponent-storagematecomponent-storage — Abstract implementation of the MateComponent::Storage interface |
void matecomponent_storage_copy_to (MateComponent_Storage src,MateComponent_Storage dest,CORBA_Environment *ev);
The MateComponentStorage C interface is extremely simple, this is since the CORBA client interface is where the action occurs. It is anticipated that relatively few people need to implement the MateComponent/Storage IDL interface.
The common entry point for MateComponentStorage is that of opening a storage using the matecomponent_storage_open function, perhaps by a container to use to persist a compound document:
Example 23. An example storage use case
void
container_save (SampleApp *app,
const char *filename,
CORBA_Environment *ev)
{
MateComponentStorage *storage;
MateComponent_Storage corba_storage;
GList *components;
int i;
storage = matecomponent_storage_open (STORAGE_TYPE, filename,
MateComponent_Storage_READ |
MateComponent_Storage_WRITE |
MateComponent_Storage_CREATE,
0664);
g_return_if_fail (storage);
corba_storage = MATECOMPONENT_OBJREF (storage);
...
Serialize components to streams created in the storage
...
MateComponent_Storage_commit (corba_storage, ev);
CORBA_exception_free (ev);
matecomponent_object_unref (MATECOMPONENT_OBJECT (storage));
}
void matecomponent_storage_copy_to (MateComponent_Storage src,MateComponent_Storage dest,CORBA_Environment *ev);
Implements a pure CORBA method for copying one storage into another, this is used by several MateComponentStorage implemetations where a fast case localy copy cannot work.
|
the source storage |
|
the destination storage |
|
CORBA exception environment |