This file is indexed.

/usr/include/assa-3.5/assa/AutoPtr.h is in libassa3.5-5-dev 3.5.1-4.

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
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
// -*- c++ -*-
//------------------------------------------------------------------------------
//                               AutoPtr.h
//------------------------------------------------------------------------------
//  Copyright (C) 1999,2005  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 AUTO_PTR_H
#define AUTO_PTR_H

#include <cstdlib>				// NULL definition

/** @file AutoPtr.h 

   AutoPtr is a local implementation of STL's auto_ptr that makes dynamic
   memory handling a bit easier.
*/

namespace ASSA {

/**
 * @class AutoPtrRef
 *
 * A wrapper class to provide AutoPtr with reference semantics.
 * An AutoPtr can be assigned (or constructed from) the result of 
 * a function which returns an AutoPtr by value (rvalue).
 */
template<typename R> class AutoPtrRef {
public:
	explicit AutoPtrRef (R* p_) : m_ptr (p_) { /* no-op */ }
	
	R* m_ptr;
};
 
/** 
	@class AutoPtr

	AutoPtr is based on SGI implementation of a auto_ptr template that 
	makes memory handling a little bit easier.

	AutoPtr interface does not completely confirm to that of auto_ptr as 
	specified in C++ Standard. 
*/

template<class X> class AutoPtr {
private:
    /// Pointer to the object we own
    X* m_ptr;

public:
    /** 
	 *  Construct an AutoPtr from a raw pointer.
	 *  The word 'explicit' disallows implicit construction of objects, 
	 *  for example in function  calls. 
	 *  @param p_ pointer (defaults to NULL) to assume ownerwhip for.
     */
    explicit AutoPtr (X* p_ = 0) : m_ptr (p_) { /* no-op */ }

    /** 
	 *  Construct AutoPtr from another AutoPtr.
	 *  @param a_ AutoPtr object that gives up its ownership.
     */
    AutoPtr (AutoPtr& a_) : m_ptr (a_.release ()) {/* no-op */ }

    /** 
	 *  Construct AutoPtr from another AutoPtr of different (but related)
	 *  type. A pointer to T must be convertible to a pointer to X.
	 *  @note Nonconstant parameter
	 *  @param a_ AutoPtr object that is released of ownership.
     */
	template<typename T> 
	AutoPtr (AutoPtr<T>& a_) : m_ptr (a_.release ()) { /* no-op */ }

    /** 
	 *  Assignment operator deletes memory it owns 
     *  and transfers the ownership from a_ to itself.
     *  @param a_ another AutoPtr of the same type.
     */
    AutoPtr& operator= (AutoPtr& a_)  {
		reset (a_.release ());
		return *this;
    }

    /** 
	 *  Assignment from another AutoPtr of a different but related type.
	 *  @note Nonconstant parameter
     *  @param a_ AutoPtr to assume ownership of
     */
    template<class T> AutoPtr& operator=(AutoPtr<T>& a_) {
		reset (a_.release ());
		return *this;
	}

    /** 
     *  When AutoPtr goes out of scope, the object it owns is deleted.
	 *  Not owning anything has no effect.
     */
    ~AutoPtr () { 
		if (m_ptr) { 
			delete m_ptr; 
		}  
	}
    
	/**
	 * Smart pointer dereferencing.
	 */
    X& operator*() const  { return *m_ptr; }

	/**
	 * Smart pointer dereferencing.
	 */
    X* operator->() const  { return m_ptr; }
	
    /** 
	 *  Get a raw memory pointer without changing ownership status. 
     *  Usefull when you need to pass a pointer to the function.
	 *  @return The raw pointer being managed.
     */
    X* get () const { return m_ptr; }

	/**
	 *  Give up the ownership of the memory. When AutoPtr gets
	 *  out of scope, nothing happens. The caller becomes responsible
	 *  for the memory management.
	 */
	X* release () {
		X* tmp = m_ptr;
		m_ptr = NULL;
		return tmp;
	}
	
    /** 
     *  Forcibly delete the managed object and assume the ownership
	 *  of a_.
     */
	void reset (X* p_ = 0) {
		if (p_ != m_ptr) {
			delete m_ptr;
			m_ptr = p_;
		}
	}

	/** @{
	 *  @brief Automagic conversions
	 *
	 *  These operations convert an AutoPtr into/from an AutoPtrRef
	 *  as needed. This allows on-the-fly conversion between AutoPtr 
	 *  of different but related types (parent/child):
	 *  @code
	 *     AutoPtr<Derived> FooReturnsAutoPtr () { ... };
	 *
	 *     AutoPtr<Base> aptr = FooReturnsAutoPtr ();
	 *  @endcode
	 */
	AutoPtr (AutoPtrRef<X> ref_) : m_ptr (ref_.m_ptr) { /* no-op */ }

	AutoPtr& operator=(AutoPtrRef<X> ref_) {
		if (ref_.m_ptr != get ()) {
			delete m_ptr;
			m_ptr = ref_.m_ptr;
		}
		return *this;
	}
	
	template<typename T>
	operator AutoPtrRef<T> () { return AutoPtrRef<T> (release ()); }

	template<typename T>
	operator AutoPtr<T> () { return AutoPtr<T> (release ()); }
	
	/** @} */
};

/**
 * @class AutoPtrArrayRef
 *
 * A wrapper class to provide AutoPtr with reference semantics.
 * An AutoPtr can be assigned (or constructed from) the result of 
 * a function which returns an AutoPtr by value (rvalue).
 */
template<typename R> class AutoPtrArrayRef {
public:
	explicit AutoPtrArrayRef (R* p_) : m_ptr (p_) { /* no-op */ }
	
	R* m_ptr;
};

/** 
	@class AutoPtrArray

	@brief AutoPtrArray handles memory management of an array of objects.
*/

template<class X> class AutoPtrArray {
private:
    /// Pointer to the object we own
    X* m_ptr;

public:
    /** 
	 *  Construct an AutoPtrArray from a raw pointer.
	 *  The word 'explicit' disallows implicit construction of objects, 
	 *  for example in function  calls. 
	 *  @param p_ pointer (defaults to NULL) to assume ownerwhip for.
     */
    explicit AutoPtrArray (X* p_ = 0) : m_ptr (p_) { /* no-op */ }

    /** 
	 *  Construct AutoPtrArray from another AutoPtrArray.
	 *  @param a_ AutoPtrArray object that gives up its ownership.
     */
    AutoPtrArray (AutoPtrArray& a_) : m_ptr (a_.release ()) {/* no-op */ }

    /** 
	 *  Construct AutoPtrArray from another AutoPtrArray of different 
	 *  (but related) type. A pointer to T must be convertible to a 
	 *  pointer to X.
	 *  @note Nonconstant paramenter
	 *  @param a_ AutoPtrArray object that is released of ownership.
     */
	template<typename T> 
	AutoPtrArray (AutoPtrArray<T>& a_) 
		: m_ptr (a_.release ()) { /* no-op */ }

    /** 
	 *  Assignment operator deletes memory it owns 
     *  and transfers the ownership from a_ to itself.
	 *  @note Nonconstant parameter
     *  @param a_ another AutoPtrArray of the same type.
     */
    AutoPtrArray& operator= (AutoPtrArray& a_)  {
		reset (a_.release ());
		return *this;
    }

    /** 
	 *  Assignment from another AutoPtrArray of a different but related type.
	 *  @note Nonconstant parameter
     *  @param a_ AutoPtrArray to assume ownership of
     */
    template<class T> 
	AutoPtrArray& operator=(AutoPtrArray<T>& a_) {
		reset (a_.release ());
		return *this;
	}

    /** 
     *  When AutoPtrArray goes out of scope, the object it owns is deleted.
	 *  Not owning anything has no effect.
     */
    ~AutoPtrArray () { 
		if (m_ptr) { 
			delete [] m_ptr; 
		}  
	}
    
	/**
	 * Smart pointer dereferencing.
	 */
    X& operator*() const  { return *m_ptr; }

	/**
	 * Smart pointer dereferencing.
	 */
    X* operator->() const  { return m_ptr; }

	/** 
	 *  Access operator
	 */
	X& operator[] (int i) const {
		X* array = get ();
		return (array [i]);
	}
	
    /** 
	 *  Get a raw memory pointer without changing ownership status. 
     *  Usefull when you need to pass a pointer to the function.
	 *  @return The raw pointer being managed.
     */
    X* get () const  { return m_ptr; }

	/**
	 *  Give up the ownership of the memory. When AutoPtrArray gets
	 *  out of scope, nothing happens. The caller becomes responsible
	 *  for the memory management.
	 */
	X* release () {
		X* tmp = m_ptr;
		m_ptr = NULL;
		return tmp;
	}
	
    /** 
     *  Forcibly delete the managed object and assume the ownership
	 *  of a_.
     */
	void reset (X* p_ = 0) {
		if (p_ != m_ptr) {
			delete [] m_ptr;
			m_ptr = p_;
		}
	}

	/** @{
	 *  @brief Automagic conversions
	 *
	 *  These operations convert an AutoPtrArray into/from an AutoPtrArrayRef
	 *  as needed. This allows on-the-fly conversion between AutoPtrArray 
	 *  of different but related types (parent/child):
	 *  @code
	 *     AutoPtrArray<Derived> FooReturnsAutoPtrArray () { ... };
	 *
	 *     AutoPtrArray<Base> aptr = FooReturnsAutoPtrArray ();
	 *  @endcode
	 */
	AutoPtrArray (AutoPtrArrayRef<X> ref_) : m_ptr (ref_.m_ptr) { /* no-op */ }

	AutoPtrArray& operator=(AutoPtrArrayRef<X> ref_) {
		if (ref_.m_ptr != get ()) {
			delete [] m_ptr;
			m_ptr = ref_.m_ptr;
		}
		return *this;
	}
	
	template<typename T>
	operator AutoPtrArrayRef<T> () { return AutoPtrArrayRef<T> (release ()); }

	template<typename T>
	operator AutoPtrArray<T> () { return AutoPtrArray<T> (release ()); }
	
	/** @} */
};

} // end namespace ASSA

#endif /* AUTO_PTR_H */