Getting Started

The CODEC (enCOder/DECoder)

Encoding and decoding is performed using a 'codec'. A codec is created by a call to the fast_create_codec() function:

   #include <fastapi.h>

   fast_codec_t* codec = fast_create_codec ();
   ...

Field Tags

Fields are described by Field Tags fast_tag_t that contains:

Messages

Fields are encoded within messages, which are delimited by calls to fast_encode_new_msg() and fast_encode_end_msg() as follows:

   #include <fastapi.h>

   fast_codec_t* codec = fast_create_codec ();
   fast_encode_new_msg (codec, tag);
   ... calls to encoding functions ...
   fast_encode_end_msg (codec, tag);
   ...

Encoding Fields

Fields can be encoded using fast_encode_xxx functions:

   #include <fastapi.h>

   fast_codec_t* codec = fast_create_codec ();

   fast_tag_t tag1 = MAKE_TAG (FAST_TYPE_U32, FAST_OP_NONE, 0, 0);
   fast_tag_t tag2 = MAKE_TAG (FAST_TYPE_STR, FAST_OP_NONE, 0, 1);

   fast_encode_u32 (codec, tag1, 4711);
   fast_encode_str (codec, tag2, "foo", strlen ("foo"));

Generated on Thu Feb 9 13:11:35 2006 for fastapi by doxygen 1.4.6-NO    FAST ProtocolSM