TIBCO Adapter SDK C++ Reference
MComponent::downCast
MComponent
Allow a safe cast operation of certain classes, including all subclasses of MComponent, subclasses of MSink, and subclasses of MBaseClassDescription.
Remarks
Certain methods return pointers to MComponent (or another class that has subclasses) where the component returned is actually an instance of the subclass. This method allows applications to safely cast the return value to the appropriate subclass so that the subclass methods can then be called.

This method is never called for an instance of MComponent. It is called for instances of its subclasses. It is documented here because it applies to all components.

NULL is returned if the safe cast operation is not successful.

Parameters
Parameters Description
const MComponent* pMComponent An object for which you know the superclass but don’t know the direct superclass. For example, if a method returns an MComponent and you expect it is an MSubscriber, you use the returned MComponent as an argument to this method.
Examples
Applications usually use this method as in the following example:

MSubscriber * pSubscriber;

pSubscriber = MSubscriber::downCast (pMComponent); 

if (pSubscriber)...
Declaration
static const MComponent* downCast(const MComponent* pMComponent);
Links
Copyright (c) 2010 TIBCO Software Inc. All rights reserved.