Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
util::DataProductChangeTracker_t Class Reference

Detects the presence of a new event or data product. More...

#include <ChangeTrackers.h>

Inheritance diagram for util::DataProductChangeTracker_t:
util::EventChangeTracker_t util::EventChangeTracker_t util::PlaneDataChangeTracker_t

Classes

struct  LocalState_t
 

Public Member Functions

 DataProductChangeTracker_t ()=default
 Default constructor: no current data product. More...
 
 DataProductChangeTracker_t (art::Event const &evt, art::InputTag const &label)
 Constructor: specifies current event and data product label. More...
 
 DataProductChangeTracker_t (art::EventID const &evt_id, art::InputTag const &label)
 Constructor: specifies current event ID and data product label. More...
 
 operator std::string () const
 Returns a string representation of event and data product label. More...
 
 DataProductChangeTracker_t ()=default
 Default constructor: no current data product. More...
 
 DataProductChangeTracker_t (art::Event const &evt, art::InputTag const &label)
 Constructor: specifies current event and data product label. More...
 
 DataProductChangeTracker_t (art::EventID const &evt_id, art::InputTag const &label)
 Constructor: specifies current event ID and data product label. More...
 
 operator std::string () const
 Returns a string representation of event and data product label. More...
 
State query

Returns the current input label

art::InputTag const & inputLabel () const
 
bool sameEvent (DataProductChangeTracker_t const &as) const
 Returns whether we are in the same event (the rest could differ) More...
 
bool same (DataProductChangeTracker_t const &as) const
 Returns whether we have same data product as in "as". More...
 
bool isValid () const
 Returns whether there is a current event and data product. More...
 
bool operator== (DataProductChangeTracker_t const &as) const
 Returns whether the event and input label are the same as in "as". More...
 
bool operator!= (DataProductChangeTracker_t const &than) const
 Returns whether the event or input label are different than in "than". More...
 
art::InputTag const & inputLabel () const
 
bool sameEvent (DataProductChangeTracker_t const &as) const
 Returns whether we are in the same event (the rest could differ) More...
 
bool same (DataProductChangeTracker_t const &as) const
 Returns whether we have same data product as in "as". More...
 
bool isValid () const
 Returns whether there is a current event and data product. More...
 
bool operator== (DataProductChangeTracker_t const &as) const
 Returns whether the event and input label are the same as in "as". More...
 
bool operator!= (DataProductChangeTracker_t const &than) const
 Returns whether the event or input label are different than in "than". More...
 
State change

Forget the current data product

void clear ()
 
void set (art::Event const &evt, art::InputTag const &label)
 Set a new event and data product label as current. More...
 
bool update (DataProductChangeTracker_t const &new_prod)
 Update to a new data product, return true if it has changed. More...
 
void clear ()
 
void set (art::Event const &evt, art::InputTag const &label)
 Set a new event and data product label as current. More...
 
bool update (DataProductChangeTracker_t const &new_prod)
 Update to a new data product, return true if it has changed. More...
 

Private Member Functions

void SetInputLabel (art::InputTag const &label)
 
void SetInputLabel (art::InputTag const &label)
 
- Private Member Functions inherited from util::EventChangeTracker_t
 EventChangeTracker_t ()=default
 Default constructor: no current event, next event is a new one. More...
 
 EventChangeTracker_t (art::Event const &evt)
 Constructor: current event as specified. More...
 
 EventChangeTracker_t (art::EventID const &evt_id)
 Constructor: current event as specified by the event ID. More...
 
 operator std::string () const
 Returns a string representing the current state. More...
 
 EventChangeTracker_t ()=default
 Default constructor: no current event, next event is a new one. More...
 
 EventChangeTracker_t (art::Event const &evt)
 Constructor: current event as specified. More...
 
 EventChangeTracker_t (art::EventID const &evt_id)
 Constructor: current event as specified by the event ID. More...
 
 operator std::string () const
 Returns a string representing the current state. More...
 
bool same (EventChangeTracker_t const &as) const
 
bool isValid () const
 Returns whether there is a current event. More...
 
bool operator== (EventChangeTracker_t const &as) const
 Returns whether this tracker is in the same state as another. More...
 
bool operator!= (EventChangeTracker_t const &than) const
 Returns whether this tracker is in a different state than another. More...
 
bool same (EventChangeTracker_t const &as) const
 
bool isValid () const
 Returns whether there is a current event. More...
 
bool operator== (EventChangeTracker_t const &as) const
 Returns whether this tracker is in the same state as another. More...
 
bool operator!= (EventChangeTracker_t const &than) const
 Returns whether this tracker is in a different state than another. More...
 
void clear ()
 
void set (art::EventID const &evt_id)
 Sets the current event ID. More...
 
void set (art::Event const &evt)
 Sets the current event ID from the given event. More...
 
bool update (EventChangeTracker_t const &trk)
 Sets the current event, and returns true if it is changed. More...
 
