ATLAS Offline Software
Loading...
Searching...
No Matches
TSMethodCall.h
Go to the documentation of this file.
1// This file's extension implies that it's C, but it's really -*- C++ -*-.
2
3/*
4 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
5*/
6
13
14
15#ifndef ROOTUTILS_TSMETHODCALL_H
16#define ROOTUTILS_TSMETHODCALL_H
17
18
19#include "TClass.h"
20#include "TMethodCall.h"
21#include "boost/thread/tss.hpp"
22#include <atomic>
23#include <mutex>
24
25
26namespace RootUtils {
27
28
33{
34public:
37
38 // Copy constructor.
39 TSMethodCall (const TSMethodCall& other);
40
41 // Assignment.
43
44 // Destructor.
46
47
55 void setProto (TClass* cls,
56 const std::string& fname,
57 const std::string& args,
58 ROOT::EFunctionMatchMode mode = ROOT::kExactMatch);
59
60
67 TMethodCall* call();
68
69
70private:
72 TClass* m_cls;
73
75 std::string m_fname;
76
78 std::string m_args;
79
81 ROOT::EFunctionMatchMode m_mode;
82
93 std::unique_ptr<TMethodCall> m_meth;
94
98 std::atomic<bool> m_initialized;
99
101 std::mutex m_mutex;
102
107 boost::thread_specific_ptr<TMethodCall> m_tsMeth;
108};
109
110
111} // namespace RootUtils
112
113
114#endif // not ROOTUTILS_TSMETHODCALL_H
ROOT::EFunctionMatchMode m_mode
Matching mode.
TSMethodCall & operator=(const TSMethodCall &other)
Assignment.
boost::thread_specific_ptr< TMethodCall > m_tsMeth
Objects used to call the method on the payload object.
std::string m_fname
Name of the function we're calling.
std::atomic< bool > m_initialized
Flag whether or not m_meth has been initialized.
TMethodCall * call()
Return a pointer to the thread-specific TMethodCall.
void setProto(TClass *cls, const std::string &fname, const std::string &args, ROOT::EFunctionMatchMode mode=ROOT::kExactMatch)
Set the function that we're to call.
std::unique_ptr< TMethodCall > m_meth
Object to call the method on the payload type.
TClass * m_cls
Class that we're calling.
std::string m_args
Argument list.
std::mutex m_mutex
Control access to m_assign for initialization.