8 #ifndef VISIBILITYPROCESSING_H_
9 #define VISIBILITYPROCESSING_H_
59 class PrefetchColumns;
99 class VbPtr :
public std::shared_ptr<casa::VisBuffer> {
183 template <
typename Itr>
190 for (i = begin; i !=
end; i++){
191 if (i->getName() ==
name){
202 class PrefetchColumns;
206 class VpData:
public std::map<VpPort, VbPtr> {
250 const std::vector<casacore::String> & inputNames,
251 const std::vector<casacore::String> & outputNames = std::vector<casacore::String>(),
351 const std::vector<casacore::String> & except = std::vector<casacore::String> ())
const;
438 const std::vector<casacore::String> & outputNames);
500 const std::vector<casacore::String> & inputs = std::vector<casacore::String> (1,
"In"),
501 const std::vector<casacore::String> & outputs = std::vector<casacore::String> ());
532 typedef std::vector<VisibilityProcessor *>
VPs;
556 class VpSet :
public std::set<VisibilityProcessor *> {
559 template <
typename In>
const VpContainer * getContainer() const
Returns a pointer to the containing VP or NULL if this VP is top-level.
std::tuple< VisibilityProcessor *, VpData > ReadyVpAndData
static casacore::String getAipsRcBase()
VpPort getOutput(const casacore::String &name) const
Returns the output port having the specified name.
VpContainer(const casacore::String &name, const std::vector< casacore::String > &inputs=std::vector< casacore::String >(1,"In"), const std::vector< casacore::String > &outputs=std::vector< casacore::String >())
Creates a VpContainer object providing the specified inputs and outputs.
casacore::Bool isConnectedInput() const
VisibilityProcessorStub(const casacore::String &name)
Used to allow definition of a VP variable for use in testing.
Elements::const_iterator const_iterator
ROVisibilityIterator * getVi()
casacore::String toString() const
void throwIfAnyOutputsUnconnected(const std::vector< casacore::String > &exceptThese=std::vector< casacore::String >()) const
casacore::String getNames() const
casacore::String getName() const
Returns the name of this VP.
const VpContainer * container_p
virtual casa::asyncio::PrefetchColumns getPrefetchColumns() const
Returns the columns that are required to be prefetched if async I/O is used.
bool followsSet(const VisibilityProcessor *a, const VpSet &vpSet) const
VpPorts getOutputs(casacore::Bool connectedOnly=false) const
Returns a collection of the output ports for this VP; optionally only the connected ports are returne...
VisibilityProcessor * visibilityProcessor_p
bool follows(const VisibilityProcessor *a, const VisibilityProcessor *b) const
void throwIfAnyPortsUnconnected() const
casacore::Bool operator<(const SubchunkIndex &other) const
Comparison Operators.
std::set< VpPort > NetworkReverse
casacore::Bool contains(const casacore::String &name) const
void remapPorts(VpData &data, const VisibilityProcessor *)
ReadyVpAndData findReadyVpFlushing(VpSet &vpsWaiting, VpData &inputs) const
casacore::Int getNSubchunksProcessed() const
Returns the number of Subchunks processed (mainly for testing)
virtual ProcessingResult doProcessingImpl(ProcessingType processingType, VpData &inputData, const SubchunkIndex &subChunkIndex)
Requests processing of the provided (possibly empty) input data.
virtual ProcessingResult doProcessingImpl(ProcessingType processingType, VpData &inputData, const SubchunkIndex &subChunkIndex)=0
Requests processing of the provided (possibly empty) input data.
casacore::Int getNSubchunksUniqueProcessed() const
Returns the number of unique Subchunks (i.e., iteration ignored) processed.
static Itr find(const casacore::String &name, Itr begin, Itr end)
virtual void chunkStartImpl(const SubchunkIndex &)
The public API contains many methods that are not virtual.
std::pair< VpPort, VpPort > validateConnectionPorts(VisibilityProcessor *sourceVp, const casacore::String &sourcePortName, VisibilityProcessor *sinkVp, const casacore::String &sinkPortName)
casacore::String getFullName() const
VbPtr & operator=(casa::VisBuffer *vb)
Assignment operator setting VbPtr to a normal pointer.
VpPort getInput(const casacore::String &name) const
Returns the input port having the specified name.
virtual Type type()
Return the type enum.
VisibilityIterator * vi_p
VpPort & getOutputRef(const casacore::String &name)
void validateImpl()
Called to allow the node to validate its initial state.
casacore::Int getSubchunkNumber() const
PtrHolder< T > & operator=(const PtrHolder< T > &other)
static casacore::Bool initializeLogging()
virtual void validateImpl()=0
Called to allow the node to validate its initial state.
virtual ~VisibilityProcessor()
VpPort & getInputRef(const casacore::String &name)
std::ostream & operator<<(std::ostream &os, const VisibilityProcessor::ProcessingType &processingType)
casacore::Bool empty() const
SplitterVp(const casacore::String &name, const casacore::String &inputName, const std::vector< casacore::String > &outputNames)
casacore::Int chunkNumber_p
ostream-like interface to creating log messages.
void validateImpl()
Called to allow the node to validate its initial state.
ABSTRACT CLASSES Abstract class for colors Any implementation of color should be able to provide a hexadecimal form of the if a human readable name(i.e."black").In many places throughout the plotter
casacore::Bool isConnectedOutput() const
casacore::Bool operator==(const SubchunkIndex &other) const
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...
virtual void add(VisibilityProcessor *processor)
Adds a VP to the container.
const_iterator end() const
WriterVp(const casacore::String &name, VisibilityIterator *vi=NULL, casacore::Bool advanceVi=false, const casacore::String &input="In", const casacore::String &output="Out")
Creates a WriterVp node.
casacore::Bool operator<(const VpPort &other) const
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...
virtual casacore::String typeName()
Return type name as string.
void setContainer(const VpContainer *)
ABSTRACT CLASSES Deliberately vague to be general enough to allow for many different types of data
const_iterator begin() const
void chunkStart(const SubchunkIndex &)
chunkStart is called to inform the VP that a new chunk is starting.
casacore::Bool empty() const
casacore::String toString(VisibilityProcessor::ProcessingType p)
casacore::Bool operator!=(const SubchunkIndex &other) const
void add(const VpPort &port, VbPtr)
VbPtr(casa::VisBuffer *vb)
casacore::Bool advanceVi_p
The PrefetchColumns class is used to specify a set of columns that can be prefetched when the (RO)Vis...
virtual void processingStartImpl()
Called when data processing is about to beging; this allows the VP to perform any initialization that...
std::tuple< ChunkCode, VpData > ProcessingResult
void throwIfAnyInputsUnconnected(const std::vector< casacore::String > &exceptThese=std::vector< casacore::String >()) const
Methods to ease the validation process.
virtual void connect(VisibilityProcessor *sourceVp, const casacore::String &sourcePortName, VisibilityProcessor *sinkVp, const casacore::String &sinkPortName)
Connects the specified output to the specified input.
virtual void fillWithSequence(VisibilityProcessor *first,...)
Fills the container with the specified set of VPs.
Type
Normally ports are either input or output ports.
static casacore::LogSink * logSink_p
void validate()
Called to ask the VP to check its validity (i.e., are all needed inputs connected, etc.).
casacore::Int nSubchunksUnique_p
SubchunkIndex(casacore::Int chunkNumber=Invalid, casacore::Int subChunkNumber=Invalid, casacore::Int iteration=Invalid)
void setConnectedOutput()
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.
void processingStart()
Called by the framework when the processing is about to begin (i.e., prior to the first VisBuffer bei...
std::vector< VisibilityProcessor * > VPs
casacore::Bool disableOutput_p
N.B., advancing the flow graphs VI is prohibited.
bool Bool
Define the standard types used by Casacore.
std::map< VpPort, VpPort > Network
const VisibilityProcessor * getVp() const
casacore::String toString() const;
VpPort & getRef(const casacore::String &name)
casacore::Int nSubchunks_p
static casacore::Int logLevel_p
friend class SubchunkIndex_Test
ReadyVpAndData findReadyVp(VpSet &vpsWaiting, VpData &inputs, bool flushing) const
casacore::String getName() const
static void log(const casacore::String &format,...)
ROVisibilityIterator * vi_p
virtual void chunkStart(const SubchunkIndex &sci)
casacore::Int subChunkNumber_p
friend class VpPorts_Test
casacore::Bool operator==(const VpPort &other) const
void throwIfAnyInputsUnconnectedExcept(const casacore::String &exceptThisOne) const
casacore::Bool connectedInput_p
VpPorts getInputs(casacore::Bool connectedOnly=false) const
Returns a collection of the input ports for this VP; optionally only the connected ports are returned...
virtual void validateImpl()
Called to allow the node to validate its initial state.
Distribute LogMessages to their destination(s)
static casacore::Bool loggingInitialized_p
ProcessingResult doProcessingImpl(ProcessingType, VpData &, const SubchunkIndex &)
Requests processing of the provided (possibly empty) input data.
ProcessingResult doProcessing(ProcessingType processingType, VpData &inputData, VpEngine *vpEngine, const SubchunkIndex &subChunkIndex)
Called to cause the VP to process the provided inputs.
ROVisibilityIterator * getVi()
casacore::Int iteration_p
String: the storage and methods of handling collections of characters.
ReadyVpAndData findReadyVpNormal(VpSet &vpsWaiting, VpData &inputs) const
VpData getSelection(const VpPorts &, bool missingIsOk=false) const
Returns the (port,VbPtr) pairs for the requested set of ports.
bool isType(Type t) const
Used to check the type of the port as defined in the Type enum.
VisBuffers encapsulate one chunk of visibility data for processing.
VisibilityIterator iterates through one or more writable MeasurementSets.
casacore::Int getChunkNumber() const
void throwIfAnyOutputsUnconnectedExcept(const casacore::String &exceptThisOne) const
casacore::Bool contains(const VisibilityProcessor *) const
ProcessingResult doProcessingImpl(ProcessingType processingType, VpData &inputData, const SubchunkIndex &subChunkIndex)
Requests processing of the provided (possibly empty) input data.
casacore::Bool connectedOutput_p
void process(VisibilityProcessor &processor, ROVisibilityIterator &vi, const casacore::String &inputPortName)
Process the data set swept by the VisibilityIterator using the VisibilityProcessor provided with the ...
ROVisibilityIterator iterates through one or more readonly MeasurementSets.
casacore::Bool setDisableOutput(casacore::Bool disableIt)
This paradoxical method allows the user to create a single data flow graph and then programmatically ...
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 p...
class SimpleVp: public VisibilityProcessor {
ProcessingResult doProcessingImpl(ProcessingType processingType, VpData &inputData, const SubchunkIndex &subChunkIndex)
Requests processing of the provided (possibly empty) input data.
void validateImpl()
Called to allow the node to validate its initial state.
friend class VisibilityProcessing
static casacore::LogIO * logIo_p
VPs::const_iterator const_iterator
casacore::String getNames() const
casacore::Int getIteration() const
virtual void processingStartImpl()
Called when data processing is about to beging; this allows the VP to perform any initialization that...
VisibilityProcessor & operator=(const VisibilityProcessor &)=delete
VPs vps_p
backwards order.
NetworkReverse networkReverse_p
casacore::String toString() const
static casacore::Int getLogLevel()