void clear ()
 
void set (art::EventID const &evt_id)
 Sets the current event ID. More...
 
void set (art::Event const &evt)
 Sets the current event ID from the given event. More...
 
bool update (EventChangeTracker_t const &trk)
 Sets the current event, and returns true if it is changed. More...
 
art::EventID const & eventID () const
 Returns the current event ID (it might be made public...) More...
 
art::EventID const & eventID () const
 Returns the current event ID (it might be made public...) More...
 

Private Attributes

LocalState_t state
 

Detailed Description

Detects the presence of a new event or data product.


The state of this class describes the current data product input as the event it belongs to (by its ID) and the input tag.

Definition at line 113 of file ChangeTrackers.h.

Constructor & Destructor Documentation

util::DataProductChangeTracker_t::DataProductChangeTracker_t ( )
default

Default constructor: no current data product.

util::DataProductChangeTracker_t::DataProductChangeTracker_t ( art::Event const &  evt,
art::InputTag const &  label 
)
inline

Constructor: specifies current event and data product label.

Definition at line 121 of file ChangeTrackers.h.

121  :
123  {}
EventChangeTracker_t()=default
Default constructor: no current event, next event is a new one.
TCEvent evt
Definition: DataStructs.cxx:7
util::DataProductChangeTracker_t::DataProductChangeTracker_t ( art::EventID const &  evt_id,
art::InputTag const &  label 
)
inline

Constructor: specifies current event ID and data product label.

Definition at line 127 of file ChangeTrackers.h.

127  :
129  {}
EventChangeTracker_t()=default
Default constructor: no current event, next event is a new one.
util::DataProductChangeTracker_t::DataProductChangeTracker_t ( )
default

Default constructor: no current data product.

util::DataProductChangeTracker_t::DataProductChangeTracker_t ( art::Event const &  evt,
art::InputTag const &  label 
)
inline

Constructor: specifies current event and data product label.

Definition at line 124 of file ChangeTrackers.h.

124  :
126  {}
EventChangeTracker_t()=default
Default constructor: no current event, next event is a new one.
TCEvent evt
Definition: DataStructs.cxx:7
util::DataProductChangeTracker_t::DataProductChangeTracker_t ( art::EventID const &  evt_id,
art::InputTag const &  label 
)
inline

Constructor: specifies current event ID and data product label.

Definition at line 130 of file ChangeTrackers.h.

130  :
132  {}
EventChangeTracker_t()=default
Default constructor: no current event, next event is a new one.

Member Function Documentation

void util::DataProductChangeTracker_t::clear ( )
inline

Definition at line 165 of file ChangeTrackers.h.

void util::DataProductChangeTracker_t::clear ( )
inline

Definition at line 168 of file ChangeTrackers.h.

art::InputTag const& util::DataProductChangeTracker_t::inputLabel ( ) const
inline

Definition at line 135 of file ChangeTrackers.h.

art::InputTag const& util::DataProductChangeTracker_t::inputLabel ( ) const
inline

Definition at line 138 of file ChangeTrackers.h.

bool util::DataProductChangeTracker_t::isValid ( ) const
inline

Returns whether there is a current event and data product.

Definition at line 146 of file ChangeTrackers.h.

147  {
148  return
150  }
bool isValid() const
Returns whether there is a current event.
std::string const & label() const noexcept
Definition: InputTag.cc:79
art::InputTag const & inputLabel() const
bool util::DataProductChangeTracker_t::isValid ( ) const
inline

Returns whether there is a current event and data product.

Definition at line 149 of file ChangeTrackers.h.

150  {
151  return
153  }
bool isValid() const
Returns whether there is a current event.
std::string const & label() const noexcept
Definition: InputTag.cc:79
art::InputTag const & inputLabel() const
util::DataProductChangeTracker_t::operator std::string ( ) const
inline

Returns a string representation of event and data product label.

Definition at line 183 of file ChangeTrackers.h.

184  {
185  return EventChangeTracker_t::operator std::string()
186  + " I{" + inputLabel().encode() + "}";
187  }
std::string string
Definition: nybbler.cc:12
std::string encode() const
Definition: InputTag.cc:97
art::InputTag const & inputLabel() const
util::DataProductChangeTracker_t::operator std::string ( ) const
inline

Returns a string representation of event and data product label.

Definition at line 186 of file ChangeTrackers.h.

187  {
188  return EventChangeTracker_t::operator std::string()
189  + " I{" + inputLabel().encode() + "}";
190  }
std::string string
Definition: nybbler.cc:12
std::string encode() const
Definition: InputTag.cc:97
art::InputTag const & inputLabel() const
bool util::DataProductChangeTracker_t::operator!= ( DataProductChangeTracker_t const &  than) const
inline

Returns whether the event or input label are different than in "than".

Definition at line 157 of file ChangeTrackers.h.

