ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigAnalysis
TrigInDetAnalysisUser
Analysis
src
datetimestamp.h
Go to the documentation of this file.
1
16
17
18
#ifndef DATETIMESTAMP_H
19
#define DATETIMESTAMP_H
20
21
#include <dlfcn.h>
22
#include <sys/stat.h>
23
#include <time.h>
24
#include <string>
25
26
inline
std::string
datetimestamp_addr
(
const
void
* address)
27
{
28
Dl_info info;
29
30
struct
stat st;
31
32
if
( dladdr( address, &info )==0 || info.dli_fname==0 || stat( info.dli_fname, &st )!=0 )
return
"???"
;
33
34
std::string
stime
( 25,
'\0'
);
35
36
ctime_r( &st.st_mtime, &
stime
[0] );
37
stime
.pop_back();
38
39
return
stime
;
40
}
41
42
template
<
typename
T,
typename
...
Args
>
43
std::string
datetimestamp
(T (*func)(
Args
...)) {
return
datetimestamp_addr
((
void
*)(func)); }
44
45
template
<
typename
T>
46
struct
timestamp
{
static
void
stamper
() {} };
47
48
template
<
typename
T>
49
std::string
datetimestamp
(
const
T*
/* t */
) {
return
datetimestamp_addr
((
void
*)(&
timestamp<T>::stamper
)); }
50
51
52
#endif
// DATETIMESTAMP_H
53
stime
std::string stime()
return the current data and time
Definition
computils.cxx:374
datetimestamp
std::string datetimestamp(T(*func)(Args...))
Definition
datetimestamp.h:43
datetimestamp_addr
std::string datetimestamp_addr(const void *address)
Definition
datetimestamp.h:26
Args
Definition
test_lwtnn_fastgraph.cxx:12
timestamp
Definition
datetimestamp.h:46
timestamp::stamper
static void stamper()
Definition
datetimestamp.h:46
Generated on
for ATLAS Offline Software by
1.17.0