19#ifndef ATHCONTAINERS_THREAD_SPECIFIC_PTR_H
20#define ATHCONTAINERS_THREAD_SPECIFIC_PTR_H
23#ifdef ATHCONTAINERS_NO_THREADS
33class thread_specific_ptr
36 thread_specific_ptr() : m_ptr(0) {}
37 ~thread_specific_ptr() {
delete m_ptr; }
38 thread_specific_ptr (
const thread_specific_ptr&) =
delete;
39 thread_specific_ptr&
operator= (
const thread_specific_ptr&) =
delete;
40 T*
get() {
return m_ptr; }
43 const T*
get()
const {
return m_ptr; }
46 void reset (T* new_value=0) {
delete m_ptr; m_ptr = new_value; }
47 T*
release() {
T* ret = m_ptr; m_ptr = 0;
return ret; }
60#include "boost/thread/tss.hpp"
66using boost::thread_specific_ptr;
ElementConstReference operator*() const
Return a reference to the referenced element.
ElementLink & operator=(const ElementLink &)=default
ElementConstPointer operator->() const
Return a pointer to the referenced element.
static std::string release
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
virtual void reset() override
Free all allocated elements.