CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
edm::serviceregistry::BlockingWrapper< Func > Class Template Reference

#include <connect_but_block_self.h>

Public Member Functions

 BlockingWrapper (Func iFunc)
 
template<typename... Args>
void operator() (Args &&... args)
 

Private Member Functions

bool startBlocking ()
 
void unblock ()
 

Private Attributes

Func func_
 
int numBlocks_
 

Detailed Description

template<typename Func>
class edm::serviceregistry::BlockingWrapper< Func >

Definition at line 32 of file connect_but_block_self.h.

Constructor & Destructor Documentation

◆ BlockingWrapper()

template<typename Func >
edm::serviceregistry::BlockingWrapper< Func >::BlockingWrapper ( Func  iFunc)
inline

Definition at line 34 of file connect_but_block_self.h.

34 : func_(iFunc), numBlocks_(0) {}

Member Function Documentation

◆ operator()()

template<typename Func >
template<typename... Args>
void edm::serviceregistry::BlockingWrapper< Func >::operator() ( Args &&...  args)
inline

Definition at line 39 of file connect_but_block_self.h.

39  {
40  std::shared_ptr<void> guard(static_cast<void*>(nullptr), std::bind(&BlockingWrapper::unblock, this));
41  if (startBlocking()) {
42  func_(std::forward<Args>(args)...);
43  }
44  }

References writedatasetfile::args, edm::serviceregistry::BlockingWrapper< Func >::func_, edm::serviceregistry::BlockingWrapper< Func >::startBlocking(), and edm::serviceregistry::BlockingWrapper< Func >::unblock().

◆ startBlocking()

template<typename Func >
bool edm::serviceregistry::BlockingWrapper< Func >::startBlocking ( )
inlineprivate

◆ unblock()

template<typename Func >
void edm::serviceregistry::BlockingWrapper< Func >::unblock ( )
inlineprivate

Member Data Documentation

◆ func_

template<typename Func >
Func edm::serviceregistry::BlockingWrapper< Func >::func_
private

◆ numBlocks_

template<typename Func >
int edm::serviceregistry::BlockingWrapper< Func >::numBlocks_
private
writedatasetfile.args
args
Definition: writedatasetfile.py:18
edm::serviceregistry::BlockingWrapper::numBlocks_
int numBlocks_
Definition: connect_but_block_self.h:55
edm::serviceregistry::BlockingWrapper::func_
Func func_
Definition: connect_but_block_self.h:54
edm::serviceregistry::BlockingWrapper::unblock
void unblock()
Definition: connect_but_block_self.h:53
edm::serviceregistry::BlockingWrapper::startBlocking
bool startBlocking()
Definition: connect_but_block_self.h:52