radarlib  1.4.4
OdimH5v21::utils::OdimObjectVisitor Class Reference

Generic OdimObject visitor. More...

#include <radarlib/odimh5v21_utils.hpp>

Public Member Functions

void visitObject (OdimH5v21::OdimObject &obj)
 Visit a generic object and call the proper method visit() More...
 

Protected Member Functions

virtual void visitDefault (OdimH5v21::OdimObject &obj)
 Called when the visited OdimObject is not supported (noop) More...
 
virtual void visit (OdimH5v21::PolarVolume &obj)
 Called when the visited OdimObject is a PolarVolume (noop) More...
 
virtual void visit (OdimH5v21::ImageObject &obj)
 Called when the visited OdimObject is a ImageObject (noop) More...
 
virtual void visit (OdimH5v21::CompObject &obj)
 Called when the visited OdimObject is a CompObject (noop) More...
 
virtual void visit (OdimH5v21::XsecObject &obj)
 Called when the visited OdimObject is a XsecObject (noop) More...
 

Detailed Description

Generic OdimObject visitor.

This class allows to visit a concrete odim object given a generic one. When the method visitObject(OdimH5v21::OdimObject&) is called, visitor invokes the proper methot visit(). A concrete visitor should override one or more of the visit() methods (the default behaviour is a noop).

For example, the following class prints the number of scans if a polar volume is found, otherwise does nothing:

* struct MyVisitor : public OdimObjectVisitor {
* protected:
* virtual void visit(OdimH5v21::PolarVolume& obj) {
* std::cout
* << "Polar volume: #scans: " << obj.getScanCount() << std::endl;
* }
* };
*

Member Function Documentation

void OdimH5v21::utils::OdimObjectVisitor::visitObject ( OdimH5v21::OdimObject obj)

Visit a generic object and call the proper method visit()

This method accepts a generic OdimObject, casts it to the proper concrete class (based on OdimObject::getObject()) and call the proper visit() method.

If the object type is not supported, the visitor calls visitDefault().

If the object type and the class are not consistent, an exception is thrown.

virtual void OdimH5v21::utils::OdimObjectVisitor::visitDefault ( OdimH5v21::OdimObject obj)
protectedvirtual

Called when the visited OdimObject is not supported (noop)

virtual void OdimH5v21::utils::OdimObjectVisitor::visit ( OdimH5v21::PolarVolume obj)
protectedvirtual

Called when the visited OdimObject is a PolarVolume (noop)

virtual void OdimH5v21::utils::OdimObjectVisitor::visit ( OdimH5v21::ImageObject obj)
protectedvirtual

Called when the visited OdimObject is a ImageObject (noop)

virtual void OdimH5v21::utils::OdimObjectVisitor::visit ( OdimH5v21::CompObject obj)
protectedvirtual

Called when the visited OdimObject is a CompObject (noop)

virtual void OdimH5v21::utils::OdimObjectVisitor::visit ( OdimH5v21::XsecObject obj)
protectedvirtual

Called when the visited OdimObject is a XsecObject (noop)


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