Main Page | Class List | Directories | File List | Class Members | File Members

ObitInfoList.c File Reference

ObitInfoList Linked list of labeled items class function definition. More...

#include <string.h>
#include <stdio.h>
#include "ObitInfoList.h"
#include "ObitMem.h"

Functions

ObitInfoListnewObitInfoList (void)
 Public: constructor.
ObitInfoListfreeObitInfoList (ObitInfoList *in)
 Public: destructor.
ObitInfoListObitInfoListCopy (ObitInfoList *in)
 Public: Copy constructor.
ObitInfoListObitInfoListRef (ObitInfoList *in)
 Public: Reference object pointer.
ObitInfoListObitInfoListUnref (ObitInfoList *in)
 Public: Unreference object pointer.
ObitInfoListObitInfoListCopyData (ObitInfoList *in, ObitInfoList *out)
 Public: Copy entries from one list to another.
void ObitInfoListCopyList (ObitInfoList *in, ObitInfoList *out, gchar **list)
 Public: Copy entries from one list to another controled by a list .
void ObitInfoListPut (ObitInfoList *in, gchar *name, ObitInfoType type, gint32 *dim, gconstpointer data, ObitErr *err)
 Public: Store item to InfoList.
void ObitInfoListAlwaysPut (ObitInfoList *in, gchar *name, ObitInfoType type, gint32 *dim, gconstpointer data)
 Public: Store item to InfoList, redefine item if necessary.
gboolean ObitInfoListGetTest (ObitInfoList *in, gchar *name, ObitInfoType *type, gint32 *dim, gpointer data)
 Public: Test retrieve of an item from InfoList.
gboolean ObitInfoListGet (ObitInfoList *in, gchar *name, ObitInfoType *type, gint32 *dim, gpointer data, ObitErr *err)
 Public: Retrieve item from InfoList by name.
gboolean ObitInfoListInfo (ObitInfoList *in, gchar *name, ObitInfoType *type, gint32 *dim, ObitErr *err)
 Public: Get info about item from InfoList by name.
gboolean ObitInfoListGetP (ObitInfoList *in, gchar *name, ObitInfoType *type, gint32 *dim, gpointer *data)
 Public: Return pointers to an item in InfoList by name.
gboolean ObitInfoListGetNumber (ObitInfoList *in, gint number, gchar **name, ObitInfoType *type, gint32 *dim, gpointer data, ObitErr *err)
 Public: Retrieve item from InfoList by number.
gboolean ObitInfoListGetNumberP (ObitInfoList *in, gint number, gchar **name, ObitInfoType *type, gint32 *dim, gpointer *data)
 Public: Return pointers to an item in InfoList by number.
void ObitInfoListRemove (ObitInfoList *in, gchar *name)
 Public: Remove item from list.
void ObitInfoListResize (ObitInfoList *in, gchar *name, ObitInfoType type, gint32 *dim)
 Public: Change dimension or type of an item.
void ObitInfoListPrint (ObitInfoList *in, FILE *file)
 Public: Print contents to file (e.g.
gboolean ObitInfoListIsA (ObitInfoList *in)
 Public: Returns true if input is a ObitInfoList*.


Detailed Description

ObitInfoList Linked list of labeled items class function definition.

This facility allows storing arrays of values of the same (native) data type and retrieving them by name. Implementation uses the glib GSList class.


Function Documentation

ObitInfoList* freeObitInfoList ObitInfoList in  ) 
 

Public: destructor.

Parameters:
in Object to delete
Returns:
NULL pointer.

ObitInfoList* newObitInfoList void   ) 
 

Public: constructor.

Returns:
the new object.

void ObitInfoListAlwaysPut ObitInfoList in,
gchar *  name,
ObitInfoType  type,
gint32 *  dim,
gconstpointer  data
 

Public: Store item to InfoList, redefine item if necessary.

If the requested keyword (name) does not exist then one is created with the type, and dimension specified.

Parameters:
in Pointer to InfoList.
name The label (keyword) of the information.
type Data type of data element (enum defined in ObitInfoList class.
dim Dimensionality of datum. Note: for strings, the first element is the length in char.
data Pointer to the data.

ObitInfoList* ObitInfoListCopy ObitInfoList in  ) 
 

Public: Copy constructor.

Parameters:
in The object to copy
Returns:
pointer to the new object.

ObitInfoList* ObitInfoListCopyData ObitInfoList in,
ObitInfoList out
 

Public: Copy entries from one list to another.

Parameters:
in The input object to copy
out The output object; if NULL, new one created
Returns:
pointer to the new object.

void ObitInfoListCopyList ObitInfoList in,
ObitInfoList out,
gchar **  list
 

Public: Copy entries from one list to another controled by a list .

Parameters:
in The input object to copy
out The output object
list NULL terminated list of element names

gboolean ObitInfoListGet ObitInfoList in,
gchar *  name,
ObitInfoType *  type,
gint32 *  dim,
gpointer  data,
ObitErr err
 

Public: Retrieve item from InfoList by name.

NOTE: String arrays are not returned in the form they are written, they are all in one large, rectangular gchar array.

Parameters:
in Pointer to InfoList.
name The label (keyword) of the information.
type (output) data type of data element.
dim (output) dimensionality of datum. Note: for strings, the first element is the length in char. All Strings and string arrays will have a final NULL which is one more byte than described in dim.
data (output) pointer to the data; note: data will be copied to this location which should have been allocated sufficiently.
err (output) Obit Error stack for information.
Returns:
TRUE if found, else FALSE.

