CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

BlockWipedPool Class Reference

#include <BlockWipedAllocator.h>

List of all members.

Public Types

typedef BlockWipedAllocator Allocator
typedef std::map< std::size_t,
Allocator
Pool

Public Member Functions

Allocatorallocator (std::size_t typeSize)
 BlockWipedPool (std::size_t blockSize)
void clear ()
template<typename Visitor >
void visit (Visitor &visitor) const
void wipe ()

Private Attributes

std::size_t m_blockSize
Pool m_pool

Detailed Description

Definition at line 101 of file BlockWipedAllocator.h.


Member Typedef Documentation

Definition at line 103 of file BlockWipedAllocator.h.

typedef std::map<std::size_t, Allocator> BlockWipedPool::Pool

Definition at line 104 of file BlockWipedAllocator.h.


Constructor & Destructor Documentation

BlockWipedPool::BlockWipedPool ( std::size_t  blockSize)

Definition at line 78 of file BlockWipedAllocator.cc.

: m_blockSize(blockSize){}

Member Function Documentation

BlockWipedPool::Allocator & BlockWipedPool::allocator ( std::size_t  typeSize)

Definition at line 81 of file BlockWipedAllocator.cc.

References m_blockSize, m_pool, L1TEmulatorMonitor_cff::p, and edm::second().

Referenced by BlockWipedAllocated< T >::allocator(), BlockWipedPoolAllocated::allocator(), and blockWipedAllocator().

                                                                       {
  Pool::iterator p=m_pool.find(typeSize);
  if (p!=m_pool.end()) return (*p).second;
  return (*m_pool.insert(std::make_pair(typeSize,Allocator(typeSize, m_blockSize))).first).second;
}
void BlockWipedPool::clear ( void  )

Definition at line 93 of file BlockWipedAllocator.cc.

References BlockWipedAllocator::clear(), m_pool, and edm::second().

Referenced by BlockWipedAllocatorService::wiper().

                           {
  std::for_each(m_pool.begin(),m_pool.end(),boost::bind(&Allocator::clear,
                                                        boost::bind(&Pool::value_type::second,_1)
                                                        ));
}
template<typename Visitor >
void BlockWipedPool::visit ( Visitor &  visitor) const [inline]

Definition at line 115 of file BlockWipedAllocator.h.

References m_pool, edm::second(), and cmsPerfHarvest::visit().

Referenced by BlockWipedAllocatorService::dump().

                                     {
    std::for_each(m_pool.begin(),m_pool.end(),boost::bind(&Visitor::visit,visitor,
                                                          boost::bind(&Pool::value_type::second,_1)
                                                          ));
  }
void BlockWipedPool::wipe ( )

Definition at line 87 of file BlockWipedAllocator.cc.

References m_pool, edm::second(), and BlockWipedAllocator::wipe().

Referenced by BlockWipedAllocatorService::wiper().

                          {
  std::for_each(m_pool.begin(),m_pool.end(),boost::bind(&Allocator::wipe,
                                                        boost::bind(&Pool::value_type::second,_1)
                                                        ));
}

Member Data Documentation

std::size_t BlockWipedPool::m_blockSize [private]

Definition at line 123 of file BlockWipedAllocator.h.

Referenced by allocator().

Definition at line 124 of file BlockWipedAllocator.h.

Referenced by allocator(), clear(), visit(), and wipe().