Exforsys

Online Training

ANN: Boost review of Singleton library (C++)

This is a discussion on ANN: Boost review of Singleton library (C++) within the Software Patterns forums, part of the Testing category; Boost ( http://www.boost.org/ ) is collection of peer-reviewed C++ libraries. Review of Singleton, written by Jason Hise, started ...


Go Back   Exforsys > Testing > Software Patterns

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-04-2005, 08:33 PM
Pavel Vozenilek
Guest
 
Posts: n/a
ANN: Boost review of Singleton library (C++)

Boost (http://www.boost.org/) is collection of peer-reviewed C++ libraries.
Review of Singleton, written by Jason Hise, started just now.

As singleton is one of well known (and often disputed) patterns in OOP,
state-of-the-art implementation in C++ may be of interest here.

The library is available at
http://boost-sandbox.sourceforge.net...tory=Singleton

The singleton documentation can be browsed online at
http://www.ezequal.com/chaos/docs/html/singleton/


Singleton is feature rich library:

- ensuring single instance of a class
and global access point to this instance

- with policies specifying:

- when the instance gets created
(manually, immediatelly, when first used, ...)

- how is the instance created
(by new, malloc, in static memory, ...)

- when the instance gets destroyed
(never, by priority, after another singleton, ...)



Parametrized singleton called Multiton is provided

City:ointer p1("Chicago");
City:ointer p2("Brussels");

will create two different "singletons" of the same type.


Another feature is ability to register resources
(like shared pointer) who will get destroyed
in controlled order, when the application exits.


If you have opinion on this library, found bug or
something missing, please reply here,
on Boost mail-list or privately.
All feedback is welcomed.

/Pavel



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 11:20 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2004 - 2007 Exforsys Inc. All rights reserved.