radarlib 1.4.6
|
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... | |
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:
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.
|
protectedvirtual |
Called when the visited OdimObject is not supported (noop)
|
protectedvirtual |
Called when the visited OdimObject is a PolarVolume (noop)
|
protectedvirtual |
Called when the visited OdimObject is a ImageObject (noop)
|
protectedvirtual |
Called when the visited OdimObject is a CompObject (noop)
|
protectedvirtual |
Called when the visited OdimObject is a XsecObject (noop)