LAL  7.5.0.1-b72065a
Header LALCache.h

Detailed Description

This header covers routines to create and manipulate LALCache structures and to read LAL cache files.

Author
Creighton, J. D. E.
Date
2007

Synopsis

#include <lal/LALCache.h>

Prototypes

LALCacheXLALCreateCache (UINT4 length)
 Creates a LALCache structure. More...
 
void XLALDestroyCache (LALCache *cache)
 Destroys a LALCache structure. More...
 
LALCacheXLALCacheDuplicate (const LALCache *cache)
 Duplicates a LALCache structure. More...
 
LALCacheXLALCacheMerge (const LALCache *cache1, const LALCache *cache2)
 Returns a new LALCache structure that is the merge of two. More...
 
LALCacheXLALCacheFileRead (LALFILE *fp)
 Reads a LAL cache file and produces a LALCache structure. More...
 
LALCacheXLALCacheImport (const char *fname)
 Reads a LAL cache file and produces a LALCache structure. More...
 
LALCacheXLALCacheGlob (const char *dirstr, const char *fnptrn)
 Globs a directory and construct LALCache from matching entries. More...
 
int XLALCacheFileWrite (LALFILE *fp, const LALCache *cache)
 Writes a LALCache structure to output LALFILE. More...
 
int XLALCacheExport (const LALCache *cache, const char *filename)
 Exports a LALCache structure to an output LAL cache file. More...
 
int XLALCacheSort (LALCache *cache)
 Sorts entries in a LALCache structure. More...
 
int XLALCacheUniq (LALCache *cache)
 Prunes duplicate entries keeping the second one; cache is reduced in length if there are. More...
 
int XLALCacheSieve (LALCache *cache, INT4 t0, INT4 t1, const char *srcregex, const char *dscregex, const char *urlregex)
 Selects only matching entries in a LALCache structure – other entries are deleted from the LALCache structure. More...
 
LALCacheEntryXLALCacheEntrySeek (const LALCache *cache, double t)
 Finds the first entry that contains the requested time, or the first entry after the time if the time is in a gap or before the first entry. More...
 
LALFILE * XLALCacheEntryOpen (const LALCacheEntry *entry)
 Open a file identified by an entry in a LALCache structure. More...
 

Data Structures

struct  LALCacheEntry
 An entry in a LAL cache. More...
 
struct  LALCache
 The LALCache structure is an array of entries. More...
 

Function Documentation

◆ XLALCreateCache()

LALCache* XLALCreateCache ( UINT4  length)

Creates a LALCache structure.

Definition at line 154 of file LALCache.c.

◆ XLALDestroyCache()

void XLALDestroyCache ( LALCache cache)

Destroys a LALCache structure.

Definition at line 172 of file LALCache.c.

◆ XLALCacheDuplicate()

LALCache* XLALCacheDuplicate ( const LALCache cache)

Duplicates a LALCache structure.

Definition at line 187 of file LALCache.c.

◆ XLALCacheMerge()

LALCache* XLALCacheMerge ( const LALCache cache1,
const LALCache cache2 
)

Returns a new LALCache structure that is the merge of two.

Definition at line 201 of file LALCache.c.

◆ XLALCacheFileRead()

LALCache* XLALCacheFileRead ( LALFILE *  fp)

Reads a LAL cache file and produces a LALCache structure.

Definition at line 225 of file LALCache.c.

◆ XLALCacheImport()

LALCache* XLALCacheImport ( const char *  fname)

Reads a LAL cache file and produces a LALCache structure.

Definition at line 252 of file LALCache.c.

◆ XLALCacheGlob()

LALCache* XLALCacheGlob ( const char *  dirstr,
const char *  fnptrn 
)

Globs a directory and construct LALCache from matching entries.

Parameters
[in]dirstrColon-delimited list of directories.
[in]fnptrnGlob pattern for matching files.
Returns
LALCache structure.

Definition at line 314 of file LALCache.c.

◆ XLALCacheFileWrite()

int XLALCacheFileWrite ( LALFILE *  fp,
const LALCache cache 
)

Writes a LALCache structure to output LALFILE.

Definition at line 382 of file LALCache.c.

◆ XLALCacheExport()

int XLALCacheExport ( const LALCache cache,
const char *  filename 
)

Exports a LALCache structure to an output LAL cache file.

Definition at line 408 of file LALCache.c.

◆ XLALCacheSort()

int XLALCacheSort ( LALCache cache)

Sorts entries in a LALCache structure.

Definition at line 466 of file LALCache.c.

◆ XLALCacheUniq()

int XLALCacheUniq ( LALCache cache)

Prunes duplicate entries keeping the second one; cache is reduced in length if there are.

Entries are duplicates if their metadata are the same (even if the urls are different

Definition at line 477 of file LALCache.c.

◆ XLALCacheSieve()

int XLALCacheSieve ( LALCache cache,
INT4  t0,
INT4  t1,
const char *  srcregex,
const char *  dscregex,
const char *  urlregex 
)

Selects only matching entries in a LALCache structure – other entries are deleted from the LALCache structure.

Parameters
cacheUNDOCUMENTED
t0Remove entries ending before t0 (0 to disable).
t1Remove entries ending after t1 (0 to disable).
srcregexRegular expression to match src field (NULL to disable).
dscregexRegular expression to match dsc field (NULL to disable).
urlregexRegular expression to match url field (NULL to disable).

Definition at line 544 of file LALCache.c.

◆ XLALCacheEntrySeek()

LALCacheEntry* XLALCacheEntrySeek ( const LALCache cache,
double  t 
)

Finds the first entry that contains the requested time, or the first entry after the time if the time is in a gap or before the first entry.

Returns NULL if the time is after the last entry.

Definition at line 654 of file LALCache.c.

◆ XLALCacheEntryOpen()

LALFILE* XLALCacheEntryOpen ( const LALCacheEntry entry)

Open a file identified by an entry in a LALCache structure.

Definition at line 663 of file LALCache.c.