AlgorithmDefinition Class Reference
[Algorithms]

A single algorithm's definition as read from the configuration XML. More...

#include <algorithm_definition.h>

List of all members.

Public Types

typedef boost::shared_ptr<
DatasetDefinition
dataset_definition_pointer_type
typedef std::map< std::string,
dataset_definition_pointer_type
dataset_definition_collection_type
typedef std::set< dataset_typeaccepted_datasets_type
typedef std::map< std::string,
accepted_datasets_type
accepted_datasets_collection_type
typedef std::vector< accepted_datasets_collection_typecombinations_definition_list_type
typedef std::map< std::string,
dataset_type
already_set_datasets_type

Public Member Functions

 AlgorithmDefinition ()
 ~AlgorithmDefinition ()
void setName (std::string name)
void setClassification (std::string classification)
void setLibraryName (std::string library_name)
void addDatasetCombination (accepted_datasets_collection_type accepted_datasets)
void setDatasetCombinations (combinations_definition_list_type combinations)
std::string getName ()
std::string getClassification ()
std::string getLibraryName ()
combinations_definition_list_type getDatasetCombinations ()
void addInputDataset (dataset_definition_pointer_type dataset)
void addOutputDataset (dataset_definition_pointer_type dataset)
dataset_definition_pointer_type getInputDataset (std::string name)
dataset_definition_collection_type getInputDatasets ()
dataset_definition_collection_type getOutputDatasets ()
accepted_datasets_type getPossibleCombinations (std::string name, already_set_datasets_type already_set_datasets)
void setOutputDatasetIds (config_dataset_id_to_output_map_type &dataset_id_map)
std::string toString ()


Detailed Description

A single algorithm's definition as read from the configuration XML.

AlgorithmDefinition basically is the code version of the configuration XML.

The XML format is

  ///  <algorithm id="1">
  ///    <name>Algorithmus 1</name>
  ///    <classification>Whatever</classification>
  ///    <library>libtestalgorithmplugin.so</library>
  ///    <input>
  ///      <dataset name="minuend" readonly="false" />
  ///      <dataset name="subtrahend" readonly="true" />  
  ///    </input>
  ///    <output>
  ///      <dataset name="result" type="image" byte="2" />
  ///     <dataset name="matrix" type="numeric" />
  ///    </output>
  ///    <combinations>
  ///      <combination>
  ///        <dataset name="minuend">
  ///          <type type="volume" bytes="1" />
  ///          <type type="volume" bytes="2" />
  ///          <type type="volume" bytes="4" />
  ///        </dataset>
  ///        <dataset name="subtrahend">
  ///          <type type="volume" bytes="1" />
  ///          <type type="volume" bytes="2" />
  ///        </dataset>
  ///      </combination>
  ///      <combination>
  ///        <dataset name="minuend">
  ///          <type type="image" bytes="1" />
  ///          <type type="image" bytes="2" />
  ///          <type type="image" bytes="4" />
  ///        </dataset>
  ///        <dataset name="subtrahend">
  ///          <type type="image" bytes="1" />
  ///          <type type="image" bytes="2" />
  ///        </dataset>
  ///      </combination>
  ///    </combinations>
  ///  </algorithm>
  ///  

Author:
Martin Reininger (martin.reininger@imedgine.org)

Definition at line 75 of file algorithm_definition.h.


Member Typedef Documentation

typedef std::map<std::string, accepted_datasets_type> accepted_datasets_collection_type
 

a single combination of a dataset name and its accepted types

Definition at line 101 of file algorithm_definition.h.

typedef std::set<dataset_type> accepted_datasets_type
 

a set of accepted dataset types that a dataset may accept as valid

Definition at line 95 of file algorithm_definition.h.

typedef std::map<std::string, dataset_type> already_set_datasets_type
 

a mapping of dataset name to a single type to describe an already set dataset from the algorithm widget

Definition at line 114 of file algorithm_definition.h.

