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

Obit.h File Reference

Base class of Obit library. More...

#include <glib.h>
#include <string.h>
#include "memwatch.h"
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "ObitTypes.h"
#include "ObitErr.h"

Go to the source code of this file.

Classes

struct  Obit
 Obit base class definition. More...
struct  ObitClassInfo
 ClassInfo Structure. More...

Defines

#define OBIT_ID   0x4f626974
 Obit object recognition string.

Typedefs

typedef gpointer(* newObitFP )(gchar *name)
typedef void(* ObitClassInitFP )(void)
typedef gconstpointer(* ObitGetClassFP )(void)
typedef gpointer(* ObitCopyFP )(gpointer in, gpointer out, ObitErr *err)
typedef gpointer(* ObitCloneFP )(Obit *in, Obit *out)
typedef gpointer(* ObitRefFP )(gpointer in)
typedef gpointer(* ObitUnrefFP )(gpointer *in)
typedef gboolean(* ObitIsAFP )(gpointer in, gconstpointer class)
typedef void(* ObitInitFP )(gpointer in)
 Function pointers for private functions.
typedef void(* ObitClearFP )(gpointer in)
typedef void(* ObitClassInfoDefFnFP )(gpointer inClass)
typedef gboolean(* ObitInfoIsAFP )(ObitClassInfo *in, ObitClassInfo *type)

Functions

ObitnewObit (gchar *name)
 Public: Constructor.
void ObitClassInit (void)
 Public: Class initializer.
gconstpointer ObitGetClass (void)
 Public: ClassInfo pointer.
ObitObitCopy (Obit *in, Obit *out, ObitErr *err)
 Public: Copy (deep) constructor.
ObitObitClone (Obit *in, Obit *out)
 Public: Copy (shallow) constructor.
gpointer ObitRef (gpointer in)
 Public: Ref pointer, increment reference count, return pointer.
gpointer ObitUnref (gpointer in)
 Public: Unref pointer, decrement reference count and destroy if 0.
gboolean ObitIsA (gpointer in, gconstpointer type)
 Public: returns TRUE is object is a member of myClassInfo or a derived class.
gfloat ObitMagicF (void)
 Public: returns magic value blanking value.
void ObitTrimTrail (gchar *str)
 Public: trim trailing blanks from string.
gboolean ObitStrCmp (gchar *str1, gchar *str2, gint maxlen)
 Public: compare strings.
gchar * ObitToday (void)
 Public: return today's date as yyyy-mm-dd.
void ObitClassInfoDefFn (gpointer inClass)
 Public: Set Class function pointers.
gboolean ObitInfoIsA (ObitClassInfo *in, ObitClassInfo *type)
 Public: returns TRUE is object is type or a derived class.


Detailed Description

Base class of Obit library.

This class is the virtual base class of most Obit classes. Class hierarchies are generally noted in the names of modules, i.e. Obit is the base class from which (almost) all others are derived. Obit class derivation is by means of nested include files; each class has an include file for the data members and for the class function pointers. These include files include the corresponding includes of their parent class. The functional members are defined in ObitClassDef.h and the data members in ObitDef.h to allow recursive definition of derived classes.

Usage

No instances should be created of this class.

Define Documentation

#define OBIT_ID   0x4f626974
 

Obit object recognition string.

This is to be the first gint32 of each object. The value in ascii is "Obit"


Typedef Documentation

typedef gpointer(* newObitFP)(gchar *name)
 

typedef void(* ObitClassInfoDefFnFP)(gpointer inClass)
 

typedef void(* ObitClassInitFP)(void)
 

typedef void(* ObitClearFP)(gpointer in)
 

typedef gpointer(* ObitCloneFP)(Obit *in, Obit *out)
 

typedef gpointer(* ObitCopyFP)(gpointer in, gpointer out, ObitErr *err)
 

typedef gconstpointer(* ObitGetClassFP)(void)
 

typedef gboolean(* ObitInfoIsAFP)(ObitClassInfo *in, ObitClassInfo *type)
 

typedef void(* ObitInitFP)(gpointer in)
 

Function pointers for private functions.

typedef gboolean(* ObitIsAFP)(gpointer in, gconstpointer class)
 

typedef gpointer(* ObitRefFP)(gpointer in)
 

typedef gpointer(* ObitUnrefFP)(gpointer *in)
 


Function Documentation

Obit* newObit gchar *  name  ) 
 

Public: Constructor.

Initializes class if needed on first call.

Parameters:
name An optional name for the object.
Returns:
the new object.

void ObitClassInfoDefFn gpointer  inClass  ) 
 

Public: Set Class function pointers.

Parameters:
inClass Pointer to ClassInfo structure of the class to be filled.
callClass Pointer to ClassInfo of calling class

void ObitClassInit void   ) 
 

Public: Class initializer.

Obit* ObitClone Obit in,
Obit out
 

Public: Copy (shallow) constructor.

The result will have pointers to the more complex members.

Parameters:
in The object to copy
out An existing object pointer for output or NULL if none exists.
Returns:
pointer to the new object.

Obit* ObitCopy Obit in,
Obit out,
ObitErr err
 

Public: Copy (deep) constructor.

Copies are made of complex members such as files; these will be copied applying whatever selection is associated with the input.

Parameters:
in The object to copy
out An existing object pointer for output or NULL if none exists.
err Error stack, returns if not empty.
Returns:
pointer to the new (existing) object.

gconstpointer ObitGetClass void   ) 
 

Public: ClassInfo pointer.

This method MUST be included in each derived class to ensure proper linking and class initialization. Initializes class if needed on first call.

Returns:
pointer to the class structure.

gboolean ObitInfoIsA ObitClassInfo class,
ObitClassInfo type
 

Public: returns TRUE is object is type or a derived class.

Parameters:
in Pointer to object to test.
class Pointer to ClassInfo structure of the class to be tested.
Returns:
TRUE if test or a derived class, else FALSE.

gboolean ObitIsA gpointer  in,
gconstpointer  class
 

Public: returns TRUE is object is a member of myClassInfo or a derived class.

Should also work for derived classes.

Parameters:
in Pointer to object to test.
class Pointer to ClassInfo structure of the class to be tested.
Returns:
TRUE if member of class or a derived class, else FALSE.

gfloat ObitMagicF void   ) 
 

Public: returns magic value blanking value.

Returns:
float magic value

gpointer ObitRef gpointer  in  ) 
 

Public: Ref pointer, increment reference count, return pointer.

This function should always be used to copy pointers as this will ensure a proper reference count. Should also work for derived classes

Parameters:
in Pointer to object to link, if Null, just return.
Returns:
the pointer to in.

gboolean ObitStrCmp gchar *  str1,
gchar *  str2,
gint  maxlen
 

Public: compare strings.

Blanks past the last non blank, non-NULL are considered insignificant

Parameters:
str1 First string to compare
str2 Second string to compare
maxlen Maximum number of characters to compare
Returns:
True if all significant characters match, else False

gchar* ObitToday void   ) 
 

Public: return today's date as yyyy-mm-dd.

Returns:
data string, should be g_freeed when done.

void ObitTrimTrail gchar *  str  ) 
 

Public: trim trailing blanks from string.

Parameters:
str String to trim

gpointer ObitUnref gpointer  inn  ) 
 

Public: Unref pointer, decrement reference count and destroy if 0.

if the input pointer is NULL, the reference count is already <=0 or the object is not a valid Obit Object, it simply returns.

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


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