29 #ifndef INCLUDED_MDDS_MULTI_TYPE_VECTOR_DIR_CUSTOM_FUNC1_HPP
30 #define INCLUDED_MDDS_MULTI_TYPE_VECTOR_DIR_CUSTOM_FUNC1_HPP
35 namespace mdds {
namespace mtv {
40 template<
typename _Block>
47 case _Block::block_type:
48 return _Block::create_block(init_size);
53 return element_block_func::create_new_block(type, init_size);
58 switch (get_block_type(block))
60 case _Block::block_type:
61 return _Block::clone_block(block);
66 return element_block_func::clone_block(block);
74 switch (get_block_type(*p))
76 case _Block::block_type:
77 _Block::delete_block(p);
80 element_block_func::delete_block(p);
86 switch (get_block_type(block))
88 case _Block::block_type:
89 _Block::resize_block(block, new_size);
92 element_block_func::resize_block(block, new_size);
98 switch (get_block_type(block))
100 case _Block::block_type:
101 _Block::print_block(block);
104 element_block_func::print_block(block);
110 switch (get_block_type(block))
112 case _Block::block_type:
113 _Block::erase_block(block, pos);
116 element_block_func::erase(block, pos);
122 switch (get_block_type(block))
124 case _Block::block_type:
125 _Block::erase_block(block, pos, size);
128 element_block_func_base::erase(block, pos, size);
134 switch (get_block_type(dest))
136 case _Block::block_type:
137 _Block::append_values_from_block(dest, src);
140 element_block_func_base::append_values_from_block(dest, src);
144 static void append_values_from_block(
147 switch (get_block_type(dest))
149 case _Block::block_type:
150 _Block::append_values_from_block(dest, src, begin_pos, len);
153 element_block_func_base::append_values_from_block(dest, src, begin_pos, len);
157 static void assign_values_from_block(
160 switch (get_block_type(dest))
162 case _Block::block_type:
163 _Block::assign_values_from_block(dest, src, begin_pos, len);
166 element_block_func_base::assign_values_from_block(dest, src, begin_pos, len);
170 static void prepend_values_from_block(
173 switch (get_block_type(dest))
175 case _Block::block_type:
176 _Block::prepend_values_from_block(dest, src, begin_pos, len);
179 element_block_func_base::prepend_values_from_block(dest, src, begin_pos, len);
183 static void swap_values(
186 switch (get_block_type(blk1))
188 case _Block::block_type:
189 _Block::swap_values(blk1, blk2, pos1, pos2, len);
192 element_block_func_base::swap_values(blk1, blk2, pos1, pos2, len);
196 static bool equal_block(
199 if (get_block_type(left) == _Block::block_type)
201 if (get_block_type(right) != _Block::block_type)
204 return _Block::get(left) == _Block::get(right);
206 else if (mtv::get_block_type(right) == _Block::block_type)
209 return element_block_func::equal_block(left, right);
214 switch (get_block_type(block))
216 case _Block::block_type:
217 _Block::overwrite_values(block, pos, len);
226 switch (get_block_type(block))
228 case _Block::block_type:
229 _Block::shrink_to_fit(block);
232 element_block_func::shrink_to_fit(block);
238 switch (get_block_type(block))
240 case _Block::block_type:
241 return _Block::size(block);
243 return element_block_func::size(block);
Definition: types.hpp:113
Definition: custom_func1.hpp:42
static void overwrite_values(base_element_block &block, size_t pos, size_t len)
Definition: trait.hpp:660