GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > QSD / V0-4-4

Constituent: qsu     Tag: sun-gcc


Interface   Data Structures   File List   Data Fields   Globals  

QFC_cache.h File Reference

#include "QSD/QFR_file.h"

Include dependency graph for QFC_cache.h:

This graph shows which files directly or indirectly include this file:


Typedefs

typedef _QFC_cache QFC_cache
typedef _QFR_fileCtx QFR_fileCtx
typedef _QFC_member QFC_member
typedef _QFC_file QFC_file
 Typedef for struct _QFC_file.
typedef _QFC_subscription QFC_subscription
 Typedef for struct _QFC_cacheSubscriber.

Functions

int QFC_sizeof (int nmembers)
 Returns the size, in bytes, of a cache needed to hold nmembers.
void * QFC_construct (QFC_cache *cache, int nmembers)
 Constructs a cache with nmembers.
void QFC_destruct (QFC_cache *cache)
 Destroys the cache. All subscribers are notified.
QFC_memberQFC_findByKey (QFC_cache *cache, unsigned int key)
 Locates the cache member by its key.
int QFC_validate (const QFC_cache *cache, const QFC_member *member, unsigned int key)
 Validates the member.
QFC_memberQFC_add (QFC_cache *cache, unsigned int key, const char *name, void *other)
 Adds the file to the cache. If the cache is full, the oldest member is removed. Subscribers will be notified on the replacement and posible removal.
int QFC_remove (QFC_cache *cache, QFC_member *member)
 Removes the member from the cache. Subscribers will be notified.
int QFC_removeByKey (QFC_cache *cache, unsigned int key)
 Removes the member from the cache be key.
int QFC_resolve (QFC_cache *cache, QFR_fileCtx *ctx, QFC_file *file, unsigned int key, const char *dirName, const char *fileName, QFR_resolver resolver)
void QFC_subscribe (QFC_cache *cache, QFC_subscription *subscription)
 Adds a subscription to the cache. The subscriber will be notified on member removal and replacement.
void QFC_unsubscribe (QFC_cache *cache, QFC_subscription *subscription)
 Removes a subscription to the cache.

Detailed Description

Author:
JJRussell - russell@slac.stanford.edu
   CVS $Id: QFC_cache.h,v 1.3 2008/09/19 19:18:51 russell Exp $

Function Documentation

QFC_member* QFC_add QFC_cache cache,
unsigned int  key,
const char *  name,
void *  handle
 

Adds the file to the cache. If the cache is full, the oldest member is removed. Subscribers will be notified on the replacement and posible removal.

Parameters:
cache The cache
key The file/cache key
name The name of the file. Only the pointer is captured, i.e. the name is not copied
handle A handle (arbitrary) to be associated with the file. This is usually some reference to the opened file or information about it.

void* QFC_construct QFC_cache cache,
int  nmembers
 

Constructs a cache with nmembers.

Returns:
Pointer to the memory immediately following the cache, i.e. cache + QFC__sizeof (nmembers)
Parameters:
cache The cache to construct. The size of the memory for the cache is normally allocated by QFC_sizeof.
nmembers The number of members in the cache.

void QFC_destruct QFC_cache cache  ) 
 

Destroys the cache. All subscribers are notified.

Parameters:
cache The cache to destroy

QFC_member* QFC_findByKey QFC_cache cache,
unsigned int  key
 

Locates the cache member by its key.

Return values:
non-NULL,the member
NULL,member was not found
Parameters:
cache The cache
key The file key

int QFC_remove QFC_cache cache,
QFC_member member
 

Removes the member from the cache. Subscribers will be notified.

Return values:
==0,successful removal
==-1,\a member is not a member of the cache
Parameters:
cache The cache
member The member to remove

int QFC_removeByKey QFC_cache cache,
unsigned int  key
 

Removes the member from the cache be key.

Return values:
==0,successful removal
==-1,\a member is not a member of the cache
Parameters:
cache The cache
key The key of member to remove

int QFC_sizeof int  nmembers  ) 
 

Returns the size, in bytes, of a cache needed to hold nmembers.

Returns:
The size, in bytes, of a cache needed to hold nmembers
Parameters:
nmembers The number of members in the cache

void QFC_subscribe QFC_cache cache,
QFC_subscription subscription
 

Adds a subscription to the cache. The subscriber will be notified on member removal and replacement.

Parameters:
cache The cache
subscription The subscripion.

void QFC_unsubscribe QFC_cache cache,
QFC_subscription subscription
 

Removes a subscription to the cache.

Parameters:
cache The cache
subscription The subscripion.

int QFC_validate const QFC_cache cache,
const QFC_member member,
unsigned int  key
 

Validates the member.

Return values:
!=0,member is valid
==0,member is invalid


Generated on Wed Apr 15 01:17:14 2009 by  doxygen 1.4.4