typedef std::vector<accepted_datasets_collection_type> combinations_definition_list_type
 

a collection of accepted combinations

Definition at line 107 of file algorithm_definition.h.

typedef std::map<std::string, dataset_definition_pointer_type> dataset_definition_collection_type
 

A map of dataset definition names to dataset definition pointers

Definition at line 89 of file algorithm_definition.h.

typedef boost::shared_ptr<DatasetDefinition> dataset_definition_pointer_type
 

A type definining a shared pointer holding a single dataset definition

Definition at line 83 of file algorithm_definition.h.


Constructor & Destructor Documentation

AlgorithmDefinition  ) 
 

Constructor

Definition at line 20 of file algorithm_definition.cpp.

~AlgorithmDefinition  ) 
 

Destructor

Definition at line 26 of file algorithm_definition.cpp.


Member Function Documentation

void addDatasetCombination accepted_datasets_collection_type  accepted_datasets  ) 
 

add a new dataset combination this algorithm definition accepts as valid

Parameters:
accepted_datasets the valid combination

void addInputDataset dataset_definition_pointer_type  dataset  ) 
 

TODO: Comment

Definition at line 148 of file algorithm_definition.cpp.

void addOutputDataset dataset_definition_pointer_type  dataset  ) 
 

TODO: Comment

Definition at line 141 of file algorithm_definition.cpp.

std::string getClassification  ) 
 

get the algorithm's classification

Returns:
the classification

Definition at line 60 of file algorithm_definition.cpp.

AlgorithmDefinition::combinations_definition_list_type getDatasetCombinations  ) 
 

get the algorithm's input dataset definitions

Returns:
a list of input dataset definition pointers

Definition at line 81 of file algorithm_definition.cpp.

AlgorithmDefinition::dataset_definition_pointer_type getInputDataset std::string  name  ) 
 

TODO: Comment

Definition at line 155 of file algorithm_definition.cpp.

AlgorithmDefinition::dataset_definition_collection_type getInputDatasets  ) 
 

TODO: Comment

Definition at line 171 of file algorithm_definition.cpp.

std::string getLibraryName  ) 
 

get the algorithm's library name

Returns:
the library name

Definition at line 67 of file algorithm_definition.cpp.

std::string getName  ) 
 

set the algorithm's name

Parameters:
name the name

Definition at line 53 of file algorithm_definition.cpp.

AlgorithmDefinition::dataset_definition_collection_type getOutputDatasets  ) 
 

TODO: Comment

Definition at line 178 of file algorithm_definition.cpp.

AlgorithmDefinition::accepted_datasets_type getPossibleCombinations std::string  name,
already_set_datasets_type  already_set_datasets
 

TODO: Comment

Definition at line 89 of file algorithm_definition.cpp.

void setClassification std::string  classification  ) 
 

set the algorithm's classification

Parameters:
classification the classification

Definition at line 39 of file algorithm_definition.cpp.

void setDatasetCombinations combinations_definition_list_type  combinations  ) 
 

set the list of valid dataset combinations this algorithm definition accepts

Parameters:
combinations the list of the valid combination

Definition at line 74 of file algorithm_definition.cpp.

void setLibraryName std::string  library_name  ) 
 

set the algorithm's library name

Parameters:
library_name the library name

Definition at line 46 of file algorithm_definition.cpp.

void setName std::string  name  ) 
 

set the algorithm's name

Parameters:
name the name

Definition at line 32 of file algorithm_definition.cpp.

void setOutputDatasetIds config_dataset_id_to_output_map_type dataset_id_map  ) 
 

TODO: Comment

Definition at line 185 of file algorithm_definition.cpp.

std::string toString  ) 
 

TODO: Comment

Definition at line 130 of file algorithm_definition.cpp.


The documentation for this class was generated from the following files:
Generated on Sun Aug 13 18:19:59 2006 for iMEDgine by  doxygen 1.4.6