/usr/include/assa-3.5/assa/Destroyer.h is in libassa-3.5-5-dev 3.5.1-6build1.
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 | // -*- c++ -*-
//------------------------------------------------------------------------------
// Destroyer.h
//------------------------------------------------------------------------------
// Copyright (C) 1997-2002 Vladislav Grinchenko
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//------------------------------------------------------------------------------
#ifndef _Destroyer_h
#define _Destroyer_h
namespace ASSA {
/** @file Destroyer.h
Destroyer is the helper class for class Singleton.
@see Singleton
*/
template <class T>
class Destroyer
{
public:
/** Constructor.
@param d_ pointer to the object to guard.
*/
Destroyer(T* d_=0) : m_otg (d_) { /* empty */ }
/* Destructor - deletes object T it owns.
*/
~Destroyer() {
if ( m_otg ) {
delete m_otg;
}
}
/** Transfer ownership of object T to Destroyer class.
@param d_ - object T to guard
*/
void setGuard(T* d_) {
m_otg = d_;
}
private:
Destroyer(const Destroyer<T>&);
Destroyer<T>& operator=(const Destroyer<T>&);
private:
/// Object T to guard
T* m_otg;
};
} // end namespace ASSA
#endif
|