Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Data Structures | Functions
G4HadTmpUtil.hh File Reference
#include "globals.hh"
#include <vector>
#include <algorithm>

Go to the source code of this file.

Data Structures

class  G4SortHelperPtr< A >
 
struct  G4Delete
 

Functions

G4String G4inttostring (int ai)
 
template<class A >
void G4PtrSort (std::vector< A * > *aList)
 

Function Documentation

G4String G4inttostring ( int  ai)

Definition at line 29 of file G4HadTmpUtil.cc.

30 {
31  std::ostringstream ost;
32  ost << ai;
33  G4String result = ost.str();
34  return result;
35 }
template<class A >
void G4PtrSort ( std::vector< A * > *  aList)

Definition at line 47 of file G4HadTmpUtil.hh.

References sort().

48 {
49  std::vector<G4SortHelperPtr<A> > helper;
50  for(size_t i=0; i<aList->size(); i++) helper.push_back(aList->operator[](i));
51  std::sort(helper.begin(), helper.end());
52  for(size_t j=0; j<helper.size(); j++) aList->operator[](j)=&(*helper[j]);
53 }
subroutine sort(A, N)
Definition: dpm25nuc7.f:4670