158  { return !same(than); }
bool same(DataProductChangeTracker_t const &as) const
Returns whether we have same data product as in "as".
bool util::DataProductChangeTracker_t::operator!= ( DataProductChangeTracker_t const &  than) const
inline

Returns whether the event or input label are different than in "than".

Definition at line 160 of file ChangeTrackers.h.

161  { return !same(than); }
bool same(DataProductChangeTracker_t const &as) const
Returns whether we have same data product as in "as".
bool util::DataProductChangeTracker_t::operator== ( DataProductChangeTracker_t const &  as) const
inline

Returns whether the event and input label are the same as in "as".

Definition at line 153 of file ChangeTrackers.h.

154  { return same(as); }
static constexpr double as
Definition: Units.h:101
bool same(DataProductChangeTracker_t const &as) const
Returns whether we have same data product as in "as".
bool util::DataProductChangeTracker_t::operator== ( DataProductChangeTracker_t const &  as) const
inline

Returns whether the event and input label are the same as in "as".

Definition at line 156 of file ChangeTrackers.h.

157  { return same(as); }
static constexpr double as
Definition: Units.h:101
bool same(DataProductChangeTracker_t const &as) const
Returns whether we have same data product as in "as".
bool util::DataProductChangeTracker_t::same ( DataProductChangeTracker_t const &  as) const
inline

Returns whether we have same data product as in "as".

Definition at line 142 of file ChangeTrackers.h.

143  { return sameEvent(as) && (inputLabel() == as.inputLabel()); }
art::InputTag const & inputLabel() const
static constexpr double as
Definition: Units.h:101
bool sameEvent(DataProductChangeTracker_t const &as) const
Returns whether we are in the same event (the rest could differ)
bool util::DataProductChangeTracker_t::same ( DataProductChangeTracker_t const &  as) const
inline

Returns whether we have same data product as in "as".

Definition at line 145 of file ChangeTrackers.h.

146  { return sameEvent(as) && (inputLabel() == as.inputLabel()); }
art::InputTag const & inputLabel() const
static constexpr double as
Definition: Units.h:101
bool sameEvent(DataProductChangeTracker_t const &as) const
Returns whether we are in the same event (the rest could differ)
bool util::DataProductChangeTracker_t::sameEvent ( DataProductChangeTracker_t const &  as) const
inline

Returns whether we are in the same event (the rest could differ)

Definition at line 138 of file ChangeTrackers.h.

139  { return EventChangeTracker_t::same(as); }
static constexpr double as
Definition: Units.h:101
bool same(EventChangeTracker_t const &as) const
bool util::DataProductChangeTracker_t::sameEvent ( DataProductChangeTracker_t const &  as) const
inline

Returns whether we are in the same event (the rest could differ)

Definition at line 141 of file ChangeTrackers.h.

142  { return EventChangeTracker_t::same(as); }
static constexpr double as
Definition: Units.h:101
bool same(EventChangeTracker_t const &as) const
void util::DataProductChangeTracker_t::set ( art::Event const &  evt,
art::InputTag const &  label 
)
inline

Set a new event and data product label as current.

Definition at line 169 of file ChangeTrackers.h.

void set(art::EventID const &evt_id)
Sets the current event ID.
void SetInputLabel(art::InputTag const &label)
TCEvent evt
Definition: DataStructs.cxx:7
void util::DataProductChangeTracker_t::set ( art::Event const &  evt,
art::InputTag const &  label 
)
inline

Set a new event and data product label as current.

Definition at line 172 of file ChangeTrackers.h.

void set(art::EventID const &evt_id)
Sets the current event ID.
void SetInputLabel(art::InputTag const &label)
TCEvent evt
Definition: DataStructs.cxx:7
void util::DataProductChangeTracker_t::SetInputLabel ( art::InputTag const &  label)
inlineprivate
void util::DataProductChangeTracker_t::SetInputLabel ( art::InputTag const &  label)
inlineprivate
bool util::DataProductChangeTracker_t::update ( DataProductChangeTracker_t const &  new_prod)
inline

Update to a new data product, return true if it has changed.

Definition at line 173 of file ChangeTrackers.h.

174  {
175  if (same(new_prod)) return false;
176  *this = new_prod;
177  return true;
178  }
bool same(DataProductChangeTracker_t const &as) const
Returns whether we have same data product as in "as".
bool util::DataProductChangeTracker_t::update ( DataProductChangeTracker_t const &  new_prod)
inline

Update to a new data product, return true if it has changed.

Definition at line 176 of file ChangeTrackers.h.

177  {
178  if (same(new_prod)) return false;
179  *this = new_prod;
180  return true;
181  }
bool same(DataProductChangeTracker_t const &as) const
Returns whether we have same data product as in "as".

Member Data Documentation

LocalState_t util::DataProductChangeTracker_t::state
private

Definition at line 194 of file ChangeTrackers.h.


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