Panda3D

Loading...
Searching...
No Matches
Macros | Functions
dcast.h File Reference

PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University. More...

`#include "pandabase.h"`
`#include "typeHandle.h"`
`#include "typedObject.h"`
`#include "config_express.h"`
`#include "dcast.T"`

Go to the source code of this file.

## Macros
#define | DCAST(want_type, pointer)
#define | DCAST_INTO_R(to_pointer, from_pointer, return_value)
#define | DCAST_INTO_V(to_pointer, from_pointer)

## Functions
template<class WantType>
const WantType * | _dcast (WantType *, const TypedObject *ptr)
template<class WantType>
WantType * | _dcast (WantType *, TypedObject *ptr)
template<class WantType>
const WantType * | _dcast_ref (WantType *&, const TypedObject *ptr)
template<class WantType>
WantType * | _dcast_ref (WantType *&, TypedObject *ptr)
EXPCL_PANDA_EXPRESS bool | _dcast_verify (TypeHandle want_handle, size_t want_size, const TypedObject *ptr)
| This function performs the actual check that the indicated TypedObject pointer is of the intended type.

## Detailed Description

PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.

All rights reserved.

All use of this software is subject to the terms of the revised BSD license. You should have received a copy of this license along with this source code in a file named "LICENSE."

Author
  drose

Date
  2001-08-06

Definition in file dcast.h.

## Macro Definition Documentation

## ◆ DCAST

#define DCAST | ( |  | want_type,
|  |  | pointer )

Value:
_dcast((want_type*)0, pointer)

Definition at line 42 of file dcast.h.

## ◆ DCAST_INTO_R

#define DCAST_INTO_R | ( |  | to_pointer,
|  |  | from_pointer,
|  |  | return_value )

Value:
{ \
(to_pointer) = _dcast_ref(to_pointer, from_pointer); \
nassertr((void *)(to_pointer) != nullptr, return_value); \
}

Definition at line 78 of file dcast.h.

## ◆ DCAST_INTO_V

#define DCAST_INTO_V | ( |  | to_pointer,
|  |  | from_pointer )

Value:
{ \
(to_pointer) = _dcast_ref(to_pointer, from_pointer); \
nassertv((void *)(to_pointer) != nullptr); \
}

Definition at line 72 of file dcast.h.

## Function Documentation

## ◆ _dcast_verify()

EXPCL_PANDA_EXPRESS bool _dcast_verify | ( | TypeHandle | want_handle,
|  | size_t | want_size,
|  | const TypedObject * | ptr )

This function performs the actual check that the indicated TypedObject pointer is of the intended type.

Definition at line 29 of file dcast.cxx.

References TypedObject::is_of_type().