CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
ThreadSafeStringCut< F, T > Class Template Reference

#include <ThreadSafeStringCut.h>

Public Member Functions

std::result_of< F &(T)>::type operator() (const T &t) const
 
 ThreadSafeStringCut (const std::string &expr)
 
 ThreadSafeStringCut (ThreadSafeStringCut &&other)
 

Private Attributes

const std::string expr_
 
const F func_
 
std::mutex mutex_
 

Detailed Description

template<class F, class T>
class ThreadSafeStringCut< F, T >

Definition at line 17 of file ThreadSafeStringCut.h.

Constructor & Destructor Documentation

template<class F , class T >
ThreadSafeStringCut< F, T >::ThreadSafeStringCut ( const std::string &  expr)
inline

Definition at line 21 of file ThreadSafeStringCut.h.

22  : func_(expr)
23  , expr_(expr)
24  {}
const std::string expr_
template<class F , class T >
ThreadSafeStringCut< F, T >::ThreadSafeStringCut ( ThreadSafeStringCut< F, T > &&  other)
inline

Definition at line 26 of file ThreadSafeStringCut.h.

27  : func_(std::move(other.func_))
28  , expr_(std::move(other.expr_))
29  {}
const std::string expr_
def move(src, dest)
Definition: eostools.py:511

Member Function Documentation

template<class F , class T >
std::result_of<F&(T)>::type ThreadSafeStringCut< F, T >::operator() ( const T t) const
inline

Definition at line 31 of file ThreadSafeStringCut.h.

References ThreadSafeStringCut< F, T >::func_, and ThreadSafeStringCut< F, T >::mutex_.

32  {
33  std::lock_guard<std::mutex> guard(mutex_);
34  return func_(t);
35  }

Member Data Documentation

template<class F , class T >
const std::string ThreadSafeStringCut< F, T >::expr_
private

Definition at line 40 of file ThreadSafeStringCut.h.

template<class F , class T >
const F ThreadSafeStringCut< F, T >::func_
private

Definition at line 39 of file ThreadSafeStringCut.h.

Referenced by ThreadSafeStringCut< F, T >::operator()().

template<class F , class T >
std::mutex ThreadSafeStringCut< F, T >::mutex_
mutableprivate

Definition at line 41 of file ThreadSafeStringCut.h.

Referenced by ThreadSafeStringCut< F, T >::operator()().