TIBCO Adapter SDK C++ Reference
MData::getAsInt
MData
Return the value stored in this MData as int, if possible. This method throws an exception if the type of this MData object is not equal to the expected return type of the method.
Remarks
If you have an MData pointer and do not know the type to which it belongs, you can call downcast() first, then retrieve the actual data. If you already know the type, you can call this method directly. Note, however, that an exception is raised if you actually have a NULL data pointer.
Examples
Assume you have a data pointer:

MData *pmData = pmInst -> get ("intVal");

You then call downCast() or getClassName() to find out what the actual type is. Note that this call is introspective. You could omit it if you’re sure of the actual type.

MInteger::downCast (pmData);
Finally, you can call the getAs...() method:
int i = pmData -> getAsInteger();
Declaration
virtual int getAsInt() const throw(MException);
Links
Copyright (c) 2010 TIBCO Software Inc. All rights reserved.