interface returns the typeId of the 'this' object at the given call stack level (0 for current) returns 0 if the function call at the given stack level is not a method
| 5569 | // returns the typeId of the 'this' object at the given call stack level (0 for current) |
| 5570 | // returns 0 if the function call at the given stack level is not a method |
| 5571 | int asCContext::GetThisTypeId(asUINT stackLevel) |
| 5572 | { |
| 5573 | asIScriptFunction *func = GetFunction(stackLevel); |
| 5574 | if( func == 0 ) return asINVALID_ARG; |
| 5575 | |
| 5576 | if( func->GetObjectType() == 0 ) |
| 5577 | return 0; // not in a method |
| 5578 | |
| 5579 | // create a datatype |
| 5580 | asCDataType dt = asCDataType::CreateType((asCObjectType*)func->GetObjectType(), false); |
| 5581 | |
| 5582 | // return a typeId from the data type |
| 5583 | return m_engine->GetTypeIdFromDataType(dt); |
| 5584 | } |
| 5585 | |
| 5586 | // interface |
| 5587 | // returns the 'this' object pointer at the given call stack level (0 for current) |
no test coverage detected