gboolean ObitInfoListGetNumber ObitInfoList in,
gint  number,
gchar **  name,
ObitInfoType *  type,
gint32 *  dim,
gpointer  data,
ObitErr err
 

Public: Retrieve item from InfoList by number.

Parameters:
in Pointer to InfoList.
number 1-rel item number
name (output) Pointer to the label (keyword) of the information; the name will be copied into this address.
type (output) data type of data element.
dim (output) dimensionality of datum. Note: for strings, the first element is the length in char. All Strings and string arrays will have a final NULL which is one more byte than described in dim.
data (output) pointer to the data; note: data will be copied to this location which should have been allocated sufficiently.
err (output) Obit Error stack for information.
Returns:
TRUE if found, else FALSE.

gboolean ObitInfoListGetNumberP ObitInfoList in,
gint  number,
gchar **  name,
ObitInfoType *  type,
gint32 *  dim,
gpointer *  data
 

Public: Return pointers to an item in InfoList by number.

Parameters:
in Pointer to InfoList.
number 1-rel item number
name (output) Pointer to the label (keyword) of the information; the name will be copied into this address.
type (output) data type of data element.
dim (output) dimensionality of datum. Note: for strings, the first element is the length in char. All Strings and string arrays will have a final NULL which is one more byte than described in dim.
data (output) pointer to the data; NULL if not found.
err (output) Obit Error stack for information.
Returns:
TRUE if found, else FALSE.

gboolean ObitInfoListGetP ObitInfoList in,
gchar *  name,
ObitInfoType *  type,
gint32 *  dim,
gpointer *  data
 

Public: Return pointers to an item in InfoList by name.

Parameters:
in Pointer to InfoList.
name The label (keyword) of the information.
type (output) data type of data element.
dim (output) dimensionality of datum. Note: for strings, the first element is the length in char. All Strings and string arrays will have a final NULL which is one more byte than described in dim.
data (output) pointer to the data; NULL if not found.
err (output) Obit Error stack for information.
Returns:
TRUE if found, else FALSE.

gboolean ObitInfoListGetTest ObitInfoList in,
gchar *  name,
ObitInfoType *  type,
gint32 *  dim,
gpointer  data
 

Public: Test retrieve of an item from InfoList.

Parameters:
in Pointer to InfoList.
name The label (keyword) of the information.
type (output) data type of data element.
dim (output) dimensionality of datum. Note: for strings, the first element is the length in char. All Strings and string arrays will have a final NULL which is one more byte than described in dim.
data (output) pointer to the data; note: data will be copied to this location which should have been allocated sufficiently.
Returns:
TRUE if found, else FALSE.

gboolean ObitInfoListInfo ObitInfoList in,
gchar *  name,
ObitInfoType *  type,
gint32 *  dim,
ObitErr err
 

Public: Get info about item from InfoList by name.

Parameters:
in Pointer to InfoList.
name The label (keyword) of the information.
type (output) data type of data element.
dim (output) dimensionality of datum. Note: for strings, the first element is the length in char. All Strings and string arrays will have a final NULL which is one more byte than described in dim.
err (output) Obit Error stack for information.
Returns:
TRUE if found, else FALSE.

gboolean ObitInfoListIsA ObitInfoList in  ) 
 

Public: Returns true if input is a ObitInfoList*.

Parameters:
in Pointer to object to test.
Returns:
TRUE if member else FALSE.

void ObitInfoListPrint ObitInfoList in,
FILE *  file
 

Public: Print contents to file (e.g.

Parameters:
file Where to write output

void ObitInfoListPut ObitInfoList in,
gchar *  name,
ObitInfoType  type,
gint32 *  dim,
gconstpointer  data,
ObitErr err
 

Public: Store item to InfoList.

If the requested keyword (name) does not exist then one is created with the type, and dimension specified. If a previous entry exists, then the type and dimensionality provided must match.

Parameters:
in Pointer to InfoList.
name The label (keyword) of the information.
type Data type of data element (enum defined in ObitInfoList class.
dim Dimensionality of datum. Note: for strings, the first element is the length in char.
data Pointer to the data. If the data is a multidimensional string array pass this as the pointer the the string array.
err Obit Error stack for information.

ObitInfoList* ObitInfoListRef ObitInfoList in  ) 
 

Public: Reference object pointer.

This function should always be used to copy pointers as this will ensure a proper reference count.

Parameters:
in Pointer to object to link.
Returns:
the pointer to me.

void ObitInfoListRemove ObitInfoList in,
gchar *  name
 

Public: Remove item from list.

Item is destroyed; does nothing if item not found.

Parameters:
in Pointer to InfoList.
name The label (keyword) of the information.

void ObitInfoListResize ObitInfoList in,
gchar *  name,
ObitInfoType  type,
gint32 *  dim
 

Public: Change dimension or type of an item.

Create an entry in list if it doesn't previously exist, any existing data will be lost.

Parameters:
in Pointer to InfoList.
name The label (keyword) of the element to change.
type Mew data type of data element (enum).
dim New dimensionality of datum.

ObitInfoList* ObitInfoListUnref ObitInfoList in  ) 
 

Public: Unreference object pointer.

Parameters:
in Pointer to object to unreference.
Returns:
NULL pointer.


Generated on Fri Aug 31 22:13:06 2007 for Obit by  doxygen 1.3.9.1