/*****************************************************************************
 * $LastChangedDate: 2010-05-25 21:26:05 -0400 (Tue, 25 May 2010) $
 * @file
 * @author  Jim E. Brooks  http://www.palomino3d.org
 * @brief   Reference-counted pointer template classes.
 * @remarks Threadable/locked variants are at threads/thptr.hh.
 *//*
 * LEGAL:   COPYRIGHT (C) 2007 JIM E. BROOKS
 *          THIS SOURCE CODE IS RELEASED UNDER THE TERMS
 *          OF THE GNU GENERAL PUBLIC LICENSE VERSION 2 (GPL 2).
 *****************************************************************************/

#if ! DOXYGEN
#ifndef BASE_SHARED_PTR_HH
#define BASE_SHARED_PTR_HH 1

#include "base/shared.hh"
#include "threads/module.hh"
#include "threads/threadable.hh"
using namespace threads;

namespace base {

// shptr (fastest, non-nullable, non-threadable)
#define SHPTR_CLASS             shptr
#define SHPTR_THREADABLE_CLASS  NonThreadable
#define IF_NOT_NULL_SHPTR(PTR)
#define SHPTR_NULL              0
#define SHPTR_AUTO_LOCK
#include "base/shptr_impl.hh"
#undef SHPTR_CLASS
#undef SHPTR_THREADABLE_CLASS
#undef IF_NOT_NULL_SHPTR
#undef SHPTR_NULL
#undef SHPTR_AUTO_LOCK

// shptr0 (nullable)
#define SHPTR_CLASS             shptr0
#define SHPTR_THREADABLE_CLASS  NonThreadable
#define IF_NOT_NULL_SHPTR(PTR)  if ( EX( (PTR) != NULL ) )
#define SHPTR_NULL              1
#define SHPTR_AUTO_LOCK
#include "base/shptr_impl.hh"
#undef SHPTR_CLASS
#undef SHPTR_THREADABLE_CLASS
#undef IF_NOT_NULL_SHPTR
#undef SHPTR_NULL
#undef SHPTR_AUTO_LOCK

} // namespace base

#endif // BASE_SHARED_PTR_HH
#endif // ! DOXYGEN
