OpenWalnut  1.4.0
Public Member Functions | Private Types | Private Attributes
WRoiProjectFileIO Class Reference

IO Class for writing the ROI structure to a project file. More...

#include <WRoiProjectFileIO.h>

+ Inheritance diagram for WRoiProjectFileIO:

List of all members.

Public Member Functions

 WRoiProjectFileIO ()
 Default constructor.
virtual ~WRoiProjectFileIO ()
 Destructor.
virtual bool parse (std::string line, unsigned int lineNumber)
 This method parses the specified line and interprets it.
virtual void done ()
 Called whenever the end of the project file has been reached.
virtual void save (std::ostream &output)
 Saves the state to the specified stream.
virtual SPtr clone (WProjectFile *project) const
 Create a clone of the IO.

Private Types

typedef unsigned int Branch
 Branch by ID.
typedef boost::tuple
< std::string, std::string > 
Property
 Property for branch/roi with ID.
typedef std::vector< PropertyProperties
 The properties as vector.
typedef unsigned int RoiID
 ID of a ROI.
typedef boost::tuple< RoiID,
Branch
Roi
 ROI by ID, second is parent branch ID.

Private Attributes

std::vector< Branchm_branches
 All loaded branch IDs.
std::map< Branch, Propertiesm_branchProperties
 Properties of each branch.
std::vector< Roim_rois
 All loaded rois.
std::map< RoiID, Propertiesm_roiProperties
 Properties of each branch.

Detailed Description

IO Class for writing the ROI structure to a project file.

Definition at line 41 of file WRoiProjectFileIO.h.


Member Typedef Documentation

typedef unsigned int WRoiProjectFileIO::Branch [private]

Branch by ID.

Definition at line 92 of file WRoiProjectFileIO.h.

typedef std::vector< Property > WRoiProjectFileIO::Properties [private]

The properties as vector.

Definition at line 102 of file WRoiProjectFileIO.h.

typedef boost::tuple< std::string, std::string > WRoiProjectFileIO::Property [private]

Property for branch/roi with ID.

Property name and value are stored as string

Definition at line 97 of file WRoiProjectFileIO.h.

typedef boost::tuple< RoiID, Branch > WRoiProjectFileIO::Roi [private]

ROI by ID, second is parent branch ID.

Definition at line 122 of file WRoiProjectFileIO.h.

typedef unsigned int WRoiProjectFileIO::RoiID [private]

ID of a ROI.

Definition at line 117 of file WRoiProjectFileIO.h.


Constructor & Destructor Documentation

Default constructor.

Definition at line 46 of file WRoiProjectFileIO.cpp.

Referenced by clone().

Destructor.

Definition at line 52 of file WRoiProjectFileIO.cpp.


Member Function Documentation

Create a clone of the IO.

This is especially useful for custom parsers registered at WProjectFile::registerParser. Implement this function.

Parameters:
projectthe project file using this parser instance.
Returns:
Cloned instance.

Implements WProjectFileIO.

Definition at line 57 of file WRoiProjectFileIO.cpp.

References WRoiProjectFileIO().

void WRoiProjectFileIO::done ( ) [virtual]

Called whenever the end of the project file has been reached.

This is useful if your specific parser class wants to do some post processing after parsing line by line.

Reimplemented from WProjectFileIO.

Definition at line 120 of file WRoiProjectFileIO.cpp.

References WProjectFileIO::addError(), WKernel::getRoiManager(), WKernel::getRunningKernel(), m_branches, m_branchProperties, m_roiProperties, and m_rois.

bool WRoiProjectFileIO::parse ( std::string  line,
unsigned int  lineNumber 
) [virtual]

This method parses the specified line and interprets it.

It gets called line by line by WProjectFile.

Parameters:
linethe current line as string
lineNumberthe current line number. Useful for error/warning/debugging output.
Returns:
true if the line could be parsed.

Implements WProjectFileIO.

Definition at line 65 of file WRoiProjectFileIO.cpp.

References wlog::debug(), m_branches, m_branchProperties, m_roiProperties, and m_rois.

void WRoiProjectFileIO::save ( std::ostream &  output) [virtual]

Saves the state to the specified stream.

Parameters:
outputthe stream to print the state to.

Implements WProjectFileIO.

Definition at line 186 of file WRoiProjectFileIO.cpp.

References WROI::getProperties(), WKernel::getRoiManager(), WKernel::getRunningKernel(), and WProjectFileIO::printProperties().


Member Data Documentation

std::vector< Branch > WRoiProjectFileIO::m_branches [private]

All loaded branch IDs.

Definition at line 107 of file WRoiProjectFileIO.h.

Referenced by done(), and parse().

Properties of each branch.

Definition at line 112 of file WRoiProjectFileIO.h.

Referenced by done(), and parse().

Properties of each branch.

Definition at line 132 of file WRoiProjectFileIO.h.

Referenced by done(), and parse().

std::vector< Roi > WRoiProjectFileIO::m_rois [private]

All loaded rois.

Definition at line 127 of file WRoiProjectFileIO.h.

Referenced by done(), and parse().


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