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_FILESYNC_AD_CLOSE_HPP
8 : #define VSET_VSET_BUFFER_PERSISTENT_FILESYNC_AD_CLOSE_HPP
9 :
10 : #include <vset/buffer/tags.hpp>
11 : #include <vset/buffer/persistent/tags.hpp>
12 : #include <fas/system/nullptr.hpp>
13 :
14 : namespace vset { namespace buffer { namespace persistent{ namespace filesync{
15 :
16 3 : struct ad_close
17 : {
18 : template<typename T>
19 20 : void operator()( T& t)
20 : {
21 20 : t.get_aspect().template get<_close_file_>()(t);
22 20 : delete[] t.get_aspect().template get<_buffer_>();
23 20 : t.get_aspect().template get<_buffer_>() = fas_nullptr;
24 20 : t.get_aspect().template get<_buffer_size_>() = 0;
25 20 : t.get_aspect().template get<_size_value_>() = 0;
26 20 : t.get_aspect().template get<_capacity_value_>() = 0;
27 20 : t.get_aspect().template get<_file_name_>().clear();
28 :
29 20 : }
30 : };
31 :
32 : }}}}
33 :
34 : #endif
|