ATLAS Offline Software
Public Types | Public Member Functions | Private Attributes | List of all members
SG::T2pMap Class Reference

#include <T2pMap.h>

Collaboration diagram for SG::T2pMap:

Public Types

typedef std::unordered_map< const void *, DataProxy *, ptrhasht2p
 

Public Member Functions

 T2pMap (IPageAccessControlSvc *pac=0)
 
 ~T2pMap ()
 
bool t2pRegister (const void *const pTrans, DataProxy *const pPers)
 
DataProxylocatePersistent (const void *const pTransient) const
 
void clear ()
 
void t2pRemove (const void *const pTrans)
 
void setPac (IPageAccessControlSvc *pac)
 set IPageAccessControlSvc ptr in T2PMap More...
 
std::vector< const DataProxy * > pacReport () const
 request an access control report, i.e. a list of proxies that have not been accessed since under control; More...
 

Private Attributes

IPageAccessControlSvcm_pac
 
t2p m_t2p
 
std::mutex m_mutex
 

Detailed Description

Definition at line 21 of file T2pMap.h.

Member Typedef Documentation

◆ t2p

typedef std::unordered_map<const void*, DataProxy*, ptrhash> SG::T2pMap::t2p

Definition at line 25 of file T2pMap.h.

Constructor & Destructor Documentation

◆ T2pMap()

SG::T2pMap::T2pMap ( IPageAccessControlSvc pac = 0)
inline

Definition at line 28 of file T2pMap.h.

28 : m_pac(pac) { };

◆ ~T2pMap()

SG::T2pMap::~T2pMap ( )
inline

Definition at line 31 of file T2pMap.h.

31 { };

Member Function Documentation

◆ clear()

void SG::T2pMap::clear ( )
inline

Definition at line 53 of file T2pMap.h.

53  {
54  std::lock_guard<std::mutex> lock (m_mutex);
55  m_t2p.clear();
56  }

◆ locatePersistent()

DataProxy* SG::T2pMap::locatePersistent ( const void *const  pTransient) const
inline

Definition at line 42 of file T2pMap.h.

42  {
43  std::lock_guard<std::mutex> lock (m_mutex);
44  t2p::const_iterator i = m_t2p.find(pTransient);
45 
46  if (i == m_t2p.end())
47  return 0;
48  else
49  return i->second;
50  }

◆ pacReport()

std::vector< const DataProxy * > T2pMap::pacReport ( ) const

request an access control report, i.e. a list of proxies that have not been accessed since under control;

Definition at line 7 of file T2pMap.cxx.

7  {
8  std::vector<const DataProxy*> notAccessed;
9  if (m_pac) {
10  t2p::const_iterator i(m_t2p.begin()), e(m_t2p.end());
11  while (i != e) {
12  if (!m_pac->accessed(i->first)) notAccessed.push_back(i->second);
13  ++i;
14  }
15  }
16  return notAccessed;
17 }

◆ setPac()

void SG::T2pMap::setPac ( IPageAccessControlSvc pac)
inline

set IPageAccessControlSvc ptr in T2PMap

Definition at line 65 of file T2pMap.h.

65 { m_pac=pac; }

◆ t2pRegister()

bool SG::T2pMap::t2pRegister ( const void *const  pTrans,
DataProxy *const  pPers 
)
inline

Definition at line 34 of file T2pMap.h.

34  {
35  std::lock_guard<std::mutex> lock (m_mutex);
36  bool success(m_t2p.insert (std::make_pair (pTrans, pPers)) . second);
37  if (m_pac) m_pac->controlPage(pTrans);
38  return success;
39  }

◆ t2pRemove()

void SG::T2pMap::t2pRemove ( const void *const  pTrans)
inline

Definition at line 59 of file T2pMap.h.

59  {
60  std::lock_guard<std::mutex> lock (m_mutex);
61  m_t2p.erase(pTrans);
62  }

Member Data Documentation

◆ m_mutex

std::mutex SG::T2pMap::m_mutex
mutableprivate

Definition at line 73 of file T2pMap.h.

◆ m_pac

IPageAccessControlSvc* SG::T2pMap::m_pac
private

Definition at line 71 of file T2pMap.h.

◆ m_t2p

t2p SG::T2pMap::m_t2p
private

Definition at line 72 of file T2pMap.h.


The documentation for this class was generated from the following files:
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
python.SystemOfUnits.second
int second
Definition: SystemOfUnits.py:120
IPageAccessControlSvc::accessed
virtual bool accessed(const void *address) const =0
has this pointer been accessed (read/written)
SG::T2pMap::m_t2p
t2p m_t2p
Definition: T2pMap.h:72
lumiFormat.i
int i
Definition: lumiFormat.py:85
SG::T2pMap::m_mutex
std::mutex m_mutex
Definition: T2pMap.h:73
IPageAccessControlSvc::controlPage
virtual bool controlPage(const void *address)=0
control access to the page containing address
SG::T2pMap::m_pac
IPageAccessControlSvc * m_pac
Definition: T2pMap.h:71