/usr/include/polybori/common/CWeakPtrFacade.h is in libbrial-dev 1.2.0-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | // -*- c++ -*-
//*****************************************************************************
/** @file CWeakPtrFacade.h
*
* @author Alexander Dreyer
* @date 2011-06-14
*
* This file includes the definition of the class @c CWeakPtrFacade.
*
* @par Copyright:
* (c) by The PolyBoRi Team
*
**/
//*****************************************************************************
#ifndef polybori_CWeakPtrFacade_h_
#define polybori_CWeakPtrFacade_h_
// include basic definitions
#include <polybori/pbori_defs.h>
#include <memory>
BEGIN_NAMESPACE_PBORI
/// Forward declaration of friend
template <class ValueType>
class CWeakPtr;
/** @class CWeakPtrFacade
* @brief This class defines CWeakPtrFacade.
*
* It should be the inheritance base for all classes supporting @c CWeakPtr.
**/
template <class ValueType>
class CWeakPtrFacade {
/// Type of *this
typedef CWeakPtrFacade self;
public:
typedef ValueType value_type;
typedef value_type* data_type;
typedef std::shared_ptr<data_type> ptr_type;
friend class CWeakPtr<value_type>;
/// Default constructor (only data is the pointer to here)
CWeakPtrFacade():
m_data(new data_type(static_cast<data_type>(this))) {}
/// Copy constructor (constructs new facade)
CWeakPtrFacade(const self& rhs):
m_data(new data_type(static_cast<data_type>(this))) {}
/// Destructor (invalidates pointer to here)
~CWeakPtrFacade() { (*m_data) = NULL; }
protected:
ptr_type m_data;
};
END_NAMESPACE_PBORI
#endif /* polybori_CWeakPtrFacade_h_ */
|