ATLAS Offline Software
Loading...
Searching...
No Matches
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
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;

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) { };
IPageAccessControlSvc * m_pac
Definition T2pMap.h:71

◆ ~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 }
t2p m_t2p
Definition T2pMap.h:72
std::mutex m_mutex
Definition T2pMap.h:73

◆ 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 std::lock_guard<std::mutex> lock (m_mutex);
11 t2p::const_iterator i(m_t2p.begin()), e(m_t2p.end());
12 while (i != e) {
13 if (!m_pac->accessed(i->first)) notAccessed.push_back(i->second);
14 ++i;
15 }
16 }
17 return notAccessed;
18}

◆ 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: