3 #ifndef GEODE_SHAREDPTRHELPER_H_ 4 #define GEODE_SHAREDPTRHELPER_H_ 23 #include "geode_globals.hpp" 24 #include "TypeHelper.hpp" 37 static void throwNullPointerException(
const char* ename);
39 static void throwClassCastException(
const char* msg,
const char* fromType,
45 template <
class Target,
class Src>
46 Target* getTargetHelper(Src* ptr,
47 apache::geode::client::TypeHelper::yes_type yes) {
53 template <
class Target,
class Src>
54 Target* getTargetHelper(Src* ptr,
55 apache::geode::client::TypeHelper::no_type no) {
56 Target* tptr =
dynamic_cast<Target*
>(ptr);
60 SPEHelper::throwClassCastException(
"getTargetHelper: cast failed",
61 typeid(ptr).name(),
typeid(tptr).name());
68 template <
class Target,
class Src>
69 Target* getTarget(Src* ptr) {
70 return getTargetHelper<Target>(ptr, GF_SRC_IS_TARGET_TYPE(Target, Src));
77 return getTarget<SharedBase>(ptr);
83 #endif // GEODE_SHAREDPTRHELPER_H_ Helper class for SharedPtr exceptions.
Definition: SharedPtrHelper.hpp:35
Each enum represents a predefined RegionAttributes in a Cache.
Definition: Assert.hpp:31
#define CPPCACHE_EXPORT
Defines a Geode CPPCACHE export.
Definition: geode_base.hpp:58
This abstract base class is the base class of all user objects that have the shared capability of ref...
Definition: SharedBase.hpp:40
This namespace contains all the Geode C++ API classes, enumerations and globals.