Line data Source code
1 : //
2 : // Author: Vladimir Migashko <migashko@gmail.com>, (C) 2012
3 : //
4 : // Copyright: See COPYING file that comes with this distribution
5 : //
6 :
7 : #ifndef VSET_VSET_BUFFER_PERSISTENT_FILE_AD_HEAD_HPP
8 : #define VSET_VSET_BUFFER_PERSISTENT_FILE_AD_HEAD_HPP
9 :
10 : #include <vset/buffer/tags.hpp>
11 : #include <vset/buffer/persistent/tags.hpp>
12 :
13 : namespace vset { namespace buffer { namespace persistent{ namespace file{
14 :
15 12 : struct ad_head
16 : {
17 : template<typename T>
18 : const typename T::aspect::template advice_cast<_head_type_>::type*
19 2322555 : operator()( T& t ) const
20 : {
21 : typedef typename T::aspect::template advice_cast<_head_type_>::type head_type;
22 2322555 : return reinterpret_cast<const head_type*>( t.get_aspect().template get<_buffer_>() );
23 : }
24 :
25 : template<typename T>
26 : typename T::aspect::template advice_cast<_head_type_>::type*
27 523695 : operator()( T& t )
28 : {
29 : typedef typename T::aspect::template advice_cast<_head_type_>::type head_type;
30 523695 : return reinterpret_cast<head_type*>(t.get_aspect().template get<_buffer_>());
31 : }
32 :
33 : };
34 :
35 : }}}}
36 :
37 : #endif
|