Skip to content

Commit

Permalink
Add a comment the isAvailable() function is potentially costly
Browse files Browse the repository at this point in the history
  • Loading branch information
makortel committed Jun 12, 2023
1 parent 8512d34 commit 25cd6c8
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions DataFormats/Common/interface/Ptr.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ namespace edm {

/// Checks if collection is in memory or available
/// in the event. No type checking is done.
/// This function is potentially costly as it might cause a disk
/// read (note that it does not cause the data to be cached locally)
bool isAvailable() const;

/// Checks if this Ptr is transient (i.e. not persistable).
Expand Down
4 changes: 4 additions & 0 deletions DataFormats/Common/interface/Ref.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,8 @@ namespace edm {

/// Checks if collection is in memory or available
/// in the Event. No type checking is done.
/// This function is potentially costly as it might cause a disk
/// read (note that it does not cause the data to be cached locally)
bool isAvailable() const;

/// Checks if this ref is transient (i.e. not persistable).
Expand Down Expand Up @@ -404,6 +406,8 @@ namespace edm {

/// Checks if collection is in memory or available
/// in the Event. No type checking is done.
/// This function is potentially costly as it might cause a disk
/// read (note that it does not cause the data to be cached locally)
bool isAvailable() const;

/// Checks if this ref is transient (i.e. not persistable).
Expand Down
3 changes: 2 additions & 1 deletion DataFormats/Common/interface/RefCoreWithIndex.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ namespace edm {

// Checks if collection is in memory or available
// in the Event. No type checking is done.

// This function is potentially costly as it might cause a disk
// read (note that it does not cause the data to be cached locally)
bool isAvailable() const { return toRefCore().isAvailable(); }

//Convert to an equivalent RefCore. Needed for Ref specialization.
Expand Down
2 changes: 2 additions & 0 deletions DataFormats/Common/interface/RefProd.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ namespace edm {

/// Checks if collection is in memory or available
/// in the Event. No type checking is done.
/// This function is potentially costly as it might cause a disk
/// read (note that it does not cause the data to be cached locally)
bool isAvailable() const { return product_.isAvailable(); }

/// Checks if this RefProd is transient (i.e. not persistable).
Expand Down
2 changes: 2 additions & 0 deletions DataFormats/Common/interface/RefToBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ namespace edm {

/// Checks if collection is in memory or available
/// in the Event. No type checking is done.
/// This function is potentially costly as it might cause a disk
/// read (note that it does not cause the data to be cached locally)
bool isAvailable() const { return holder_ ? holder_->isAvailable() : false; }

bool isTransient() const { return holder_ ? holder_->isTransient() : false; }
Expand Down
2 changes: 2 additions & 0 deletions DataFormats/Common/interface/RefToBaseProd.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ namespace edm {

/// Checks if collection is in memory or available
/// in the Event. No type checking is done.
/// This function is potentially costly as it might cause a disk
/// read (note that it does not cause the data to be cached locally)
bool isAvailable() const { return product_.isAvailable(); }

/// Checks for null
Expand Down

0 comments on commit 25cd6c8

Please sign in to comment.