Deserialize object from stream


Typedefs

typedef xf_s xf_t
 Deserializer Class.

Functions

xf_txf_new (xf_refl_t **pprefl, int fd, char *info)
 Constructor.
char * xf_getinfo (xf_t *pxf)
 Get Info.
int xf_getpeer (xf_t *pxf, struct sockaddr *address, socklen_t *address_len)
 Get peer address if input stream is socket.
xf_refl_t ** xf_getrefl (xf_t *pxf)
 Get reflection list.
int xf_parse (xf_t *pxf, xf_instance_t **ppret)
 Parse Input.
void * xf_getuserdata (xf_t *pxf)
 Get user data.
int xf_setuserdata (xf_t *pxf, void *userdata)
 Set user data.
int xf_isreply (xf_t *pxf)
 is data already written back to stream?
int xf_setreply (xf_t *pxf)
 set flag that data is already written back to stream
int xf_isclosed (xf_t *pxf)
 is reply stream data closed?
int xf_setclosed (xf_t *pxf)
 set flag that reply stream is closed
int xf_getfd (xf_t *pxf)
 return file descriptor of stream
int xf_free (xf_t *pxf)
 Desctructor, frees stream deserializer.

Typedef Documentation

typedef struct xf_s xf_t

Deserializer Class.

object deserializer for stream based (socket) input


Function Documentation

int xf_free ( xf_t pxf  ) 

Desctructor, frees stream deserializer.

Parameters:
pxf Deserializer

int xf_getfd ( xf_t pxf  ) 

return file descriptor of stream

gets file descriptor of transfer stream

Parameters:
pxf Deserializer
Returns:
file descriptor, <0: error

char* xf_getinfo ( xf_t pxf  ) 

Get Info.

Parameters:
pxf The deserialiser object to get the info from
Returns:
  • info supplied by creation
  • NULL: error or no info

int xf_getpeer ( xf_t pxf,
struct sockaddr *  address,
socklen_t *  address_len 
)

Get peer address if input stream is socket.

Parameters:
pxf The deserialiser object to get the peer from This function shall retrieve the peer address of the specified xfer stream, store this address in the sockaddr structure pointed to by the address argument, and store the length of this address in the object pointed to by the address_len argument.
If the actual length of the address is greater than the length of the supplied sockaddr structure, the stored address shall be truncated.

If the protocol permits connections by unbound clients, and the peer is not bound, then the value stored in the object pointed to by address is unspecified.

Returns:
  • 0: OK
  • else: error

xf_refl_t** xf_getrefl ( xf_t pxf  ) 

Get reflection list.

Parameters:
pxf The deserialiser object to get the reflection list from
Returns:
  • list of service-reflection that is expected on this deserializer stream
  • NULL: error

void* xf_getuserdata ( xf_t pxf  ) 

Get user data.

Parameters:
pxf The deserialiser object to get the userdata from

int xf_isclosed ( xf_t pxf  ) 

is reply stream data closed?

Parameters:
pxf Deserializer
Returns:
true if reply stream-data has been closed, false: else

int xf_isreply ( xf_t pxf  ) 

is data already written back to stream?

Parameters:
pxf Deserializer
Returns:
true if reply stream-data has been already opened with opening document tag, false: else

xf_t* xf_new ( xf_refl_t **  pprefl,
int  fd,
char *  info 
)

Constructor.

Parameters:
pprefl null-terminated list of reflections of possible object-classes
fd descriptor of stream/socket
info optional info
Returns:
  • deserializer object
  • NULL: error

int xf_parse ( xf_t pxf,
xf_instance_t **  ppret 
)

Parse Input.

This method is to be called when input is available on stream

Parameters:
pxf Deserializer
Returns:
*ppret instance of created object

  • 0: OK, but maybe incomplete object (ppret is NULL)
  • <0: Error
  • >0: End of document
See also:
Instances and serialization

int xf_setclosed ( xf_t pxf  ) 

set flag that reply stream is closed

set flag that reply stream data has been closed with closing tag

Parameters:
pxf Deserializer
Returns:
0: OK, else: Error

int xf_setreply ( xf_t pxf  ) 

set flag that data is already written back to stream

set flag: reply stream data has been opened with opening tag

Parameters:
pxf Deserializer
Returns:
0: OK, else: Error

int xf_setuserdata ( xf_t pxf,
void *  userdata 
)

Set user data.

Parameters:
pxf The deserialiser object to set the userdata


Generated on 4 Mar 2014 for xfer by  doxygen 1.4.7