USGS

Isis 3.0 Developer's Reference (API)

Home

Isis::PipelineApplication Class Reference

This class represents one application in the pipeline. More...

#include <PipelineApplication.h>

List of all members.

Public Types

enum  NameModifierType { ConstantStrings }
 

This is used for branches.

More...
enum  CustomParameterValue { LastOutput, LastAppOutputList, LastAppOutputListNoMerge }
 

This is used to set custom values that must be calculated on the fly.

More...

Public Member Functions

 PipelineApplication (iString appName, Pipeline *pipe)
 Constructs the first pipeline application.
 PipelineApplication (iString appName, PipelineApplication *previous)
 Constructs subsequent pipeline applications.
 ~PipelineApplication ()
 This is the destructor.
const iStringName () const
 Get the name of this pipeline application.
const vector< iString > & ParamString () const
 Get the parameters for running this program; one element in the vector per run.
const vector< iString > & InputBranches () const
 Get the branches this program expects as input.
const vector< iString > & OutputBranches () const
 Get the branches this program has as output.
void Enable ()
 This method enables this program to be run.
void Disable ()
 This method disables this program, causing it to be ignored.
const bool & Enabled () const
 Returns true if this program will be run.
void SetInputParameter (const iString &inputParamName, bool supportsVirtualBands)
 Set the input parameter for this application and whether or not this application supports the virtual bands functionality.
void SetInputParameter (const iString &inputParamName, CustomParameterValue value, bool supportsVirtualBands)
 Set the input parameter for this application and whether or not this application supports the virtual bands functionality.
void SetOutputParameter (const iString &outputParamName, const iString &outNameModifier, const iString &outFileExtension="cub")
 Set the output parameter for this application and it's naming convention.
void SetOutputParameter (const iString &branch, const iString &outputParamName, const iString &outNameModifier, const iString &outFileExtension)
 Set the output parameter for a branch of this application and it's naming convention.
void AddBranch (const iString &modString, NameModifierType type)
 This method adds branch to this program.
void AddParameter (const iString &inputParamName, const iString &appParamName)
 This method adds knowledge of a parameter to the application.
void AddParameter (const iString &branch, const iString &inputParamName, const iString &appParamName)
 This method adds knowledge of a parameter to this application, that will only affect the specified branch.
void AddConstParameter (const iString &appParamName, const iString &appParamValue)
 This method adds a parameter to this application with a known value (does not get it from the user interface, must be specified).
void AddConstParameter (const iString &branch, const iString &appParamName, const iString &appParamValue)
 This method adds a parameter to this application with a known value (does not get it from the user interface, must be specified) that only affects a single branch.
void AddParameter (const iString &appParamName, CustomParameterValue value)
 This method adds a parameter with a calculated value (special) to this application.
void AddParameter (const iString &branch, const iString &appParamName, CustomParameterValue value)
 This method adds a parameter with a calculated value (special) to this application that only affects the specified branch.
iString OutputNameModifier ()
 This returns this application's output name modifier.
iString OutputExtension ()
 This returns this application's output file name's extension.
vector< iString > & GetOutputs ()
 This returns this application's output files. Only valid after BuildParamString is called.
vector< iStringTemporaryFiles ()
 This method returns a list of the temporary files generated by this program.
void SetNext (PipelineApplication *next)
 Link to the next application in the pipeline.
void SetPrevious (PipelineApplication *prev)
 Link to the previous application in the pipeline.
void BuildParamString ()
 This method calculates the inputs, outputs and necessary calls to this program for the pipeline.
PipelineApplicationNext () const
 This returns the next enabled pipeline application or null.
PipelineApplicationPrevious () const
 This returns the last enabled pipeline application or null.
PipelineApplicationPreviousOutputer () const
 This returns the previous enabled pipeline application that makes output or null.
bool SupportsVirtualBands ()
 Returns true if virtual bands are supported.
void SetVirtualBands (vector< iString > bands)
 Set the virtual bands that this application is to apply.
