Volksdata 1.0b10
RDF library
Loading...
Searching...
No Matches

Codec structure. More...

#include <codec_interface.h>

Collaboration diagram for VOLK_Codec:

Data Fields

decode_dset_fn_t decode_dset
 Dataset decoder function.
decode_gr_fn_t decode_graph
 Graph decoder function.
decode_term_fn_t decode_term
 Term decoder function.
encode_dset_done_fn_t encode_dset_done
 dataset encoder finalization.
encode_dset_init_fn_t encode_dset_init
 dataset encoder initialization.
encode_dset_iter_fn_t encode_dset_iter
 dataset encoder iteration.
encode_gr_done_fn_t encode_graph_done
 Graph encoder finalization.
encode_gr_init_fn_t encode_graph_init
 Graph encoder initialization.
encode_gr_iter_fn_t encode_graph_iter
 Graph encoder iteration.
encode_term_fn_t encode_term
 Feature flags.
char extension [8]
 Serialized file extension.
VOLK_CodecFeatures features
char mimetype [32]
 MIME type associated with the codec.
char name [16]
 Name of the codec.

Detailed Description

Codec structure.

An instance of this structure is a singleton defined at compile time (see examples in "include/codec_*.h" and "src/codec_*.c") and MUST have the following defined:

  • name: A brief (15-char max), human-readable name for the codec.
  • mimetype: MIME type (31-char max) associated with the codec.
  • extension: File extension associated with the serialized file.

Additionally, it MAY implement any of the following encoding and decoding functions, depending on the scope of the codec:

  • encode_term: Encode a single term.
  • encode_graph_init: Initialize a graph decoding loop.
  • encode_graph_iter: Run one iteration of encoding on one or more triples.
  • encode_graph_done: Finalize the encoding loop and free the support data.
  • encode_dset_*: encode a dataset with zero or more graphs.
  • decode_term: Decode a single term.
  • decode_graph: Decode a RDF document into a graph.
  • decode_dset: Decode a RDF document into a dataset with zero or more graphs.

For documentation on the individual encoding and decoding callbacks, see the related function prototypes.

This interface is abstracted by the high-level codec module. That module handles non-implemented functionality gracefully by returning VOLK_NOT_IMPL_ERR.

Note
Functions in the high-level codec module do not check if a function is defined, they only look at the features flags to decide whether a function can be called. Therefore, implementers must be careful to match the implemented functions with the feature flags.

Definition at line 438 of file codec_interface.h.

Field Documentation

◆ decode_dset

decode_dset_fn_t VOLK_Codec::decode_dset

Dataset decoder function.

Definition at line 460 of file codec_interface.h.

◆ decode_graph

decode_gr_fn_t VOLK_Codec::decode_graph

Graph decoder function.

Definition at line 458 of file codec_interface.h.

◆ decode_term

decode_term_fn_t VOLK_Codec::decode_term

Term decoder function.

Definition at line 456 of file codec_interface.h.

◆ encode_dset_done

encode_dset_done_fn_t VOLK_Codec::encode_dset_done

dataset encoder finalization.

Definition at line 453 of file codec_interface.h.

◆ encode_dset_init

encode_dset_init_fn_t VOLK_Codec::encode_dset_init

dataset encoder initialization.

Definition at line 451 of file codec_interface.h.

◆ encode_dset_iter

encode_dset_iter_fn_t VOLK_Codec::encode_dset_iter

dataset encoder iteration.

Definition at line 452 of file codec_interface.h.

◆ encode_graph_done

encode_gr_done_fn_t VOLK_Codec::encode_graph_done

Graph encoder finalization.

Definition at line 449 of file codec_interface.h.

◆ encode_graph_init

encode_gr_init_fn_t VOLK_Codec::encode_graph_init

Graph encoder initialization.

Definition at line 447 of file codec_interface.h.

◆ encode_graph_iter

encode_gr_iter_fn_t VOLK_Codec::encode_graph_iter

Graph encoder iteration.

Definition at line 448 of file codec_interface.h.

◆ encode_term

encode_term_fn_t VOLK_Codec::encode_term

Feature flags.

Term encoder function.

Definition at line 445 of file codec_interface.h.

◆ extension

char VOLK_Codec::extension[8]

Serialized file extension.

Definition at line 441 of file codec_interface.h.

◆ features

VOLK_CodecFeatures VOLK_Codec::features

Definition at line 442 of file codec_interface.h.

◆ mimetype

char VOLK_Codec::mimetype[32]

MIME type associated with the codec.

Definition at line 440 of file codec_interface.h.

◆ name

char VOLK_Codec::name[16]

Name of the codec.

Definition at line 439 of file codec_interface.h.


The documentation for this struct was generated from the following file: