9 #ifndef IMPKERNEL_OBJECT_CAST_H
10 #define IMPKERNEL_OBJECT_CAST_H
12 #include <IMP/kernel_config.h>
16 IMPKERNEL_BEGIN_NAMESPACE
24 O *ret =
dynamic_cast<O *
>(o);
29 IMP_THROW(
"Object " << o->get_name() <<
" cannot be cast to "
37 IMPKERNEL_END_NAMESPACE
Common base class for heavy weight IMP objects.
O * object_cast(Object *o)
Up (or down) cast an IMP Object-derived class.
#define IMP_THROW(message, exception_name)
Throw an exception with a message.
Helper macros for throwing and handling exceptions.
A shared base class to help in debugging and things.
An exception for an invalid value being passed to IMP.