[OPUS]

Pipeline - OPUS Pipeline Class


Availability:

This class is available for the OPUS Blackboard API. The initial OPUS 2.0 release is described here

Constructors:
Pipeline( ) Constructor
~Pipeline( ) destructor

Methods:
load( ) load indicated pipeline stage file
is_loaded( ) indicate state of object
purge( ) purge contents
num_stages( ) get number of stages in file
get_title( ) get stage title
get_position( ) set stage number for indicated stage title
test_driver( ) test methods of Pipeline class

Description

Allows the user to access information about the pipeline stages that is stored in the pipeline stage file.

Example

  
    Pipeline pipeline(opus_pipeline_stage)
    cout << "Number of stages" << pipeline.num_stages()<<endl;
  

See Also:


Pipeline::Pipeline - The Pipeline object constructor.

Synopsis


Pipeline::Pipeline() 

Pipeline::Pipeline(const string& f) 	// I - stage file to load

Pipeline::Pipeline(const Ofile& f) 	// I - stage file to load

Description

Creates pipeline object

Exceptions Thrown

No_entry - if file does not exist
Corrupt - if Oresource file is corrupt
Io_error - if file error encountered loading file
Bad_val<string> - if the stretch cannot be resolved; Bad_val.arg contains the stretched file name
Bad_val<vector<string>> - if the calling arguments are incorrect; Bad_val.arg is a vector containing the calling arguments
Io_error<int> - if the disk space check fails; Io_error.arg contains the value of errno
Bad_val<vector<string>> - if calling arguments are incorrect; Bad_val.arg is a vector containing the calling arguments
Exec<int> - if the subprocess spawn attempt fails; Exec.arg contains the return status from the spawn attemp

Example

  
    Pipeline pipe("/leo/opus/definitions/opus_pipeline.stage");
    Pipeline empty();
    Ofile of(stage_file);
    Pipeline stages(of);
  


Pipeline::~Pipeline - The Pipeline object destructor.

Synopsis


Pipeline::~Pipeline()

Description

Destructor for pipeline object.

Exceptions Thrown

none


Pipeline::load - Load the indicated pipeline stage file into object.

Synopsis


void Pipeline::load(const string& f)

void Pipeline::load(const Ofile& f)

Description

Private method that loads the Oresource object with the keyword value pairs in a file.

Exceptions Thrown

Corrupt - if stage file is corrupt/missing values

Example

  
    Pipeline pipe("/leo/opus/definitions/opus_pipeline.stage");
    Pipeline empty();
  


Pipeline::purge - Purge the contents of the map and mark as unloaded

Synopsis


void Pipeline::purge()

Description

Allows the user to empty the Oresource object

Exceptions Thrown

Not_ready - if not loaded

Example

  
    pipe.purge()
  


Pipeline::is_loaded - Return whether the object has been loaded or not.

Synopsis


bool Pipeline::is_loaded() const

Description

Returns the state of the object.

Returns

    true if the object has been loaded

false if the object has not been loaded

Exceptions Thrown

none

Example

  


Pipeline::num_stages - Get the number of stages in the pipeline.

Synopsis


int Pipeline::num_stages() const

Description

Get the number of stages in the pipeline.

Returns

    The number of stages.

Exceptions Thrown

Not_ready - if stage file not loaded

Example

	cout << "Number of stages are " << pipe.num_stages() << endl;
  


Pipeline::get_title - Get the title for the indicated stage number.

Synopsis


string Pipeline::get_title(
                           const int p) const // I - stage number

Description

Returns the title of for the given stage number.

Returns

    The title of the indicated stage.

Exceptions Thrown

Bad_val - if stage number is out of range
Not_ready - if stage file is not loaded
No_entry - if stage title for the stage number

Example

  cout << "Stage title for stage " << n << " is " << pipe.get_title(n);
  


Pipeline::get_position - Get the stage title for the given stage title.

Synopsis


int Pipeline::get_position(
                           const string& t) 
                           const

Description

Returns the stage number for the given stage title.

Returns

    The stage number of the indicated stage.

Exceptions Thrown

Bad_val - if the stage title does not exist
Not_ready - if stage file is not loaded

Example

  string title("IN");
  cout << "Stage, " << title << "is in position "<< get_position("IN");
  


Pipeline::test_driver - Test the Pipeline methods.

Synopsis


bool Pipeline::test_driver(const Ofile& stage_file)

Description

Tests the methods of the Pipeline class.

Returns

    true  -  Methods successfully tested

false - Method fails testing

Exceptions Thrown

none


OPUS API index · STScI Home Page · Search · Topics · Index

Copyright © 1997-2000 The Association of Universities for Research in Astronomy, Inc. All Rights Reserved.


For more information, contact opushelp@stsci.edu

Last modified: 25 April 2000