void EnableBranch (iString branch, bool flag)
 Enable/Disable Branch given the branch name.
bool BranchEnabled (int branch)
 Check whether a branch is enabled given branch index.
void SetContinue (bool pbFlag)
 Set the continue flag status.
bool Continue (void)
 Get the continue flag status.

Detailed Description

This class represents one application in the pipeline.

This contains methods for setting application-specific parameters, such as application inputs and outputs. Only pipeline should be instantiating these!

The applications work as a doubly-linked list in order to calculate inputs and outputs correctly. Calling SetNext or SetPrevious is not recommended.

Author:
2008-08-04 Steven Lambright

Member Enumeration Documentation

This is used to set custom values that must be calculated on the fly.

Enumerator:
LastOutput 

The very last output file. Do not use this for input parameters if it's not necessary, that is done automatically.

LastAppOutputList 

A list of files from the last run application's output.

LastAppOutputListNoMerge 

A list of files from the last run application's output.

This is used for branches.

Right now, only known strings can be used to specify each branch.

Enumerator:
ConstantStrings 

Known strings.


Constructor & Destructor Documentation

Isis::PipelineApplication::PipelineApplication ( iString  appName,
Pipeline pipe 
)

Constructs the first pipeline application.

Parameters:
appName The name of this application
pipe The pipeline
History:
2010-12-20 Sharmila Prasad Initialise & enable the branches

References Isis::Pipeline::OriginalBranches().

Isis::PipelineApplication::PipelineApplication ( iString  appName,
PipelineApplication previous 
)

Constructs subsequent pipeline applications.

Parameters:
appName The name of this application
previous The previously last pipeline application
History:
2010-12-20 Sharmila Prasad Initialise & enable the branches

References OutputBranches(), and SetNext().

Isis::PipelineApplication::~PipelineApplication (  )  [inline]

This is the destructor.


Member Function Documentation

void Isis::PipelineApplication::AddBranch ( const iString modString,
NameModifierType  type 
)

This method adds branch to this program.

A branch means with one input, multiple outputs are automatically created.

Example:

   thm2isis from=input.img to=output.cub

In this code, thm2isis could actually create output.even.cub and output.odd.cub. The branches are then "even" and "odd". This is used only for the case where the program outputs multiple images based upon one "TO" parameter.

Parameters:
modString Branch name
type Modifier type; currently only supports constant strings
History:
2010-12-20 Sharmila Prasad Enable the branch at the time of creation

References _FILEINFO_, Isis::iException::Message(), and Isis::iException::Programmer.

void Isis::PipelineApplication::AddConstParameter ( const iString branch,
const iString appParamName,
const iString appParamValue 
)

This method adds a parameter to this application with a known value (does not get it from the user interface, must be specified) that only affects a single branch.

Parameters:
branch Branch this parameter affects
appParamName Name of the parameter
appParamValue Value of the parameter
void Isis::PipelineApplication::AddConstParameter ( const iString appParamName,
const iString appParamValue 
)

This method adds a parameter to this application with a known value (does not get it from the user interface, must be specified).

Parameters:
appParamName Name of the parameter
appParamValue Value of the parameter

References Name().

void Isis::PipelineApplication::AddParameter ( const iString branch,
const iString appParamName,
CustomParameterValue  value 
)

This method adds a parameter with a calculated value (special) to this application that only affects the specified branch.

Parameters:
branch Branch this parameter affects
appParamName Parameter name
value Value type
void Isis::PipelineApplication::AddParameter ( const iString appParamName,
CustomParameterValue  value 
)

This method adds a parameter with a calculated value (special) to this application.

Parameters:
appParamName Parameter name
value Value type
void Isis::PipelineApplication::AddParameter ( const iString branch,
const iString inputParamName,
const iString appParamName 
)

This method adds knowledge of a parameter to this application, that will only affect the specified branch.

The parameter value is taken directly from the user interface; internal defaults are supported by not using the parameter.

