Public Types | Public Member Functions | Protected Member Functions

mitk::BaseDataSource Class Reference
[Process Classes]

Superclass of all classes generating base data (instances of class mitk::BaseData) as output. More...

#include <mitkBaseDataSource.h>

Inheritance diagram for mitk::BaseDataSource:
Inheritance graph
[legend]
Collaboration diagram for mitk::BaseDataSource:
Collaboration graph
[legend]

List of all members.

Public Types

typedef mitk::BaseData OutputType
typedef OutputType::Pointer OutputTypePointer

Public Member Functions

 mitkClassMacro (BaseDataSource, BaseProcess)
virtual itk::DataObject::Pointer MakeOutput (unsigned int idx)=0
virtual void SetOutput (OutputType *output)
virtual void SetOutput (unsigned int idx, OutputType *output)
virtual OutputTypeGetOutput ()
virtual OutputTypeGetOutput (unsigned int idx)

Protected Member Functions

 BaseDataSource ()
virtual ~BaseDataSource ()

Detailed Description

Superclass of all classes generating base data (instances of class mitk::BaseData) as output.

In itk and vtk the generated result of a ProcessObject is only guaranteed to be up-to-date, when Update() of the ProcessObject or the generated DataObject is called immediately before access of the data stored in the DataObject. This is also true for subclasses of mitk::BaseProcess and thus for mitk::BaseDataSource.

Definition at line 39 of file mitkBaseDataSource.h.


Member Typedef Documentation

Definition at line 44 of file mitkBaseDataSource.h.

Definition at line 46 of file mitkBaseDataSource.h.


Constructor & Destructor Documentation

mitk::BaseDataSource::BaseDataSource (  ) [protected]

Definition at line 22 of file mitkBaseDataSource.cpp.

{
    // Pure virtual functions may not be called in the constructor...
    // see ( see Bjarne Stroustrup's C++ PL 3rd ed section 15.4.3 )
    //OutputType::Pointer output = static_cast<OutputType*> ( this->MakeOutput( 0 ).GetPointer() );
    //Superclass::SetNumberOfRequiredOutputs( 1 );
    //Superclass::SetNthOutput( 0, output.GetPointer() );
}
mitk::BaseDataSource::~BaseDataSource (  ) [protected, virtual]

Definition at line 33 of file mitkBaseDataSource.cpp.

{
}

Member Function Documentation

mitk::BaseDataSource::OutputType * mitk::BaseDataSource::GetOutput (  ) [virtual]

Returns the output with index 0 of the base data source

Returns:
the output

Definition at line 53 of file mitkBaseDataSource.cpp.

{
    if ( this->GetNumberOfOutputs() < 1 )
    {
        return 0;
    }
    return static_cast<OutputType*> ( Superclass::GetOutput( 0 ) );
}
mitk::BaseDataSource::OutputType * mitk::BaseDataSource::GetOutput ( unsigned int  idx ) [virtual]

Returns the n'th output of the base data source

Parameters:
idxthe index of the wanted output
Returns:
the output with index idx.

Definition at line 64 of file mitkBaseDataSource.cpp.

{
    return static_cast<OutputType*> ( Superclass::GetOutput( idx ) );
}
virtual itk::DataObject::Pointer mitk::BaseDataSource::MakeOutput ( unsigned int  idx ) [pure virtual]

Allocates a new output object and returns it. This function is pure virtual because mitk::BaseData contains pure virtual functions and can not directly be instantiated. This must be done by subclasses, which know which subclasses of mitk::BaseData they want to instantiate. Thus, these classes have to set their output themselves via this->SetOutput(MakeOutput(0)) in the constructor!

Parameters:
idxthe index of the output for which an object should be created
Returns:
the new object
mitk::BaseDataSource::mitkClassMacro ( BaseDataSource  ,
BaseProcess   
)
void mitk::BaseDataSource::SetOutput ( OutputType output ) [virtual]

Allows to set the output of the base data source.

Parameters:
outputthe intended output of the base data source

Definition at line 39 of file mitkBaseDataSource.cpp.

{
    this->SetNthOutput( 0, output );
}
void mitk::BaseDataSource::SetOutput ( unsigned int  idx,
OutputType output 
) [virtual]

Allows to set the n-th output of the base data source.

Parameters:
idxThe index of the output
outputThe intended output of the base data source

Definition at line 46 of file mitkBaseDataSource.cpp.

{
    this->SetNthOutput(idx, output);    
}

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines