Reading Modified Objects
[API's]


Detailed Description

These functions are used to read all modified records from a DataStore during a synchronization session. The input snapshot defines which records have been modified.


Functions

alp_status_t alp_hscm_read_modified_object_content (AlpHsObjectReadHandle hRead, AlpHsObjectPtr pObj, AlpHsObjectTypePtr pTgtType, bool *pMoreData, size_t *pSize, _TCHAR *buffer)
 Read the input object's modified content.
alp_status_t alp_hscm_read_modified_object_size (AlpHsObjectReadHandle hRead, AlpHsObjectPtr pObj, AlpHsObjectTypePtr pTgtType, size_t *pSize)
 Retrieve the size of the input object's content when formatted according to the input MIME type.
alp_status_t alp_hscm_read_modified_objects_begin (AlpHsChangeMgrHandle hChgMgr, AlpHsSnapshotHandle hSnapshot, AlpHsObjectReadHandle *phRead)
 Begin reading modified objects from an open datastore.
alp_status_t alp_hscm_read_modified_objects_end (AlpHsObjectReadHandle hRead)
 End reading modified objects from an open datastore.
alp_status_t alp_hscm_read_next_modified_object (AlpHsObjectReadHandle hRead, AlpHsObjectPtr *pObj)
 Read the next modified object from an open datastore.


Function Documentation

alp_status_t alp_hscm_read_modified_object_content AlpHsObjectReadHandle  hRead,
AlpHsObjectPtr  pObj,
AlpHsObjectTypePtr  pTgtType,
bool *  pMoreData,
size_t *  pSize,
_TCHAR *  buffer
 

Read the input object's modified content.

When alp_hscm_read_next_modified_object() returns an object whose state is not deleted, this function may be called to retrieve the object's content from the currently open datastore. Each call returns the next *pSize bytes of the content formatted according to the specified target MIME type.

Parameters:
[in] hRead The read handle
[in] pObj The last object returned from alp_hscm_read_next_modified_object().
[in] pTgtType The target MIME type
[out] pMoreData True when there is more content to read
[in,out] pSize On input, the size of buffer; on output, the number of bytes written to buffer
[in,out] buffer The content buffer
Remarks:
The caller must allocate and deallocate the input content buffer.

If the last character in the object is the null terminator character, that character is ignored from the size count.

The Change Manager calls alp_hsds_read() to implement this function.

Returns:
If successful returns ALP_STATUS_HOTSYNC_OK; otherwise returns an error.
See also:
alp_hscm_read_modified_object_size().

alp_status_t alp_hscm_read_modified_object_size AlpHsObjectReadHandle  hRead,
AlpHsObjectPtr  pObj,
AlpHsObjectTypePtr  pTgtType,
size_t *  pSize
 

Retrieve the size of the input object's content when formatted according to the input MIME type.

Parameters:
[in] hRead The read handle
[in] pObj The last object returned from alp_hscm_read_next_modified_object().
[in] pTgtType The target MIME type
[out] pSize The return value
Remarks:
If the last character in the object is the null terminator character, that character is ignored from the size count.
Returns:
If successful returns ALP_STATUS_HOTSYNC_OK to indicate that another object was read or ALP_STATUS_HOTSYNC_DONE to indicate that all objects have been read; otherwise returns an error.
See also:
alp_hscm_read_modified_object_content().

alp_status_t alp_hscm_read_modified_objects_begin AlpHsChangeMgrHandle  hChgMgr,
AlpHsSnapshotHandle  hSnapshot,
AlpHsObjectReadHandle phRead
 

Begin reading modified objects from an open datastore.

This function initiates reading of modified objects from the datastore that is currently open. An object is considered modified if its pedigree is included in the input snapshot.

Parameters:
[in] hChgMgr Handle to a ChangeMgr open for a datastore
[in] hSnapshot Handle for an open snapshot
[out] phRead Pointer to a read handle
Returns:
If successful returns ALP_STATUS_HOTSYNC_OK; otherwise returns an error.
See also:
alp_hscm_open(), alp_hscm_open_datastore(), alp_hscm_add_datastore_to_snapshot(), alp_hscm_open_snapshot().

alp_status_t alp_hscm_read_modified_objects_end AlpHsObjectReadHandle  hRead  ) 
 

End reading modified objects from an open datastore.

Parameters:
[in] hRead The read handle
Returns:
If successful returns ALP_STATUS_HOTSYNC_OK; otherwise returns an error.
Remarks:
This function is normally called after alp_hscm_read_next_modified_object() returns ALP_STATUS_HOTSYNC_DONE.
Returns:
If successful returns ALP_STATUS_HOTSYNC_OK; otherwise returns an error.
See also:
alp_hscm_read_modified_objects_begin().

alp_status_t alp_hscm_read_next_modified_object AlpHsObjectReadHandle  hRead,
AlpHsObjectPtr pObj
 

Read the next modified object from an open datastore.

Parameters:
[in] hRead The read handle returned from alp_hscm_read_modified_objects_begin()
[in,out] pObj Pointer to an object pointer
Returns:
If successful returns ALP_STATUS_HOTSYNC_OK; otherwise returns an error.
Remarks:
Each call to this function frees the object returned by the prior call.
See also:
alp_hscm_read_modified_objects_begin().


Generated on Wed Jul 30 07:06:41 2008 by Doxygen 1.4.6 for ALP SDK + Hiker Documentation

Copyright © 1999-2008 ACCESS CO., LTD. All rights reserved.