![]() |
Developers ManualProject homepage |
#include <assert.h>
Include dependency graph for DbC.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Classes | |
class | DbC |
Defines | |
#define | ASSERT(bool_expression) |
#define | IS_VALID(obj) ASSERT((obj) != NULL && (obj)->IsValid()) |
#define | REQUIRE(bool_expression) ASSERT(bool_expression) |
#define | ENSURE(bool_expression) ASSERT(bool_expression) |
Design By Contract (DbC) can dramatically raise software quality and reusability levels by forcing the developer to think in terms of contracts, i.e. agreements between the designer/developer of a software module (class or interface) and the class or interface client (the user). The compliance of such agreements are verified by pre- and postconditions, as well as invariants (an object's valid state).
That means concretely: the client of a class must satisfy the precondition prior to invoking a method. If this condition is fulfilled, the supplier must satisfy the postcondition and class invariant.
This header file contains some macros to apply DbC technique to C++. These macros are only defined in _DEBUG builds, they are defined to blank in the release build.
This DbC framework is based predominantly on an article from the EventHelix web site: http://www.eventhelix.com/RealtimeMantra/Object_Oriented/design_by_contract.htm
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Definition in file DbC.h.
|
Value: if (! (bool_expression)) \
_assert(#bool_expression, __FILE__, __LINE__ - 1)
|
|
This macro checks if the post conditions have been met. Definition at line 96 of file DbC.h. Referenced by O3DBIObject::O3DBIObject(). |
|
This macro invokes the virtual IsValid() method to check the consistency of an object (also known as Class invariants). |
|
This macro should be used to check if the pre-conditions for the invoked method have been met. |
|
Generated on Sun Jan 23 11:36:35 2005 for Oracle Object Oriented Database Interface (O3DBI) by
![]() |