casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
casa::vpf::VisibilityProcessor Class Referenceabstract

#include <VisibilityProcessing.h>

Inheritance diagram for casa::vpf::VisibilityProcessor:
casa::vpf::SplitterVp casa::vpf::VisibilityProcessorStub casa::vpf::VpContainer casa::vpf::WriterVp

Public Types

enum  ChunkCode {
  Normal,
  RepeatChunk
}
 
enum  ProcessingType {
  Subchunk,
  EndOfChunk,
  EndOfData
}
 
typedef std::tuple< ChunkCode,
VpData
ProcessingResult
 

Public Member Functions

 VisibilityProcessor (const VisibilityProcessor &)=delete
 
VisibilityProcessoroperator= (const VisibilityProcessor &)=delete
 
 VisibilityProcessor ()
 
 VisibilityProcessor (const casacore::String &name, const std::vector< casacore::String > &inputNames, const std::vector< casacore::String > &outputNames=std::vector< casacore::String >(), casacore::Bool makeIoPorts=false)
 
virtual ~VisibilityProcessor ()
 
void chunkStart (const SubchunkIndex &)
 chunkStart is called to inform the VP that a new chunk is starting. More...
 
ProcessingResult doProcessing (ProcessingType processingType, VpData &inputData, VpEngine *vpEngine, const SubchunkIndex &subChunkIndex)
 Called to cause the VP to process the provided inputs. More...
 
const VpContainergetContainer () const
 Returns a pointer to the containing VP or NULL if this VP is top-level. More...
 
casacore::String getFullName () const
 The full name of a VP is a dotted list of the names of all the containing VPs ending with the name of this VP (e.g., vp0.vp1...vpN.thisVp). More...
 
VpPort getInput (const casacore::String &name) const
 Returns the input port having the specified name. More...
 
VpPorts getInputs (casacore::Bool connectedOnly=false) const
 Returns a collection of the input ports for this VP; optionally only the connected ports are returned. More...
 
casacore::String getName () const
 Returns the name of this VP. More...
 
casacore::Int getNSubchunksProcessed () const
 Returns the number of Subchunks processed (mainly for testing) More...
 
casacore::Int getNSubchunksUniqueProcessed () const
 Returns the number of unique Subchunks (i.e., iteration ignored) processed. More...
 
VpPort getOutput (const casacore::String &name) const
 Returns the output port having the specified name. More...
 
VpPorts getOutputs (casacore::Bool connectedOnly=false) const
 Returns a collection of the output ports for this VP; optionally only the connected ports are returned. More...
 
virtual
casa::asyncio::PrefetchColumns 
getPrefetchColumns () const
 Returns the collection of columns that need to be prefetched if this node is used with async I/O. More...
 
void processingStart ()
 Called by the framework when the processing is about to begin (i.e., prior to the first VisBuffer being fed into the graph. More...
 
void validate ()
 Called to ask the VP to check its validity (i.e., are all needed inputs connected, etc.). More...
 

Protected Member Functions

virtual void chunkStartImpl (const SubchunkIndex &)
 The public API contains many methods that are not virtual. More...
 
VpPorts definePorts (const std::vector< casacore::String > &portNames, VpPort::Type type, const casacore::String &typeName)
 Defines the set of possible input ports for this VP. More...
 
virtual ProcessingResult doProcessingImpl (ProcessingType processingType, VpData &inputData, const SubchunkIndex &subChunkIndex)=0
 Requests processing of the provided (possibly empty) input data. More...
 
VpPorts portsUnconnected (const VpPorts &ports, casacore::Bool(VpPort::*isConnected)() const, const std::vector< casacore::String > &except=std::vector< casacore::String >()) const
 Returns a collection of the ports that are not connected using the provided connection method; some ports may also be excluded from this list by name. More...
 
virtual void processingStartImpl ()
 Called when data processing is about to beging; this allows the VP to perform any initialization that it desires now that it is completely connected into the graph. More...
 
void throwIfAnyInputsUnconnected (const std::vector< casacore::String > &exceptThese=std::vector< casacore::String >()) const
 Methods to ease the validation process. More...
 
void throwIfAnyInputsUnconnectedExcept (const casacore::String &exceptThisOne) const
 
void throwIfAnyOutputsUnconnected (const std::vector< casacore::String > &exceptThese=std::vector< casacore::String >()) const
 
void throwIfAnyOutputsUnconnectedExcept (const casacore::String &exceptThisOne) const
 
void throwIfAnyPortsUnconnected () const
 
virtual void validateImpl ()=0
 Called to allow the node to validate its initial state. More...
 

Private Member Functions

VpPortgetInputRef (const casacore::String &name)
 
VpPortgetOutputRef (const casacore::String &name)
 
void setContainer (const VpContainer *)
 
ROVisibilityIteratorgetVi ()
 
VpEnginegetVpEngine ()
 

Private Attributes

const VpContainercontainer_p
 
casacore::String name_p
 
casacore::Int nSubchunks_p
 
casacore::Int nSubchunksUnique_p
 
VpEnginevpEngine_p
 
VpPorts vpInputs_p
 
VpPorts vpOutputs_p
 

Friends

class VpContainer
 
class WriterVp
 

Detailed Description

Definition at line 225 of file VisibilityProcessing.h.

Member Typedef Documentation

Definition at line 246 of file VisibilityProcessing.h.

Member Enumeration Documentation

Enumerator
Normal 
RepeatChunk 

Definition at line 235 of file VisibilityProcessing.h.

Enumerator
Subchunk 
EndOfChunk 
EndOfData 

Definition at line 240 of file VisibilityProcessing.h.

Constructor & Destructor Documentation

casa::vpf::VisibilityProcessor::VisibilityProcessor ( const VisibilityProcessor )
delete
casa::vpf::VisibilityProcessor::VisibilityProcessor ( )
casa::vpf::VisibilityProcessor::VisibilityProcessor ( const casacore::String name,
const std::vector< casacore::String > &  inputNames,
const std::vector< casacore::String > &  outputNames = std::vector< casacore::String >(),
casacore::Bool  makeIoPorts = false 
)
virtual casa::vpf::VisibilityProcessor::~VisibilityProcessor ( )
inlinevirtual

Definition at line 253 of file VisibilityProcessing.h.

Member Function Documentation

void casa::vpf::VisibilityProcessor::chunkStart ( const SubchunkIndex )

chunkStart is called to inform the VP that a new chunk is starting.

virtual void casa::vpf::VisibilityProcessor::chunkStartImpl ( const SubchunkIndex )
inlineprotectedvirtual

The public API contains many methods that are not virtual.

However, where subclass-specific behavior is potentially useful, a corresponding xxxImpl method is provided. This allows the framework to perform certain required housekeeping options while allowing the subclass to perform custom operations.

Called on the object when a new chunk is about to be started.

Definition at line 331 of file VisibilityProcessing.h.

VpPorts casa::vpf::VisibilityProcessor::definePorts ( const std::vector< casacore::String > &  portNames,
VpPort::Type  type,
const casacore::String typeName 
)
protected

Defines the set of possible input ports for this VP.

ProcessingResult casa::vpf::VisibilityProcessor::doProcessing ( ProcessingType  processingType,
VpData inputData,
VpEngine vpEngine,
const SubchunkIndex subChunkIndex 
)

Called to cause the VP to process the provided inputs.

It will be called in three different contexts as indicated by the ProcessingType.

virtual ProcessingResult casa::vpf::VisibilityProcessor::doProcessingImpl ( ProcessingType  processingType,
VpData inputData,
const SubchunkIndex subChunkIndex 
)
protectedpure virtual

Requests processing of the provided (possibly empty) input data.

This is called on each subchunk (then inputData will be nonempty) and at the end of a chunk and the end of the entire data set. These last two call types allow the VP to output any data that it might have been accumulating across multiple subchunks, etc.

Implemented in casa::vpf::VpContainer, casa::vpf::WriterVp, casa::vpf::SplitterVp, and casa::vpf::VisibilityProcessorStub.

const VpContainer* casa::vpf::VisibilityProcessor::getContainer ( ) const
inline

Returns a pointer to the containing VP or NULL if this VP is top-level.

Definition at line 269 of file VisibilityProcessing.h.

casacore::String casa::vpf::VisibilityProcessor::getFullName ( ) const

The full name of a VP is a dotted list of the names of all the containing VPs ending with the name of this VP (e.g., vp0.vp1...vpN.thisVp).

VpPort casa::vpf::VisibilityProcessor::getInput ( const casacore::String name) const

Returns the input port having the specified name.

Exception if port is undefined.

VpPort& casa::vpf::VisibilityProcessor::getInputRef ( const casacore::String name)
private
VpPorts casa::vpf::VisibilityProcessor::getInputs ( casacore::Bool  connectedOnly = false) const

Returns a collection of the input ports for this VP; optionally only the connected ports are returned.

casacore::String casa::vpf::VisibilityProcessor::getName ( ) const

Returns the name of this VP.

casacore::Int casa::vpf::VisibilityProcessor::getNSubchunksProcessed ( ) const

Returns the number of Subchunks processed (mainly for testing)

casacore::Int casa::vpf::VisibilityProcessor::getNSubchunksUniqueProcessed ( ) const

Returns the number of unique Subchunks (i.e., iteration ignored) processed.

(mainly for testing)

VpPort casa::vpf::VisibilityProcessor::getOutput ( const casacore::String name) const

Returns the output port having the specified name.

Exception if port is undefined.

VpPort& casa::vpf::VisibilityProcessor::getOutputRef ( const casacore::String name)
private
VpPorts casa::vpf::VisibilityProcessor::getOutputs ( casacore::Bool  connectedOnly = false) const

Returns a collection of the output ports for this VP; optionally only the connected ports are returned.

virtual casa::asyncio::PrefetchColumns casa::vpf::VisibilityProcessor::getPrefetchColumns ( ) const
virtual

Returns the collection of columns that need to be prefetched if this node is used with async I/O.

Reimplemented in casa::vpf::VpContainer.

ROVisibilityIterator* casa::vpf::VisibilityProcessor::getVi ( )
private
VpEngine* casa::vpf::VisibilityProcessor::getVpEngine ( )
private
VisibilityProcessor& casa::vpf::VisibilityProcessor::operator= ( const VisibilityProcessor )
delete
VpPorts casa::vpf::VisibilityProcessor::portsUnconnected ( const VpPorts ports,
casacore::Bool(VpPort::*)() const  isConnected,
const std::vector< casacore::String > &  except = std::vector< casacore::String >() 
) const
protected

Returns a collection of the ports that are not connected using the provided connection method; some ports may also be excluded from this list by name.

void casa::vpf::VisibilityProcessor::processingStart ( )

Called by the framework when the processing is about to begin (i.e., prior to the first VisBuffer being fed into the graph.

virtual void casa::vpf::VisibilityProcessor::processingStartImpl ( )
inlineprotectedvirtual

Called when data processing is about to beging; this allows the VP to perform any initialization that it desires now that it is completely connected into the graph.

Reimplemented in casa::vpf::VpContainer.

Definition at line 356 of file VisibilityProcessing.h.

void casa::vpf::VisibilityProcessor::setContainer ( const VpContainer )
private
void casa::vpf::VisibilityProcessor::throwIfAnyInputsUnconnected ( const std::vector< casacore::String > &  exceptThese = std::vector< casacore::String >()) const
protected

Methods to ease the validation process.

void casa::vpf::VisibilityProcessor::throwIfAnyInputsUnconnectedExcept ( const casacore::String exceptThisOne) const
protected
void casa::vpf::VisibilityProcessor::throwIfAnyOutputsUnconnected ( const std::vector< casacore::String > &  exceptThese = std::vector< casacore::String >()) const
protected
void casa::vpf::VisibilityProcessor::throwIfAnyOutputsUnconnectedExcept ( const casacore::String exceptThisOne) const
protected
void casa::vpf::VisibilityProcessor::throwIfAnyPortsUnconnected ( ) const
protected
void casa::vpf::VisibilityProcessor::validate ( )

Called to ask the VP to check its validity (i.e., are all needed inputs connected, etc.).

virtual void casa::vpf::VisibilityProcessor::validateImpl ( )
protectedpure virtual

Called to allow the node to validate its initial state.

An casacore::AipsError should be thrown if this node decides that it is invalid.

Implemented in casa::vpf::VpContainer, casa::vpf::WriterVp, casa::vpf::SplitterVp, and casa::vpf::VisibilityProcessorStub.

Friends And Related Function Documentation

friend class VpContainer
friend

Definition at line 227 of file VisibilityProcessing.h.

friend class WriterVp
friend

Definition at line 228 of file VisibilityProcessing.h.

Member Data Documentation

const VpContainer* casa::vpf::VisibilityProcessor::container_p
private

Definition at line 380 of file VisibilityProcessing.h.

casacore::String casa::vpf::VisibilityProcessor::name_p
private

Definition at line 381 of file VisibilityProcessing.h.

casacore::Int casa::vpf::VisibilityProcessor::nSubchunks_p
private

Definition at line 382 of file VisibilityProcessing.h.

casacore::Int casa::vpf::VisibilityProcessor::nSubchunksUnique_p
private

Definition at line 383 of file VisibilityProcessing.h.

VpEngine* casa::vpf::VisibilityProcessor::vpEngine_p
private

Definition at line 384 of file VisibilityProcessing.h.

VpPorts casa::vpf::VisibilityProcessor::vpInputs_p
private

Definition at line 385 of file VisibilityProcessing.h.

VpPorts casa::vpf::VisibilityProcessor::vpOutputs_p
private

Definition at line 386 of file VisibilityProcessing.h.


The documentation for this class was generated from the following file: