Skip to content
Snippets Groups Projects
Commit a48ee5f3 authored by Scott Snyder's avatar Scott Snyder Committed by scott snyder
Browse files

StoreGate: Remove non-const deref operations from DataHandle.

Another step towards deprecating DataHandle: remove all methods to retrieve
the referenced object as non-const.
parent ab7e4d01
No related branches found
No related tags found
No related merge requests found
......@@ -87,7 +87,6 @@ public:
/// \name validity checks
//@{
bool isValid() const; ///<RETRIEVES the DO to check it is valid and unlocked
bool isValid(); ///<RETRIEVES the DO to check it is valid
// FIXME op! is to keep backward compatibility with Gaudi
// FIXME similar to checking the SmartDataPtr
......@@ -106,19 +105,15 @@ public:
DataHandle operator++ (int) const; ///<postfix
const_pointer_type operator->() const { return cptr(); }
pointer_type operator->() { return ptr(); }
const_reference_type operator*() const { return *cptr(); }
reference_type operator*() { return *ptr(); }
//@}
/// \name access to the underlying ptr
//@{
operator pointer_type() { return ptr(); } ///< often ambiguous
operator const_pointer_type() const { return cptr(); } ///< often ambiguous
const_pointer_type cptr() const; ///< safer explicit ptr accessor
pointer_type ptr(); ///< safer explicit ptr accessor
virtual void reset (bool /*hard*/) override { m_ptr = 0; } ///< reset pointer
//@}
......@@ -142,8 +137,8 @@ public:
const DataHandle<DATA>& h2);
private:
mutable pointer_type m_ptr;
pointer_type dataPointer() const;
mutable const_pointer_type m_ptr;
const_pointer_type dataPointer() const;
};
......
......@@ -139,16 +139,6 @@ DataHandle<DATA>::cptr() const
///////////////////////////////////////////////////////////////////////////////
template <class DATA>
typename DataHandle<DATA>::pointer_type
DataHandle<DATA>::ptr()
{
typename DataHandle<DATA>::pointer p = dataPointer();
return 0 != p && !isConst() ? p : 0;
}
///////////////////////////////////////////////////////////////////////////////
// The const version checks if the pointer is a valid pointer.
// Retrieves the GaudiObject to check validity if not already done
......@@ -161,23 +151,9 @@ DataHandle<DATA>::isValid() const
return (isInitialized() && 0 != dataPointer());
}
//////////////////////////////////////////////////////////////////////////////
// The non-const version checks if the pointer is a valid pointer and
// if the DataObject is not const.
// Retrieves the GaudiObject to check validity if not already done
template <class DATA>
bool
DataHandle<DATA>::isValid()
{
// ptr() prints a warning if the proxy is null, so also test isInitialized().
return (isInitialized() && 0 != ptr());
}
//////////////////////////////////////////////////////////////////////////////
template <class DATA>
typename DataHandle<DATA>::pointer_type
typename DataHandle<DATA>::const_pointer_type
DataHandle<DATA>::dataPointer() const {
if (0 == m_ptr) {
m_ptr = SG::DataProxy_cast<DATA>(m_proxy);
......
......@@ -131,12 +131,6 @@ public:
SG::detail::IteratorBase& cibegin,
SG::detail::IteratorBase& ciend) const;
/** Look up a keyed object in TDS (compare also tryRetrieve)
* returns false if object not available in TDS or persistent stores
* Usage: if (!p_store->contains<Foo>("fooKey")) { ... } */
///
template <typename T, typename TKEY>
bool contains(const TKEY& key) const;
//@}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment