NewMadeleine

Documentation

Pack interface

This is the nmad Pack interface, an nmad interface with incremental packing/unpacking of messages, and fully blocking interface. More...

typedef struct nm_pack_cnx_s nm_pack_cnx_t
 A request for the pack interface. More...
 
int nm_begin_packing (nm_session_t p_session, nm_gate_t p_gate, nm_tag_t tag, nm_pack_cnx_t *p_cnx)
 Start building a new message for sending. More...
 
int nm_pack (nm_pack_cnx_t *p_cnx, const void *ptr, nm_len_t len)
 Append a data fragment to the current message. More...
 
int nm_pack_express (nm_pack_cnx_t *p_cnx, const void *ptr, nm_len_t len)
 Append a data fragment to the current message, in express mode: data will be aavailable immediately after unpack in receiver side. More...
 
int nm_end_packing (nm_pack_cnx_t *p_cnx)
 End building and send the current message. More...
 
int nm_begin_unpacking (nm_session_t p_session, nm_gate_t p_gate, nm_tag_t tag, nm_pack_cnx_t *p_cnx)
 Start receiving and extracting a new message. More...
 
int nm_unpack (nm_pack_cnx_t *p_cnx, void *ptr, nm_len_t len)
 Extract a data fragment from the current message; data will actually be available after end_unpacking. More...
 
int nm_unpack_express (nm_pack_cnx_t *p_cnx, void *ptr, nm_len_t len)
 Extract a data fragment from the current message in express mode: data will be available upon function return. More...
 
int nm_end_unpacking (nm_pack_cnx_t *p_cnx)
 End receiving and flush extraction of the current message. More...
 

Detailed Description

This is the nmad Pack interface, an nmad interface with incremental packing/unpacking of messages, and fully blocking interface.

It is similar, although not indentical, to the old interface from mad3.

Typedef Documentation

◆ nm_pack_cnx_t

typedef struct nm_pack_cnx_s nm_pack_cnx_t

A request for the pack interface.

Definition at line 50 of file nm_pack_interface.h.

Function Documentation

◆ nm_begin_packing()

int nm_begin_packing ( nm_session_t  p_session,
nm_gate_t  p_gate,
nm_tag_t  tag,
nm_pack_cnx_t p_cnx 
)

Start building a new message for sending.

Parameters
p_sessiona pointer to a nmad session object.
p_gatethe gate to the destination.
tagthe message tag.
p_cnxpointer to a pack request allocated by user
Returns
The NM status.
Examples
nm_pack_headers.c.

◆ nm_begin_unpacking()

int nm_begin_unpacking ( nm_session_t  p_session,
nm_gate_t  p_gate,
nm_tag_t  tag,
nm_pack_cnx_t p_cnx 
)

Start receiving and extracting a new message.

Parameters
p_sessiona pointer to a nmad session object.
p_gatethe gate of the source or -1 for receiving from any source.
tagthe message tag.
p_cnxpointer to a pack request allocated by user
Returns
The NM status.
Examples
nm_pack_headers.c.

◆ nm_end_packing()

int nm_end_packing ( nm_pack_cnx_t p_cnx)

End building and send the current message.

Parameters
p_cnxa NM/SO connection pointer.
Returns
The NM status.
Examples
nm_pack_headers.c.

◆ nm_end_unpacking()

int nm_end_unpacking ( nm_pack_cnx_t p_cnx)

End receiving and flush extraction of the current message.

Parameters
p_cnxa NM/SO connection pointer.
Returns
The NM status.
Examples
nm_pack_headers.c.

◆ nm_pack()

int nm_pack ( nm_pack_cnx_t p_cnx,
const void *  ptr,
nm_len_t  len 
)

Append a data fragment to the current message.

Parameters
p_cnxa NM/SO connection pointer.
ptra pointer to the data fragment.
lenthe length of the data fragment.
Returns
The NM status.
Examples
nm_pack_headers.c.

◆ nm_pack_express()

int nm_pack_express ( nm_pack_cnx_t p_cnx,
const void *  ptr,
nm_len_t  len 
)

Append a data fragment to the current message, in express mode: data will be aavailable immediately after unpack in receiver side.

Examples
nm_pack_headers.c.

◆ nm_unpack()

int nm_unpack ( nm_pack_cnx_t p_cnx,
void *  ptr,
nm_len_t  len 
)

Extract a data fragment from the current message; data will actually be available after end_unpacking.

Parameters
p_cnxa NM/SO connection pointer.
ptra pointer to the data fragment.
lenthe length of the data fragment.
Returns
The NM status.
Examples
nm_pack_headers.c.

◆ nm_unpack_express()

int nm_unpack_express ( nm_pack_cnx_t p_cnx,
void *  ptr,
nm_len_t  len 
)

Extract a data fragment from the current message in express mode: data will be available upon function return.

Note: data must have been sent with pack_express primitive.

Examples
nm_pack_headers.c.