evio  6.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
evio::IEvioFilter Class Referenceabstract

This interface allows applications to create filters so that they only receive certain structures when events are being processed. More...

#include <IEvioFilter.h>

Public Member Functions

virtual bool accept (StructureType const &structureType, std::shared_ptr< BaseStructure > structure)=0
 Accept or reject the given structure. More...
 

Detailed Description

This interface allows applications to create filters so that they only receive certain structures when events are being processed.

Below is a filter that accepts any structure that has tag = 400.


class MyFilter : IEvioFilter {
    public bool accept(StructureType & structureType, std::shared_ptr<BaseStructure> structure) {
        return (structure->getHeader()->getTag() == 400);
    }
};
MyFilter myfilter();
EventParser.getInstance().setEvioFilter(myFilter);
Author
heddle (Original java class)
timmer

Member Function Documentation

virtual bool evio::IEvioFilter::accept ( StructureType const &  structureType,
std::shared_ptr< BaseStructure structure 
)
pure virtual

Accept or reject the given structure.

Parameters
structureTypethe structure type, a StructureType enum, of the structure that was just found, e.g., StructureType.BANK.
structurethe structure that was just found. From its header the tag, num, length, and data type are available. The application can filter based on those quantities or on the data itself.
Returns
true if the structure passes the filter and should be given to the listeners.
See Also
StructureType

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