OSVR-Core
ResetPointerList.h
Go to the documentation of this file.
1 
12 // Copyright 2014 Sensics, Inc.
13 //
14 // Licensed under the Apache License, Version 2.0 (the "License");
15 // you may not use this file except in compliance with the License.
16 // You may obtain a copy of the License at
17 //
18 // http://www.apache.org/licenses/LICENSE-2.0
19 //
20 // Unless required by applicable law or agreed to in writing, software
21 // distributed under the License is distributed on an "AS IS" BASIS,
22 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23 // See the License for the specific language governing permissions and
24 // limitations under the License.
25 
26 #ifndef INCLUDED_ResetPointerList_h_GUID_067DF9C9_67F7_4293_94EF_DBC5B5266801
27 #define INCLUDED_ResetPointerList_h_GUID_067DF9C9_67F7_4293_94EF_DBC5B5266801
28 
29 // Internal Includes
30 // - none
31 
32 // Library/third-party includes
33 // - none
34 
35 // Standard includes
36 // - none
37 
38 namespace osvr {
39 namespace util {
40 
42  template <typename RangeType>
43  inline void resetPointerRange(RangeType range) {
44  typedef typename RangeType::type IteratorType;
45  typedef typename IteratorType::value_type PointerType;
46  for (auto &ptr : range) {
47  ptr.reset();
48  }
49  }
50 } // namespace util
51 } // namespace osvr
52 
53 #endif // INCLUDED_ResetPointerList_h_GUID_067DF9C9_67F7_4293_94EF_DBC5B5266801
Definition: RunLoopManager.h:42
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
void resetPointerRange(RangeType range)
Reset every smart pointer in a container one by one.
Definition: ResetPointerList.h:43