OSVR-Core
BufferTraits.h
Go to the documentation of this file.
1 
11 // Copyright 2015 Sensics, Inc.
12 //
13 // Licensed under the Apache License, Version 2.0 (the "License");
14 // you may not use this file except in compliance with the License.
15 // You may obtain a copy of the License at
16 //
17 // http://www.apache.org/licenses/LICENSE-2.0
18 //
19 // Unless required by applicable law or agreed to in writing, software
20 // distributed under the License is distributed on an "AS IS" BASIS,
21 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 // See the License for the specific language governing permissions and
23 // limitations under the License.
24 
25 #ifndef INCLUDED_BufferTraits_h_GUID_83FE7C11_8192_409F_7D69_FDBC57B88581
26 #define INCLUDED_BufferTraits_h_GUID_83FE7C11_8192_409F_7D69_FDBC57B88581
27 
28 // Internal Includes
29 #include <osvr/Common/Buffer_fwd.h>
30 
31 // Library/third-party includes
32 #include <boost/type_traits/is_convertible.hpp>
33 
34 // Standard includes
35 // - none
36 
37 namespace osvr {
38 namespace common {
39  namespace detail {
43  public:
44  template <typename ContainerType>
46  };
47 
51  public:
52  template <typename ContainerType>
54  };
55  }
56 
58  template <typename T>
59  struct is_buffer : boost::is_convertible<T, detail::BufferTypeChecker> {};
60 
62  template <typename T>
64  : boost::is_convertible<T, detail::BufferReaderTypeChecker> {};
65 
66 } // namespace common
67 } // namespace osvr
68 #endif // INCLUDED_BufferTraits_h_GUID_83FE7C11_8192_409F_7D69_FDBC57B88581
Handles spatial transformations.
Definition: SerializationTraitExample_Complicated.h:40
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
Header.
Definition: newuoa.h:1888
A buffer of bytes, built on a byte-vector-like container.
Definition: Buffer.h:206
Serves to provide conversion operators for things that work like BufferReaders to assist with traits/...
Definition: BufferTraits.h:50
Type trait: is the given type a buffer?
Definition: BufferTraits.h:59
Provides for a single reading pass over a buffer.
Definition: Buffer.h:117
Serves to provide conversion operators for things that work like Buffers to assist with traits/static...
Definition: BufferTraits.h:42
Type trait: is the given type a buffer reader?
Definition: BufferTraits.h:63