TrueReality  v0.1.1912
ObsrvrPtr.h
Go to the documentation of this file.
1 /*
2 * True Reality Open Source Game and Simulation Engine
3 * Copyright © 2021 Acid Rain Studios LLC
4 *
5 * This library is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU Lesser General Public License as published by the Free
7 * Software Foundation; either version 3.0 of the License, or (at your option)
8 * any later version.
9 *
10 * This library is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13 * details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this library; if not, write to the Free Software Foundation, Inc.,
17 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * @author Maxim Serebrennik
20 */
21 
22 #pragma once
23 
24 #include <osg/observer_ptr>
25 
26 #include <iostream>
27 
28 namespace trBase
29 {
34  template <class T>
35  class ObsrvrPtr : public osg::observer_ptr<T>
36  {
37  public:
38  ObsrvrPtr() : osg::observer_ptr<T>()
39  {}
40 
41  ObsrvrPtr(T* t) : osg::observer_ptr<T>(t)
42  {}
43 
44  ObsrvrPtr(const osg::observer_ptr<T>& rp) : osg::observer_ptr<T>(rp)
45  {}
46 
50  friend inline std::ostream& operator<<(std::ostream& os, const ObsrvrPtr& rp)
51  {
52  os << rp.get();
53  return os;
54  }
55  };
56 }
friend std::ostream & operator<<(std::ostream &os, const ObsrvrPtr &rp)
Prints out the memory address of the held pointer.
Definition: ObsrvrPtr.h:50
An Observer Pointer.
Definition: ObsrvrPtr.h:35
ObsrvrPtr(const osg::observer_ptr< T > &rp)
Definition: ObsrvrPtr.h:44
Definition: FrameStamp.h:37