20 #ifndef __TPIE_PIPELINING_STORE_H__
21 #define __TPIE_PIPELINING_STORE_H__
29 template <
typename pred_t,
typename specific_store_t>
32 typedef typename specific_store_t::store_type store_type;
35 typedef store_type first_argument_type;
36 typedef store_type second_argument_type;
37 typedef bool result_type;
41 bool operator()(
const store_type & lhs,
const store_type & rhs)
const {
43 specific_store_t::store_as_element(lhs),
44 specific_store_t::store_as_element(rhs));
47 bool operator()(
const store_type & lhs,
const store_type & rhs) {
49 specific_store_t::store_as_element(lhs),
50 specific_store_t::store_as_element(rhs));
61 template <
typename outer_t>
66 template <
typename element_t>
69 typedef element_t element_type;
71 typedef element_t store_type;
73 typedef element_t outer_type;
75 static const size_t item_size =
sizeof(element_t);
77 element_type store_to_element(
const store_type & e) {
return e;}
78 store_type element_to_store(
const element_type & e) {
return e;}
79 static const element_type & store_as_element(
const store_type & e) {
return e;}
80 store_type outer_to_store(
const outer_type & e) {
return e;}
81 outer_type store_to_outer(
const store_type & e) {
return e;}
84 template <
typename element_t>
98 template <
typename outer_t>
100 typedef typename bits::remove_pointer<outer_t>::type type;
103 template <
typename element_t>
105 typedef element_t element_type;
106 typedef element_t * store_type;
107 typedef element_t * outer_type;
109 static const size_t item_size =
sizeof(element_t) +
sizeof(store_type);
111 element_type store_to_element(
const store_type e) {
116 store_type element_to_store(
const element_type & e) {
return tpie_new<element_type>(e);}
117 static const element_type & store_as_element(
const store_type e) {
return *e;}
118 store_type outer_to_store(
const outer_type & e) {
return e;}
119 outer_type store_to_outer(
const store_type & e) {
return e;}
122 template <
typename element_t>
132 template <
typename outer_t>
134 typedef typename outer_t::element_type type;
137 template <
typename element_t>
139 typedef element_t element_type;
143 static const size_t item_size =
sizeof(element_t) +
sizeof(store_type);
145 element_type store_to_element(store_type e) {
148 store_type element_to_store(
const element_type & e) {
149 return outer_type(tpie_new<element_type>(e));
151 static const element_type & store_as_element(
const store_type & e) {
return *e;}
152 store_type outer_to_store(outer_type e) {
return std::move(e);}
153 outer_type store_to_outer(store_type e) {
return std::move(e);}
156 template <
typename element_t>
167 template <
typename outer_t>
169 typedef outer_t type;
172 template <
typename element_t>
174 typedef element_t element_type;
175 typedef element_t * store_type;
176 typedef element_t outer_type;
178 static const size_t item_size =
sizeof(element_t) +
sizeof(store_type);
180 element_type store_to_element(
const store_type e) {
185 store_type element_to_store(
const element_type & e) {
return tpie_new<element_type>(e);}
186 static const element_type & store_as_element(
const store_type e) {
return *e;}
187 store_type outer_to_store(
const outer_type & e) {
return tpie_new<element_type>(e);}
188 outer_type store_to_outer(
const store_type & e) {
195 template <
typename element_t>
201 template <
typename element_t,
bool = (sizeof(element_t) > 256)>
204 template <
typename element_t>
219 template <
typename outer_t>
221 typedef outer_t type;
224 template <
typename element_t>
227 template <
typename element_t>
232 typedef dynamic_store default_store;
236 #endif //__TPIE_PIPELINING_SPECIFIC_POINTER_H__
Memory management subsystem.
Sort elements in tpie pointers.
std::unique_ptr< T, tpie_deleter > unique_ptr
like std::unique_ptr, but delete the object with tpie_delete.
void tpie_delete(T *p)
Delete an object allocated with tpie_new.
Fantastic store strategy.
Sort elements in tpie unique pointers.
Sort elements using pointer indirection.