| The Gaudi Framework v28r2-patches (bc4ad17a)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Protected Attributes | List of all members
merge_job< T > Class Template Reference

## Public Member Functions
| merge_job (boost::shared_array< T > data, unsigned int position, unsigned int length)
void | run ()

## Protected Attributes
boost::shared_array< T > | m_data
unsigned int | m_position
unsigned int | m_length

## Detailed Description

### template<class T>
class merge_job< T >

Definition at line 85 of file mergesort.cpp.

## Constructor & Destructor Documentation

template<class T >

merge_job< T >::merge_job | ( | boost::shared_array< T > | data,
|  | unsigned int | position,
|  | unsigned int | length
| ) |  |
| inline

Definition at line 88 of file mergesort.cpp.

89 : m_data(data)
90 , m_position(position)
91 , m_length(length)
92 {
93 print("merge job created : " + to_string(m_position) +", "+ to_string(m_length) +"\n");
94 }
merge_job::m_position
unsigned int m_position
Definition: mergesort.cpp:116
to_string
string to_string(const T &value)
Definition: mergesort.cpp:40
merge_job::m_length
unsigned int m_length
Definition: mergesort.cpp:117
merge_job::m_data
boost::shared_array< T > m_data
Definition: mergesort.cpp:115
print
void print(string text)
Definition: mergesort.cpp:33

## Member Function Documentation

template<class T >

void merge_job< T >::run | ( |  | ) |
| inline

Definition at line 96 of file mergesort.cpp.

97 {
98 print("merge job running : " + to_string(m_position) +", "+ to_string(m_length) +"\n");
99
100 T* begin = m_data.get();
101 std::advance(begin, m_position);
102
103 T* mid = m_data.get();
104 std::advance(mid, m_position + m_length/2);
105
106 T* end = m_data.get();
107 std::advance(end, m_position + m_length);
108
109 std::inplace_merge(begin, mid, end);
110
111 print("\nmerge job finished: " + to_string(m_position) +", "+ to_string(m_length) +"\n");
112 }
merge_job::m_position
unsigned int m_position
Definition: mergesort.cpp:116
to_string
string to_string(const T &value)
Definition: mergesort.cpp:40
std::inplace_merge
T inplace_merge(T...args)
merge_job::m_length
unsigned int m_length
Definition: mergesort.cpp:117
std::advance
T advance(T...args)
begin
auto begin(reverse_wrapper< T > &w)
Definition: reverse.h:48
merge_job::m_data
boost::shared_array< T > m_data
Definition: mergesort.cpp:115
end
auto end(reverse_wrapper< T > &w)
Definition: reverse.h:50
print
void print(string text)
Definition: mergesort.cpp:33

## Member Data Documentation

template<class T >

boost::shared_array<T> merge_job< T >::m_data
| protected

Definition at line 115 of file mergesort.cpp.

template<class T >

unsigned int merge_job< T >::m_length
| protected

Definition at line 117 of file mergesort.cpp.

template<class T >

unsigned int merge_job< T >::m_position
| protected

Definition at line 116 of file mergesort.cpp.

The documentation for this class was generated from the following file:

- GaudiMTTools/src/threadpool/libs/threadpool/example/mergesort/mergesort.cpp