IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 3930


Ignore:
Timestamp:
May 13, 2005, 12:07:26 PM (21 years ago)
Author:
Paul Price
Message:

Using psMetadataIterator to iterate through metadata, not psListIterator.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/pslib/psLibSDRS.tex

    r3927 r3930  
    1 %%% $Id: psLibSDRS.tex,v 1.215 2005-05-13 21:48:05 price Exp $
     1%%% $Id: psLibSDRS.tex,v 1.216 2005-05-13 22:07:26 price Exp $
    22\documentclass[panstarrs,spec]{panstarrs}
    33
     
    13741374\begin{verbatim}
    13751375psVector *psVectorAlloc(int nalloc, psElemType type);
    1376 psVector *psVectorRealloc(const psVector *vector, int nalloc);
     1376psVector *psVectorRealloc(psVector *vector, int nalloc);
    13771377\end{verbatim}
    13781378%
     
    39963996
    39973997The metadata list component may be iterated over by using a
    3998 \code{psListIterator} in a fashion equivalent to the usage for
    3999 \code{psList}.  The iterator may be set to a location in the
    4000 \code{psMetadata} list, and the user may get the previous or next item
    4001 in the list relative to that location.  \code{psMetadataGetNext} has
    4002 the ability to match the key using a POSIX regex, e.g., if the user
    4003 only wants to iterate through \code{IPP.machines.sky} and doesn't want
    4004 to bother with \code{IPP.machines.detector}.  The iterator should
    4005 iterate over every item in the metadata list, even those that are
    4006 contained in a \code{PS_META_LIST}.  The value \code{iterator}
    4007 specifies the iterator to be used.  In setting the iterator, the
    4008 position of the iterator is defined by \code{location}, which follows
    4009 the conventions of the \code{psList} iterators.
    4010 \begin{verbatim}
    4011 psListIterator *psMetadataIteratorAlloc(psMetadata *md, int location, const char *regex);
    4012 bool psMetadataIteratorSet(psListIterator *iterator, int location);
    4013 psMetadataItem *psMetadataGetAndIncrement(psListIterator *iterator);
    4014 psMetadataItem *psMetadataGetAndDecrement(psListIterator *iterator);
     3998\code{psMetadataIterator} in a fashion equivalent to the
     3999\code{psListIterator}:
     4000\begin{verbatim}
     4001typedef struct {
     4002    psListIterator* iter;              ///< iterator for the psMetadata's psList
     4003    regex_t* regex;                     ///< the subsetting regular expression
     4004} psMetadataIterator;
     4005\end{verbatim}
     4006
     4007The iterator may be set to a location in the \code{psMetadata} list,
     4008and the user may get the previous or next item in the list relative to
     4009that location.  \code{psMetadataGetNext} has the ability to match the
     4010key using a POSIX \code{regex}, e.g., if the user only wants to
     4011iterate through \code{IPP.machines.sky} and doesn't want to bother
     4012with \code{IPP.machines.detector}.  The iterator should iterate over
     4013every item in the metadata list, even those that are contained in a
     4014\code{PS_META_LIST}.  The value \code{iterator} specifies the iterator
     4015to be used.  In setting the iterator, the position of the iterator is
     4016defined by \code{location}, which follows the conventions of the
     4017\code{psList} iterators.
     4018\begin{verbatim}
     4019psMetadataIterator *psMetadataIteratorAlloc(psMetadata *md, int location, const char *regex);
     4020bool psMetadataIteratorSet(psMetadataIterator *iterator, int location);
     4021psMetadataItem *psMetadataGetAndIncrement(psMetadataIterator *iterator);
     4022psMetadataItem *psMetadataGetAndDecrement(psMetadataIterator *iterator);
    40154023\end{verbatim}
    40164024
Note: See TracChangeset for help on using the changeset viewer.