contract.hh File Reference

Definition of contract macros. More...

Include dependency graph for contract.hh:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  vcsn
namespace  vcsn::misc
namespace  vcsn::misc::contract

Defines

#define vcsn_trap_(Message, Cond)
#define vcsn_trap__(Message, Cond, Explanation)
#define vcsn_trap_2(Message1, Message2)
#define assertion(Cond)   static_cast<void> ((Cond) ? static_cast<void> (0) : vcsn_trap_ ("Assertion failed", Cond))
#define precondition(Cond)   static_cast<void> ((Cond) ? static_cast<void> (0) : vcsn_trap_ ("Precondition failed", Cond))
#define postcondition(Cond)   static_cast<void> ((Cond) ? static_cast<void> (0) : vcsn_trap_ ("Postcondition failed", Cond))
#define unreachable(Explanation)   vcsn_trap_2 ("Unreachable code reached", Explanation)
#define assertion_(Cond, Explanation_if_false)   static_cast<void> ((Cond) ? static_cast<void> (0) : vcsn_trap__ ("Assertion failed", Cond, Explanation_if_false))
#define precondition_(Cond, Explanation_if_false)   static_cast<void> ((Cond) ? static_cast<void> (0) : vcsn_trap__ ("Precondition failed", Cond, Explanation_if_false))
#define postcondition_(Cond, Explanation_if_false)   static_cast<void> ((Cond) ? static_cast<void> (0) : vcsn_trap__ ("Postcondition failed", Cond, Explanation_if_false))
#define result_not_computable_if(Cond)   static_cast<void> ((Cond) ? vcsn_trap_ ("Result is not computable", Cond) : static_cast<void> (0))
#define result_not_computable(Message)   vcsn_trap_2 ("Result is not computable", Message)
#define pure_service_call(Service)   vcsn_trap_ ("Pure absract service called", Service)
#define static_assertion(Cond, Message)   { vcsn::misc::static_if<Cond, int, vcsn::misc::contract::fail<void> >::t Message; Message = 0; }
#define static_assertion_(Cond, Message)   { typename vcsn::misc::static_if<Cond, int, vcsn::misc::contract::fail<void> >::t Message; Message = 0; }
#define static_error(Message)
#define recommendation(Cond)   static_cast<void> (0)
#define deprecation(Feature)   static_cast<void> (0)
#define weakness(Feature)   static_cast<void> (0)
#define incompletion(Feature)   static_cast<void> (0)
#define warning(Message)   static_cast<void> (0)

Functions

static void vcsn::misc::contract::trap (const char *file, int line, const char *location, const std::string &message)
 Internal function to report errors in failed contract macros.


Detailed Description

Definition of contract macros.

Definition in file contract.hh.


Generated on Sat Jul 29 17:15:07 2006 for Vaucanson by  doxygen 1.4.6