Skip to content

File notation_wptt.h

FileList > note-wptt > src > notation_wptt.h

Go to the source code of this file

Notation module for Arborescent Weighted Planar Tree Notation (wptt) notation. More...

  • #include "notation_defs.h"
  • #include "stdbool.h"
  • #include "stdint.h"
  • #include "stdlib.h"
  • #include "string.h"

Classes

Type Name
struct note_wptt_node_buffer_t
Type defining the data of a buffer of wptt nodes.
struct note_wptt_node_t
Type defining the data of a wptt node.
struct note_wptt_t
Type defining the notation for a wptt.

Public Types

Type Name
enum note_wptt_V4_label_e
Type defining the \(V\_4\) label for a wptt.
typedef enum note_wptt_V4_label_e note_wptt_V4_label_e
Type defining the \(V\_4\) label for a wptt.
typedef struct note_wptt_node_buffer_t note_wptt_node_buffer_t
Type defining the data of a buffer of wptt nodes.
typedef struct note_wptt_node_t note_wptt_node_t
Type defining the data of a wptt node.
enum note_wptt_order_e
Type defining the order direction of a node in a wptt.
typedef enum note_wptt_order_e note_wptt_order_e
Type defining the order direction of a node in a wptt.

Public Functions

Type Name
uint8_t note_wptt_decode (char * str, note_wptt_t * wptt)
Function to take a note_wptt_t and decode it as a string.
uint8_t note_wptt_encode (note_wptt_t wptt, char * str, size_t buffer_size)
Function to take a string and decode it as a note_wptt_t . NOTE: This function modifies the input WPTT. The input is normalized so all nodes have "forward" order. This does not change the topology.

Macros

Type Name
define NOTE_WPTT_DECODE_BAD_STR (0x01u << 0x03u)
Decode path error flag indicating a malformed string.
define NOTE_WPTT_DECODE_BUFFER_ERROR (0x01u << 0x04u)
Decode path error flag indicating a node buffer error.
define NOTE_WPTT_DECODE_EMPTY_STR (0x01u << 0x01u)
Decode path error flag indicating an empty string.
define NOTE_WPTT_DECODE_MAX_CHILDREN ([**UTIL\_TANG\_DEFS\_MAX\_CROSSINGNUM**](tang__defs_8h.md#define-util_tang_defs_max_crossingnum))
The maximum number of children in a node.
define NOTE_WPTT_DECODE_MAX_WEIGHTS ([**UTIL\_TANG\_DEFS\_MAX\_CROSSINGNUM**](tang__defs_8h.md#define-util_tang_defs_max_crossingnum) + 1)
The maximum number of weights in a node.
define NOTE_WPTT_DECODE_NULL_DEST (0x01u << 0x02u)
Decode path error flag indicating a null destination.
define NOTE_WPTT_DECODE_OVRUNDR_ERROR (0x01u << 0x05u)
Decode path error flag indicating an over/under flow error.
define NOTE_WPTT_ENCODE_MALFORMED (0x01u << 0x02u)
Encode path error flag indicating a malformed wptt tree.
define NOTE_WPTT_ENCODE_OVRUNDR_ERROR (0x01u << 0x03u)
Encode path error flag indicating an over/under flow error.
define NOTE_WPTT_ENCODE_STR_BUF (0x01u << 0x01u)
Encode path error flag indicating an error with the string buffer.
define NOTE_WPTT_MAX_STR_LEN (([**UTIL\_TANG\_DEFS\_MAX\_CROSSINGNUM**](tang__defs_8h.md#define-util_tang_defs_max_crossingnum) + 1) \* 5u)
The maximum length of a linearized string.

Detailed Description

Author:

Joe Starr

Public Types Documentation

enum note_wptt_V4_label_e

Type defining the \(V\_4\) label for a wptt.

enum note_wptt_V4_label_e {
    NOTE_WPTT_V4_LABEL_UNINIT,
    NOTE_WPTT_V4_LABEL_NONE,
    NOTE_WPTT_V4_LABEL_I,
    NOTE_WPTT_V4_LABEL_X,
    NOTE_WPTT_V4_LABEL_Y,
    NOTE_WPTT_V4_LABEL_Z
};


typedef note_wptt_V4_label_e

Type defining the \(V\_4\) label for a wptt.

typedef enum note_wptt_V4_label_e note_wptt_V4_label_e;


typedef note_wptt_node_buffer_t

Type defining the data of a buffer of wptt nodes.

typedef struct note_wptt_node_buffer_t note_wptt_node_buffer_t;


typedef note_wptt_node_t

Type defining the data of a wptt node.

typedef struct note_wptt_node_t note_wptt_node_t;


enum note_wptt_order_e

Type defining the order direction of a node in a wptt.

enum note_wptt_order_e {
    NOTE_WPTT_ORDER_UNINIT,
    NOTE_WPTT_ORDER_FORWARD,
    NOTE_WPTT_ORDER_REVERSE
};


typedef note_wptt_order_e

Type defining the order direction of a node in a wptt.

typedef enum note_wptt_order_e note_wptt_order_e;


Public Functions Documentation

function note_wptt_decode

Function to take a note_wptt_t and decode it as a string.

uint8_t note_wptt_decode (
    char * str,
    note_wptt_t * wptt
) 

Parameters:

Returns:

uint8_t The return code for the decoding operation.


function note_wptt_encode

Function to take a string and decode it as a note_wptt_t . NOTE: This function modifies the input WPTT. The input is normalized so all nodes have "forward" order. This does not change the topology.

uint8_t note_wptt_encode (
    note_wptt_t wptt,
    char * str,
    size_t buffer_size
) 

Parameters:

Returns:

uint8_t The return code for the encoding operation.


Macro Definition Documentation

define NOTE_WPTT_DECODE_BAD_STR

Decode path error flag indicating a malformed string.

#define NOTE_WPTT_DECODE_BAD_STR `(0x01u << 0x03u)`


define NOTE_WPTT_DECODE_BUFFER_ERROR

Decode path error flag indicating a node buffer error.

#define NOTE_WPTT_DECODE_BUFFER_ERROR `(0x01u << 0x04u)`


define NOTE_WPTT_DECODE_EMPTY_STR

Decode path error flag indicating an empty string.

#define NOTE_WPTT_DECODE_EMPTY_STR `(0x01u << 0x01u)`


define NOTE_WPTT_DECODE_MAX_CHILDREN

The maximum number of children in a node.

#define NOTE_WPTT_DECODE_MAX_CHILDREN `( UTIL_TANG_DEFS_MAX_CROSSINGNUM )`


define NOTE_WPTT_DECODE_MAX_WEIGHTS

The maximum number of weights in a node.

#define NOTE_WPTT_DECODE_MAX_WEIGHTS `( UTIL_TANG_DEFS_MAX_CROSSINGNUM + 1)`


define NOTE_WPTT_DECODE_NULL_DEST

Decode path error flag indicating a null destination.

#define NOTE_WPTT_DECODE_NULL_DEST `(0x01u << 0x02u)`


define NOTE_WPTT_DECODE_OVRUNDR_ERROR

Decode path error flag indicating an over/under flow error.

#define NOTE_WPTT_DECODE_OVRUNDR_ERROR `(0x01u << 0x05u)`


define NOTE_WPTT_ENCODE_MALFORMED

Encode path error flag indicating a malformed wptt tree.

#define NOTE_WPTT_ENCODE_MALFORMED `(0x01u << 0x02u)`


define NOTE_WPTT_ENCODE_OVRUNDR_ERROR

Encode path error flag indicating an over/under flow error.

#define NOTE_WPTT_ENCODE_OVRUNDR_ERROR `(0x01u << 0x03u)`


define NOTE_WPTT_ENCODE_STR_BUF

Encode path error flag indicating an error with the string buffer.

#define NOTE_WPTT_ENCODE_STR_BUF `(0x01u << 0x01u)`


define NOTE_WPTT_MAX_STR_LEN

The maximum length of a linearized string.

#define NOTE_WPTT_MAX_STR_LEN `(( UTIL_TANG_DEFS_MAX_CROSSINGNUM + 1) * 5u)`



The documentation for this class was generated from the following file source/note-wptt/src/notation_wptt.h