ROHC compression/decompression library
Data Structures | Functions
rohc_stats.h File Reference

Handle a rolling window of values for statistics. More...

#include <stdint.h>
#include <stdlib.h>
#include "dllexport.h"
Include dependency graph for rohc_stats.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  rohc_stats

Functions

void ROHC_EXPORT rohc_stats_add (struct rohc_stats *const stats, const uint32_t value)
 Add a new value in the given statistics context.
uint32_t ROHC_EXPORT rohc_stats_sum (const struct rohc_stats *const stats)
 Compute the sum of all the recorded values.
uint32_t ROHC_EXPORT rohc_stats_mean (const struct rohc_stats *const stats)
 Compute the mean of all the recorded values.

Detailed Description

Handle a rolling window of values for statistics.

Author:
Didier Barvaux <didier@barvaux.org>

Function Documentation

void ROHC_EXPORT rohc_stats_add ( struct rohc_stats *const  stats,
const uint32_t  value 
)

Add a new value in the given statistics context.

Parameters:
statsThe statistics context
valueThe value to add
uint32_t ROHC_EXPORT rohc_stats_mean ( const struct rohc_stats *const  stats)

Compute the mean of all the recorded values.

Parameters:
statsThe statistics context
Returns:
The mean of the recorded values
uint32_t ROHC_EXPORT rohc_stats_sum ( const struct rohc_stats *const  stats)

Compute the sum of all the recorded values.

This function is used for statistics.

Parameters:
statsThe statistics context
Returns:
The sum of the recorded values