nn::nex::Data::DynamicCast Member Function

Syntax

static Data * DynamicCast(
     Data * pData
);

Parameters

Name Description
in pData Specifies a pointer to the class that inherits the Data class.

Return Values

Returns the pointer specified with pData as a pointer to a class when calling.

Value Description
NULL Returned when the pointer specified by pData is not a class that inherits the class that was called. For example, when UserMessage::DynamicCast is called, NULL is returned if the pData entity is not a UserMessage-derived class.

Description

Performs a dynamic cast for the Data class pointer.

This function automatically creates a class that inherits the Data class defined with DDL by the DDL compiler.

By calling same-name functions defined by each class, the pointer specified by the argument is dynamically cast to the pointer of each class type. With the UserMessage::DynamicCast function, for example, the Data*-type pointer specified by the argument is dynamically cast to UserMessage*. If casting is possible, a valid pointer is returned; if casting is not possible, NULL is returned.

Dynamic casting is independently implemented with this function, so it is not necessary to enable RTTI.

Revision History

2013/01/29
Initial version.

CONFIDENTIAL