Parameters:
branch The branch this parameter affects
inputParamName Parameter in the proc program
appParamName Parameter in the this application

References IsisAml::GetAsString(), and IsisAml::WasEntered().

void Isis::PipelineApplication::AddParameter ( const iString inputParamName,
const iString appParamName 
)

This method adds knowledge of a parameter to the application.

The parameter value is taken directly from the user interface.

Parameters:
inputParamName Parameter in the proc program
appParamName Parameter in this application

References IsisAml::GetAsString(), and IsisAml::WasEntered().

bool Isis::PipelineApplication::BranchEnabled ( int  branch  )  [inline]

Check whether a branch is enabled given branch index.

Author:
Sharmila Prasad (12/20/2010)
Parameters:
branch - index into the branch
Returns:
bool - true/false

Referenced by BuildParamString().

void Isis::PipelineApplication::BuildParamString (  ) 

This method calculates the inputs, outputs and necessary calls to this program for the pipeline.

This should only be used by Pipeline.

History:
2010-12-20 Sharmila Prasad Set appropriate inputs to the branch taking into consideration whether the previous branch was enabled/disabled. Also set the input list accordingly if needlist is true

References _FILEINFO_, BranchEnabled(), Enabled(), GetOutputs(), infile, Isis::IsSpecial(), Isis::PipelineParameter::IsSpecial(), LastAppOutputList, LastOutput, Isis::iException::Message(), Isis::PipelineParameter::Name(), Name(), OutputBranches(), Previous(), Isis::iException::Programmer, Isis::PipelineParameter::Special(), and Isis::Pipeline::TemporaryFolder().

bool Isis::PipelineApplication::Continue ( void   )  [inline]

Get the continue flag status.

Author:
Sharmila Prasad (2/9/2011)
Returns:
bool - return continue status
void Isis::PipelineApplication::Disable (  )  [inline]

This method disables this program, causing it to be ignored.

void Isis::PipelineApplication::Enable (  )  [inline]

This method enables this program to be run.

void Isis::PipelineApplication::EnableBranch ( iString  branch,
bool  flag 
) [inline]

Enable/Disable Branch given the branch name.

Author:
Sharmila Prasad (12/20/2010)
Parameters:
branch - branch name
flag - true/false
const bool& Isis::PipelineApplication::Enabled (  )  const [inline]
vector< iString > & Isis::PipelineApplication::GetOutputs (  ) 

This returns this application's output files. Only valid after BuildParamString is called.

References Enabled(), GetOutputs(), and Previous().

Referenced by BuildParamString(), and GetOutputs().

const vector<iString>& Isis::PipelineApplication::InputBranches (  )  const [inline]

Get the branches this program expects as input.

const iString& Isis::PipelineApplication::Name (  )  const [inline]

Get the name of this pipeline application.

Referenced by AddConstParameter(), BuildParamString(), and Isis::operator<<().

PipelineApplication* Isis::PipelineApplication::Next (  )  const [inline]

This returns the next enabled pipeline application or null.

References Enabled(), and Next().

Referenced by Next().

const vector<iString>& Isis::PipelineApplication::OutputBranches (  )  const [inline]

Get the branches this program has as output.

References Enabled(), OutputBranches(), and Previous().

Referenced by BuildParamString(), Isis::Pipeline::FinalOutput(), OutputBranches(), and PipelineApplication().

iString Isis::PipelineApplication::OutputExtension (  )  [inline]

This returns this application's output file name's extension.

References OutputExtension(), and Previous().

Referenced by Isis::Pipeline::FinalOutput(), and OutputExtension().

iString Isis::PipelineApplication::OutputNameModifier (  )  [inline]

This returns this application's output name modifier.

References OutputNameModifier(), and Previous().

Referenced by Isis::Pipeline::FinalOutput(), and OutputNameModifier().

const vector<iString>& Isis::PipelineApplication::ParamString (  )  const [inline]

Get the parameters for running this program; one element in the vector per run.

Referenced by Isis::operator<<(), and Isis::Pipeline::Run().

PipelineApplication* Isis::PipelineApplication::Previous (  )  const [inline]

This returns the last enabled pipeline application or null.

References Enabled(), and Previous().

Referenced by BuildParamString(), Isis::Pipeline::FinalOutput(), GetOutputs(), OutputBranches(), OutputExtension(), OutputNameModifier(), Previous(), and PreviousOutputer().

PipelineApplication* Isis::PipelineApplication::PreviousOutputer (  )  const [inline]

This returns the previous enabled pipeline application that makes output or null.

References Enabled(), and Previous().

void Isis::PipelineApplication::SetContinue ( bool  pbFlag  )  [inline]

Set the continue flag status.

Author:
Sharmila Prasad (2/9/2011)
Parameters:
pbFlag - true/false
void Isis::PipelineApplication::SetInputParameter ( const iString inputParamName,
CustomParameterValue  value,
bool  supportsVirtualBands 
)

Set the input parameter for this application and whether or not this application supports the virtual bands functionality.

It supports the virtual bands functionality if the input is an Isis 3 cube.

Parameters:
inputParamName Name of the input parameter, typically "FROM"
value Custom parameter value; Recommended to use an alternate SetInputParameter instead of specifying LastOutput
supportsVirtualBands True if this application supports virtual bands

References LastAppOutputList, and LastAppOutputListNoMerge.

void Isis::PipelineApplication::SetInputParameter ( const iString inputParamName,
bool  supportsVirtualBands 
)

Set the input parameter for this application and whether or not this application supports the virtual bands functionality.

It supports the virtual bands functionality if the input is an Isis 3 cube.

Parameters:
inputParamName Name of the input parameter, typically "FROM"
supportsVirtualBands True if this application supports virtual bands

Referenced by Isis::Pipeline::Prepare().

void Isis::PipelineApplication::SetNext ( PipelineApplication next  )  [inline]

Link to the next application in the pipeline.

Parameters:
next The next pipeline application

Referenced by PipelineApplication().

void Isis::PipelineApplication::SetOutputParameter ( const iString branch,
const iString outputParamName,
const iString outNameModifier,
const iString outFileExtension 
)

Set the output parameter for a branch of this application and it's naming convention.

This is meant for an application that splits the input into two output files via two output parameters.

Parameters:
branch Branch this output parameter applies to
outputParamName Name of the output parameter
outNameModifier Modifier to add to the cube name, such as "lev1"
outFileExtension Extension of the output file (usually "cub" for cube)
void Isis::PipelineApplication::SetOutputParameter ( const iString outputParamName,
const iString outNameModifier,
const iString outFileExtension = "cub" 
)

Set the output parameter for this application and it's naming convention.

Parameters:
outputParamName Name of the output parameter
outNameModifier Modifier to add to the cube name, such as "lev1"
outFileExtension Extension of the output file (usually "cub" for cube)

Referenced by Isis::Pipeline::Prepare().

void Isis::PipelineApplication::SetPrevious ( PipelineApplication prev  )  [inline]

Link to the previous application in the pipeline.

Parameters:
prev The previous pipeline application

Referenced by Isis::Pipeline::AddToPipeline().

void Isis::PipelineApplication::SetVirtualBands ( vector< iString bands  ) 

Set the virtual bands that this application is to apply.

Empty for none.

Parameters:
bands The virtual bands string, excluding the "+". For example, "2,4-5,8"
bool Isis::PipelineApplication::SupportsVirtualBands (  ) 

Returns true if virtual bands are supported.

Returns:
bool Virtual bands supported

References Enabled().

vector< iString > Isis::PipelineApplication::TemporaryFiles (  ) 

This method returns a list of the temporary files generated by this program.

Returns:
vector<iString> The temporary files

Referenced by Isis::operator<<(), and Isis::Pipeline::Run().


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