RFABase.h

Classes

RFABase -- Abstract RedFlagger Agent base class (full description)

class RFABase : public FlaggerEnums

Types

enum IterMode

STOP = 0
DRY = 1
DATA = 2
CONT = 3

Interface

Public Members
RFABase ( RFChunkStats &ch,const RecordInterface &parm )
virtual ~RFABase ()
virtual void init ()
virtual uInt estimateMemoryUse ()
virtual Bool newChunk (Int &)
virtual void endChunk ()
virtual void startData ()
virtual void startDry ()
virtual void startFlag ()
virtual IterMode endData ()
virtual IterMode endDry ()
virtual void endFlag ()
virtual IterMode iterTime ( uInt itime )
virtual IterMode iterRow ( uInt irow )
virtual IterMode iterDry ( uInt itime )
virtual void iterFlag ( uInt itime )
virtual String getDesc ()
virtual String getStats ()
virtual void plotFlaggingReport ( PGPlotterInterface & )
virtual void printFlaggingReport ( )
const String & name ()
Bool isActive ()
LogIO & logSink ()
static void setIndexingBase ( uInt base )
Protected Members
uInt num (StatEnums which)
RFlagWord corrMask()
static uInt indexingBase ()

Description

Synopsis

RFABase defines the interface for a flagging agent

Motivation

RedFlagger works with objetcs called flagging agents. This class defines the complete interface between RedFlagger and agents.

To Do

Member Description

enum IterMode

iteration modes

RFABase ( RFChunkStats &ch,const RecordInterface &parm )

An agent is always constructed from a chunk stats accessor, and a record of parameters. No other constructors are defined, and no others may be used.

virtual ~RFABase ()

Destructor

virtual void init ()

This method is called after constructing the agent.

virtual uInt estimateMemoryUse ()

This method is called before iterating over a chunk, to inquire the expected memory use. Should return the max desired memory footprint, in MB. Available physical memory is divided between agents in proportion to their requests.

virtual Bool newChunk (Int &)

Called before iterating over a chunk. Returns True if agent will process this chunk, or False if this the agent is unable to process it. (this can happen if, e.g., the requisite correlations are not present). The Int & maxmem argument is the number of MB memory which is still available in the memory pool. The agent class should plan its memory use accordingly, and subtract its expected memory use from maxmem. In effect, the agent "reserves" some amount of memory. This is used by RedFlagger to contain the total memory footprint. Note that only a rough reckoning is sufficient, so only bother estimating the biggest data structures. See implementations in RFADiffBase and RFATimeMedian for good examples.

virtual void endChunk ()

Called once finished with a chunk

virtual void startData ()

Called before starting a data pass on a chunk.

virtual void startDry ()

Called before starting a dry pass on a chunk.

virtual void startFlag ()

Called before starting the fetch-flags pass.

virtual IterMode endData ()

Called after a pass is completed successfully (i.e., not stopped by start or iter methods). Return value: STOP to stop, DATA for another data pass, DRY for another dry pass.

virtual IterMode endDry ()

Called after a dry pass is complete

virtual void endFlag ()

Called after a flag pass is complete

virtual IterMode iterTime ( uInt itime )

Iteration methods for a data pass. Either or both may be implemented. iterTime() is called once for each new VisBuffer (= new time slot) Return value: STOP to finish iterating, CONT/DATA to continue, or DRY to cancel the data pass and request a dry pass.

virtual IterMode iterRow ( uInt irow )

iterRow() is called once per each row in the VisBuffer. Iterating over rows is perhaps preferrable in terms of performance, at least for data iterations.

virtual IterMode iterDry ( uInt itime )

Iteration method for a dry pass. Called once per each time slot. Return value: STOP to finish iterating, CONT/DRY to continue, or DATA to cancel the dry pass and request another data pass.

virtual void iterFlag ( uInt itime )

Iteration method for a flag pass. Called once per each VisBuffer.

virtual String getDesc ()

called to obtain a short description of this RFA

virtual String getStats ()

called (before endChunk()) to obtain a statistics report

virtual void plotFlaggingReport ( PGPlotterInterface & )

called (before endChunk()) to plots a graphical flagging report

virtual void printFlaggingReport ( )

const String & name ()

returns the name of this RFA (set in myname)

Bool isActive ()

returns the active status

LogIO & logSink ()

accessor to a LogIO for this agent

static void setIndexingBase ( uInt base )

static method for setting the indexing base for agent arguments

uInt num (StatEnums which)

RFlagWord corrMask()

static uInt indexingBase ()

global flag indicates that Glish (1-based) indexing is in use for agent arguments