This method casts the object to a derived type.
Parameter | Description |
---|---|
T | type to cast to |
Returns the object as a derived type T, or NULL if the object cannot be cast to the specified type.
This method should never be called in a class constructor or destructor.
#include "UltraEngine.h"
using namespace UltraEngine;
int main(int argc, const char* argv[])
{
//Cast to base type
shared_ptr<Object> o = CreateBuffer();
//Cast to derived type
shared_ptr<Buffer> buffer = o->As<Buffer>();
return 0;
}