Main Page | Namespace List | Class Hierarchy | Compound List | File List | Namespace Members | Compound Members | File Members | Related Pages

NoPtr C++ Library Documentation

0.9b3

NoPtr is a small C++ template library that will help you replace typical uses of raw pointers and references with safer, more versatile alternatives, while keeping strict ownership semantics that you are used to (even if you didn't know it :), even in STL containers. See "quick start" link below for quick start.

Table of contents:

Introduction

NoPtr provides you with four simple classes that should help you to think in terms of what you need to do rather than how to do it. The "how"'s of the form "this requires a pointer" should become "I need a dynamically allocated object, this part of the code owns it, this other part uses it". The rest is NoPtr's business. Ideally you keep raw pointers only for interfacing with third-party libraries or legacy code or when you are extremely desparate.

Note that NoPtr provides strict ownership, which is very different from shared ownership. Strict ownership uses less resources, makes it easier to follow when a resource gets released back to the system, and makes it explicit what part of your code is responsible for the lifetime of a resource. For shared ownership, your best bet is the boost library's shared_ptr. However, if you are thinking that you need shared ownership rather than strict ownership just so you can use STL containers of smart pointers, think again: NoPtr's strict ownership semantics works in STL containers too.

NoPtr should help you eliminate, at virtually no run-time cost in a release build (see performance link above):

Most of you will want to take a look at the How to use the NoPtr library page. This will give you a feel for what is and isn't possible with this library, what classes/methods support various tasks and in certain cases why things were done a certain way.

The current version is beta: the unit tests are good, but can't cover all the myriad cases that users other than the creator will cover. Also, several concepts are still experimental and need "trial by fire" to see if they really work as intended. So please let me know of any problems you have (don't forget to give compiler version and file release version). I welcome any feedback you may have: capabilities to add, suggested changes to interface, mistakes I have made (e.g. docs), etc.

Admin details

Since:
Apr 2003
Author:
Oliver Schoenborn, schoenborno@users.sourceforge.net

Todo:
Add custom per-class pre- and post- destructor

Add back_inserter to convert list of DynObj's to list of RRef's

Provide thread-safety?

Compare object file size for DynObj/RRef vs raw pointers

Add make target to create release

This project's CVS repository, located on SourceForge, can be checked out online, or through anonymous (pserver) CVS with the following CVS commands (replace cvshost with cvs.noptrlib.sourceforge.net, and when prompted for a password for anonymous, simply press the Enter key):

cvs -d:pserver:anonymous@cvshost:/cvsroot/noptrlib login
cvs -z3 -d:pserver:anonymous@cvshost:/cvsroot/noptrlib co NoPtr

Updates from within the module's directory do not need the -d parameter.

Copyright:

Copyright (C) 2003 Oliver Schoenborn

This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.

You can redistribute it and/or modify it under the terms found in the LICENSE file that is included in the library distribution.


Generated on Mon Aug 4 18:51:23 2003 for NoPtr C++ Library by doxygen 1.3.2