Public Types | Public Member Functions | Private Attributes | List of all members
lar::details::bulk_allocator::ReferenceCounter Class Reference

A simple reference counter, keep track of a number of users. More...

#include <BulkAllocator.h>

Inheritance diagram for lar::details::bulk_allocator::ReferenceCounter:
lar::details::bulk_allocator::BulkAllocatorBase< T >

Public Types

typedef unsigned int Counter_t
 type of user counter More...
 

Public Member Functions

bool hasUsers () const
 Returns whether there are currently users. More...
 
Counter_t Count () const
 Returns the number of registered users. More...
 
void AddUser ()
 Adds a user to the users count. More...
 
bool RemoveUser ()
 Removed a user to the users count; returns false if no user yet. More...
 

Private Attributes

Counter_t counter = 0
 

Detailed Description

A simple reference counter, keep track of a number of users.

Definition at line 225 of file BulkAllocator.h.

Member Typedef Documentation

type of user counter

Definition at line 227 of file BulkAllocator.h.

Member Function Documentation

void lar::details::bulk_allocator::ReferenceCounter::AddUser ( )
inline

Adds a user to the users count.

Definition at line 236 of file BulkAllocator.h.

Counter_t lar::details::bulk_allocator::ReferenceCounter::Count ( ) const
inline

Returns the number of registered users.

Definition at line 233 of file BulkAllocator.h.

bool lar::details::bulk_allocator::ReferenceCounter::hasUsers ( ) const
inline

Returns whether there are currently users.

Definition at line 230 of file BulkAllocator.h.

bool lar::details::bulk_allocator::ReferenceCounter::RemoveUser ( )
inline

Removed a user to the users count; returns false if no user yet.

Definition at line 239 of file BulkAllocator.h.

240  { if (!counter) return false; --counter; return true; }

Member Data Documentation

Counter_t lar::details::bulk_allocator::ReferenceCounter::counter = 0
private

Definition at line 243 of file BulkAllocator.h.


The documentation for this class was generated from the following file: