Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

assert_pp.h File Reference


Detailed Description

Provides require/ensure macros for testing preconditions and postconditions.

Definition in file assert_pp.h.

Include dependency graph for assert_pp.h:

Include dependency graph

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

Included by dependency graph

Go to the source code of this file.

Defines

#define ASSERT_FUNCATTR_NORETURN
 Empty 'noreturn' attribute for unsupported compilers.

#define pp_decl(decl)   decl
 Wrapper for declarations that need to be conditionally compiled because they are only used by a precondition.

#define pp_block(block)   block
 Wrapper for code blocks that need to be conditionally compiled because they are only used by a precondition.

#define require(precon)
 Require an expression to be true.

#define ensure(postcon)
 Ensure an expression to be true.


Functions

int pp_failed (char *file, unsigned int line, const char *func, char *type, char *expr) ASSERT_FUNCATTR_NORETURN
 The routine which prints failure messages and aborts the program.


Define Documentation

#define ensure postcon   ) 
 

Value:

((void)((postcon) ? 0 : \
                (pp_failed(__FILE__,__LINE__,__PRETTY_FUNCTION__,"postcondition",__STRING(postcon)))))
Ensure an expression to be true.

If the expression turns out to be false, pp_failed is called with the location of this use of ensure.

See also:
assert

require

Parameters:
postcon The expression to test.

Definition at line 106 of file assert_pp.h.

Referenced by cpCreateChildProcess(), cpDeleteChildProcess(), gkFormatPreamble(), gkFormatUpdate(), HeyParser::HeyParser(), paChildPart(), paGetAdvocate(), paParentPart(), rk_cpu_reserve_create(), rk_cpu_reserve_delete(), rk_cpu_reserve_get_attr(), rk_cpu_reserve_tick(), rk_proc_get_rset(), rk_resource_set_attach_process(), rk_resource_set_create(), rk_resource_set_destroy(), rk_resource_set_detach_process(), rk_resource_set_get_cpu_rsv(), rk_resource_set_get_name(), rk_resource_set_set_name(), rk_stub_next_tick(), rktChildPart(), rktParentPart(), RKTask::SetComputeTime(), and string_to_microsec().

#define pp_block block   )     block
 

Wrapper for code blocks that need to be conditionally compiled because they are only used by a precondition.

Parameters:
block The code block to conditionally compile.

Definition at line 77 of file assert_pp.h.

Referenced by cpSampleUsage().

#define pp_decl decl   )     decl
 

Wrapper for declarations that need to be conditionally compiled because they are only used by a precondition.

Parameters:
decl The declaration to conditionally compile.

Definition at line 70 of file assert_pp.h.

#define require precon   ) 
 

Value:

((void)((precon) ? 0 : \
                (pp_failed(__FILE__,__LINE__,__PRETTY_FUNCTION__,"precondition",__STRING(precon)))))
Require an expression to be true.

If the expression turns out to be false, pp_failed is called with the location of this use of require.

See also:
assert

ensure

Parameters:
precon The expression to test.

Definition at line 87 of file assert_pp.h.

Referenced by afAllupHey(), afFactoryLibraryHey(), BasicDelegate::BasicDelegate(), baUsage(), bfHey(), cbhUsage(), StrictPolicyImpl::ChangeTaskCPU(), contract_region(), ContractDelegate::ContractDelegate(), cpCreateChildProcess(), cpDeleteChildProcess(), cpFindChildProcess(), cpInitChildProcessData(), cpOpenOutput(), cpSampleUsage(), cpu_reserve_valid(), cxx_delegate_postcall(), cxx_delegate_precall(), dfHey(), FactoryLibrary_ltdl::FactoryLibrary_ltdl(), StrictPolicyImpl::FindTaskPriority(), flFactoryMethod(), StrictPolicyImpl::GiveCPU(), gkFormatPreamble(), gkFormatUpdate(), HeyParser::HeyParser(), BasicTaskQosketImpl::initCallbacks(), BasicTaskQosketImpl::initSysconds(), RealTimeSchedule::intersect(), iPostFloatData(), iPrintPoint(), iPrintPoints(), lnAddHead(), lnAddTail(), lnAppendList(), lnCountNodes(), lnEnqueue(), lnFindName(), lnInsert(), lnMoveList(), lnNewList(), lnRemHead(), lnRemove(), lnRemTail(), FactoryLibrary_ltdl::OpenLibrary(), paGetAdvocate(), paParentPart(), paUsage(), pfHey(), BasicDelegate::postcall(), BasicDelegate::precall(), rbMakeBadFile(), RealTimeSchedule::RealTimeSchedule(), ManagerImpl::RemoveTaskAt(), ManagerImpl::ResolveTask(), rk_cpu_reserve_attr_valid(), rk_cpu_reserve_create(), rk_cpu_reserve_ctl(), rk_cpu_reserve_delete(), rk_cpu_reserve_get_attr(), rk_cpu_reserve_tick(), rk_inherit_mode(), rk_name_valid(), rk_next_tick(), rk_proc_get_rset(), rk_resource_set_attach_process(), rk_resource_set_create(), rk_resource_set_destroy(), rk_resource_set_detach_process(), rk_resource_set_get_by_name(), rk_resource_set_get_cpu_rsv(), rk_resource_set_get_name(), rk_resource_set_get_num_procs(), rk_resource_set_get_proclist(), rk_resource_set_set_name(), rk_resource_set_valid(), rk_resource_sets_get_list(), rk_resource_sets_get_num(), rk_stub_getrusage(), rk_stub_mk_pid(), rk_stub_next_tick(), rk_stub_set_mode(), rktChildPart(), rktClientWrite(), rktCreateSelfResourceSet(), rktGetChildResourceSet(), rktParentPart(), rktProcessOptions(), rktUsage(), RTServerImpl::RTServerImpl(), scan_cbhey_paths(), scan_directory(), scan_file(), scan_path(), scan_path_list(), BasicTaskCallbackImpl::sendMessage(), server_main(), server_main_usage(), sigalrm(), sigchld(), sigexit(), sigexit_handler(), sigio(), sigpass(), StrictPolicyImpl::StrictPolicyImpl(), string_to_microsec(), StrictPolicyImpl::TakeCPU(), ManagerImpl::TaskIndex(), tfHey(), tfMakeTimesFile(), timespec_to_microsec(), type_from_ior(), HeyParser::withValue(), and FactoryLibrary_ltdl::~FactoryLibrary_ltdl().


Function Documentation

int pp_failed char *  file,
unsigned int  line,
const char *  func,
char *  type,
char *  expr
 

The routine which prints failure messages and aborts the program.

Defined in misc/src/assert_pp.c.

Parameters:
file The file name containing the condition.
line The line number containing the condition.
func The name of the function containing the condition.
type Type of condition.
expr The stringified expression that failed.
Returns:
Doesn't.

Definition at line 23 of file assert_pp.c.


Generated on Mon Dec 1 16:29:14 2003 for CPU Broker by doxygen 1.3.4