ATLAS Offline Software
Loading...
Searching...
No Matches
datetimestamp.h File Reference

emacs: this is -*- c++ -*- More...

#include <dlfcn.h>
#include <sys/stat.h>
#include <time.h>
#include <string>
Include dependency graph for datetimestamp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  timestamp< T >

Functions

std::string datetimestamp_addr (const void *address)
template<typename T, typename... Args>
std::string datetimestamp (T(*func)(Args...))
template<typename T>
std::string datetimestamp (const T *)

Detailed Description

emacs: this is -*- c++ -*-

     get the bnuild time of the requested object / function 
     using stat on the installed module that it is in
Author
sutt
Date
Sat Oct 24 06:12:45 PM CEST 2026
Id
Utils.h, v0.0 Sat Oct 24 06:12:45 PM CEST 2026 sutt

Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration

Definition in file datetimestamp.h.

Function Documentation

◆ datetimestamp() [1/2]

template<typename T>
std::string datetimestamp ( const T * )

Definition at line 49 of file datetimestamp.h.

49{ return datetimestamp_addr((void*)(&timestamp<T>::stamper)); }
std::string datetimestamp_addr(const void *address)
static void stamper()

◆ datetimestamp() [2/2]

template<typename T, typename... Args>
std::string datetimestamp ( T(* func )(Args...))

Definition at line 43 of file datetimestamp.h.

43{ return datetimestamp_addr((void*)(func)); }

◆ datetimestamp_addr()

std::string datetimestamp_addr ( const void * address)
inline

Definition at line 26 of file datetimestamp.h.

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}
std::string stime()
return the current data and time