// ESAF : Euso Simulation and Analysis Framework
// $Id: EFillable.hh,v 1.8 2005/02/15 15:07:20 pesce Exp $
// A.Thea created Jun, 11 2004

#ifndef __EFILLABLE_HH_
#define __EFILLABLE_HH_

#include "Rtypes.h"
#include "TClass.h"

#include "EFiller.hh"

#define SetEVisitable()     friend class EEventTruthAdder;           \
                            friend class EShowerFiller;              \
                            friend class EChipTrackTriggerDataAdder; \
                            friend class EAtmosphereBunchAdder;      \
                            friend class EAtmosphereSingleAdder;     \
                            friend class EDetectorPhotonAdder;       \
                            friend class EDetectorPhotonDataAdder;   \
                            friend class EEventTelemetryAdder;       \
                            friend class EEventFrontEndDataAdder;    \
                            friend class EEventCellStatisticsAdder;  
                      
class EFillable {
public:
    EFillable();

    virtual ~EFillable();

    inline virtual Bool_t Fill( EFiller& f);
  
private:

    ClassDef(EFillable,1)

};

inline Bool_t EFillable::Fill( EFiller& f ) {
    // 
    // Fills itself callling EFiller::Fill
    // 
    
    TString s(f.GetTarget());
    
    if ( s != IsA()->GetName() )
        return kFALSE;

    f.Fill( this ); 

    return kTRUE; 
}

#endif  /* __EFILLABLE_HH_ */