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

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 RKObserverAdvocate::BeginCPUScheduling(), cpCreateChildProcess(), cpDeleteChildProcess(), RKObserverAdvocate::EndCPUScheduling(), gkFormatPreamble(), gkFormatUpdate(), HeyParser::HeyParser(), main(), 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_get_usage(), rk_resource_set_proc_cache_add(), rk_resource_set_proc_cache_search(), rk_resource_set_proc_compare(), rk_resource_set_set_name(), rk_stub_next_tick(), RKObserverAdvocate::RKObserverAdvocate(), rktChildPart(), rktParentPart(), rts_get_schedule(), rts_set_schedule(), RKObserverAdvocate::run(), RKTask::SetComputeTime(), string_to_microsec(), and RKObserverAdvocate::~RKObserverAdvocate().

#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(), WeightedPolicyImpl::ChangeTaskCPU(), StrictPolicyImpl::ChangeTaskCPU(), PartitionPolicyImpl::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(), WeightedPolicyImpl::FindTaskData(), PartitionPolicyImpl::FindTaskData(), StrictPolicyImpl::FindTaskPriority(), flFactoryMethod(), gkFormatPreamble(), gkFormatUpdate(), HeyParser::HeyParser(), iInitPoint(), BasicTaskQosketImpl::initCallbacks(), BasicTaskQosketImpl::initSysconds(), RealTimeSchedule::intersect(), iPostFloatData(), iPrintPoint(), iPrintPoints(), lnAddHead(), lnAddTail(), lnAppendList(), lnCountNodes(), lnEnqueue(), lnFindName(), lnInsert(), lnMoveList(), lnNewList(), lnRemHead(), lnRemove(), lnRemTail(), main(), FactoryLibrary_ltdl::OpenLibrary(), paGetAdvocate(), paParentPart(), PartitionPolicyImpl::PartitionPolicyImpl(), paUsage(), pfHey(), BasicDelegate::postcall(), BasicDelegate::precall(), rbMakeBadFile(), RealTimeSchedule::RealTimeSchedule(), 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_proc_cache_add(), rk_resource_set_proc_cache_intersect(), rk_resource_set_proc_cache_release(), rk_resource_set_proc_cache_search(), rk_resource_set_proc_compare(), 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(), StrictPolicyCallbackImpl::sendMessage(), BasicTaskCallbackImpl::sendMessage(), server_main(), server_main_usage(), sigalrm(), sigchld(), sigexit(), sigexit_handler(), sigio(), sigpass(), StrictPolicyImpl::StrictPolicyImpl(), string_to_microsec(), test_get_usage(), tfHey(), tfMakeTimesFile(), timespec_to_microsec(), trampoline(), type_from_ior(), WeightedPolicyImpl::WeightedPolicyImpl(), and HeyParser::withValue().


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 Fri Oct 22 07:50:26 2004 for CPU Broker by  doxygen 1.3.9.1