| The Gaudi Framework v30r0 (c919700c)

- 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 78 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 81 of file mergesort.cpp.

82 : m_data( data ), m_position( position ), m_length( length )
83 {
84 print( "merge job created : " + to_string( m_position ) + ", " + to_string( m_length ) + "\n" );
85 }
merge_job::m_position
unsigned int m_position
Definition: mergesort.cpp:107
to_string
string to_string(const T &value)
Definition: mergesort.cpp:37
merge_job::m_length
unsigned int m_length
Definition: mergesort.cpp:108
merge_job::m_data
boost::shared_array< T > m_data
Definition: mergesort.cpp:106
print
void print(string text)
Definition: mergesort.cpp:30

## Member Function Documentation

template<class T >

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

Definition at line 87 of file mergesort.cpp.

88 {
89 print( "merge job running : " + to_string( m_position ) + ", " + to_string( m_length ) + "\n" );
90
91 T* begin = m_data.get();
92 std::advance( begin, m_position );
93
94 T* mid = m_data.get();
95 std::advance( mid, m_position + m_length / 2 );
96
97 T* end = m_data.get();
98 std::advance( end, m_position + m_length );
99
100 std::inplace_merge( begin, mid, end );
101
102 print( "\nmerge job finished: " + to_string( m_position ) + ", " + to_string( m_length ) + "\n" );
103 }
merge_job::m_position
unsigned int m_position
Definition: mergesort.cpp:107
to_string
string to_string(const T &value)
Definition: mergesort.cpp:37
std::inplace_merge
T inplace_merge(T...args)
merge_job::m_length
unsigned int m_length
Definition: mergesort.cpp:108
std::advance
T advance(T...args)
begin
auto begin(reverse_wrapper< T > &w)
Definition: reverse.h:58
merge_job::m_data
boost::shared_array< T > m_data
Definition: mergesort.cpp:106
end
auto end(reverse_wrapper< T > &w)
Definition: reverse.h:64
print
void print(string text)
Definition: mergesort.cpp:30

## Member Data Documentation

template<class T >

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

Definition at line 106 of file mergesort.cpp.

template<class T >

unsigned int merge_job< T >::m_length
| protected

Definition at line 108 of file mergesort.cpp.

template<class T >

unsigned int merge_job< T >::m_position
| protected

Definition at line 107 of file mergesort.cpp.

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

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