/** SGX

The   sss    gggg x   x   
     s      g      x x    Engine
      sss   g  gg   x
         s  g   g  x x          Copyright 1995-2008.
     ssss    gggg x   x         Steven Goodwin. All Rights Reserved.
    
This version has been released under the GNU Public License v2.0.

Please see the license files for details.

File: include/sgx/core/types/casting.hpp

*/

#ifndef SGX_CORE_TYPES_CASTING_HPP
#define SGX_CORE_TYPES_CASTING_HPP	1

#ifdef __cplusplus
#define SGX_CAST(casttype, castclass, var)	(casttype<castclass>(var))
#else
#define SGX_CAST(casttype, castclass, var)	((castclass)(var))
#endif

#define SGX_STATIC_CAST(castclass, var)      SGX_CAST(static_cast, castclass, var)				// between related types, e.g. ptr within class hierarchy, or enum & int
#define SGX_DYNAMIC_CAST(castclass, var)     SGX_CAST(dynamic_cast, castclass, var)				// safe conversions using RTTI
#define SGX_REINTERPRET_CAST(castclass, var) SGX_CAST(reinterpret_cast, castclass, var)			// changes raw memory ptrs/objects
#define SGX_CONST_CAST(castclass, var)       SGX_CAST(const_cast, castclass, var)				// for differences in const and volatile objects

#endif /* SGX_CORE_TYPES_CASTING_HPP */
