#include <assert.h>
#include <string.h>
#include <stddef.h>
#include "fret.h"
#include "gramstore.h"
#include "common.h"
#include "rbtree.c"
Include dependency graph for gramstore.c:
Data Structures | |
struct | GsBuffer |
struct | GramStore |
Typedefs | |
typedef rbtree | GramTree |
Functions | |
bool | putGram (Gram *const pGram) |
Makes a local copy of a Gram and stores it in the Gram Store. | |
bool | deleteBufferGrams (BufferId bufferId) |
bool | deleteAllGrams (void) |
bool | getBufferGrams (const BufferId bufferId, GramReport *const pReport) |
Retrive a list of Grams for a specific Buffer. | |
bool | getGenericGrams (GramReport *const pReport) |
Retrieve a list of Grams that apply to all the Buffers. | |
bool | getBufferStats (BufferId bufferId, GsStats *const pStats) |
Retrive a struct that decribes a specific Buffer. | |
const Gram * | getThisGram (const Gram *const pGram) |
const Gram * | getPrevGram (const Gram *const pGram) |
const Gram * | getNextGram (const Gram *const pGram) |
bool | deleteGram (const Gram *const pGram) |
This file implements the Gram Store, the module that provides the storage and retrieval of Grams. Each Gram that is stored is associated with Group ID and may also be associated with a Buffer ID.
|
GramTree is the name used within libfret for the rbtree Red-Black Tree struct. |
|
Deletes all Grams, both generic and Buffer Grams. Memory: Must delete all GsBuffer objects that were allocated to this Group. |
|
Deletes all the Grams for a specific Buffer. Memory: Frees the GsBuffer object for this buffer. |
|
Delete a single Gram. |
|
Retrive a list of Grams for a specific Buffer. Retrives a list of Grams for the Buffer whose ID is passed as a parameter. Memory: Function allocates an array of Gram objects. This array must be deallocated by the client modue.
|
|
Retrive a struct that decribes a specific Buffer. Retrives a GsStats object for the Buffer whose ID is passed as a parameter.
|
|
Retrieve a list of Grams that apply to all the Buffers. Retrives a list of Grams that are generic to all the Buffers. Only generic Grams are returned, not Grams for all the Buffers. Memory: Function allocates an array of Gram objects. This array must be deallocated by the client module.
|
|
|
|
Find if there is a Gram that matches the specified parameters in the Gram that is passed. |
|
Makes a local copy of a Gram and stores it in the Gram Store. Function is passed a pointer to a Gram. It stores this Gram in the Gram Store, if the confidence for this Gram is greater than that of all overlapping Grams. Memory: GsBuffer object is allocated dynamically for each new Buffer. This memory must be deallocated by this module.
|