/* support.hh * This file is part of ncursesxx library * Copyright (c) 2003,2004 by Stanislav Ievlev * * This file is covered by the GNU Library General Public License, * which should be included with libncursesxx as the file COPYING. */ #ifndef NCURSESXX_SUPPORT_HH__ #define NCURSESXX_SUPPORT_HH__ #include namespace ncurses { template class singleton_holder { /**< simple Meyers' style singleton */ public: typedef T obj_type; static T & instance () /**< @return instance of the object */ { static T obj; return obj; } private: /* all this operations are unavailable to ordinal users */ singleton_holder (); singleton_holder (const singleton_holder &s); singleton_holder &operator = (const singleton_holder &s); ~singleton_holder (); }; } #endif