DTNMA Reference Tools v2.1.0 - 13.gc5c0bac
Delay-Tolerant Networking Management Architecture (DTNMA) Tool Suite
Loading...
Searching...
No Matches
range.h File Reference
#include "cace/config.h"
#include "cace/util/defs.h"
#include <m-rbtree.h>
+ Include dependency graph for range.h:
+ This graph shows which files directly or indirectly include this file:

Macros

#define CACE_RANGE_DEF(range, intvl, type)
 A closed interval of numeric values with optional minimum and maximum.
 

Macro Definition Documentation

◆ CACE_RANGE_DEF

#define CACE_RANGE_DEF (   range,
  intvl,
  type 
)

A closed interval of numeric values with optional minimum and maximum.

A single interval struct is defined as intvl_t. A range containing ordered sequence of intervals is defined as range_t

Members of the interval struct are:

  • has_min True if this interval has a finite minimum.
  • i_min The minimum value of the interval, valid if has_min is true.
  • has_max True if this interval has a finite maximum.
  • i_max The maximum value of the interval, valid if has_max is true.

Functions for the interval struct are the following:

  • intvl_init() Initialize a fully infinite interval.
  • intvl_deinit() Clean up state.
  • intvl_set_finite() Set the state to a fully finite interval.
  • intvl_set_min() Set just the minimum finite extent.
  • intvl_set_max() Set just the maximum finite extent.
  • intvl_is_infinite() Determine if this interval is open on both ends (is fully infinite).
  • intvl_cmp() Compare to intervals by their extents.
  • intvl_contains() Determine if a value is within the interval.

Functions for the range struct are the following:

  • range_contains() Determine if a value is within the range.