SST/macro
Classes | Namespaces | Macros | Functions
ptr_type.h File Reference
#include <sprockit/errors.h>
#include <sprockit/refcount_ptr.h>
#include <sprockit/spkt_config.h>
#include <typeinfo>
Include dependency graph for ptr_type.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  sprockit::ptr_type
 
class  sprockit::printable_ptr_type
 

Namespaces

 sprockit
 

Macros

#define ptr_safe_cast(type, ...)   ::sprockit::__safe_ptr_cast__<type>(#type, __FILE__, __LINE__, __VA_ARGS__)
 First entry in VA_ARGS is the obj Second entry is optional being an error msg. More...
 
#define ptr_interface_cast(type, obj)   dynamic_cast<type*>(obj.get())
 
#define ptr_static_cast(type, obj)   static_cast<type*>(obj.get())
 
#define ptr_test_cast(type, obj)   dynamic_cast<type*>(obj.get())
 
#define ptr_known_cast(type, ...)   ptr_safe_cast(type, __VA_ARGS__)
 

Functions

template<class Out , class In >
sprockit::refcount_ptr< Out > sprockit::__safe_ptr_cast__ (const char *objname, const char *file, int line, const sprockit::refcount_ptr< In > &in, const char *error_msg="error")
 

Macro Definition Documentation

#define ptr_interface_cast (   type,
  obj 
)    dynamic_cast<type*>(obj.get())

Definition at line 88 of file ptr_type.h.

#define ptr_known_cast (   type,
  ... 
)    ptr_safe_cast(type, __VA_ARGS__)

Definition at line 97 of file ptr_type.h.

#define ptr_safe_cast (   type,
  ... 
)    ::sprockit::__safe_ptr_cast__<type>(#type, __FILE__, __LINE__, __VA_ARGS__)
#define ptr_static_cast (   type,
  obj 
)    static_cast<type*>(obj.get())

Definition at line 91 of file ptr_type.h.

#define ptr_test_cast (   type,
  obj 
)    dynamic_cast<type*>(obj.get())

Definition at line 94 of file ptr_type.h.