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