What's the Difference Between the INLINE functions and non-inline functions?

isau

Deity
Joined
Jan 15, 2007
Messages
3,071
Hey guys,

Throughout the SDK I see numerous methods that contain the word INLINE. Examples are:

Code:
getOwnerINLINE()
getGameINLINE()

How are these methods different from methods like:

Code:
getOwner()
getGame()

Both seem to work. The SDK authors seem to prefer the INLINE version but the INLINE functions also don't pop up in my intellisense when typing C++ code. Is there a difference between these methods I should know about?

Thanks,

Isau
 
An Inline function is essentially a complex macro. The preprocessor drops the whole code of the function into that spot. The result is faster execution at the cost of increased memory/storage space.
 
An Inline function is essentially a complex macro. The preprocessor drops the whole code of the function into that spot. The result is faster execution at the cost of increased memory/storage space.
To expand on that, your compiler should be auto-building inline code for optimization when appropriate. You can force specific functions to compile as inline-functions regardless of what the compiler wants to do as seen by the existing Firaxis code.

In general you can ignore it entirely and assume that the compiler knows better than you, so just let it do it's thing.
 
Thanks for the answers guys.

Because the inline functions don't work with my intellisense, I'll probably stick to the standard functions for now. Once everything's built I might change them to inline functions.

-isau
 
Because the inline functions don't work with my intellisense, I'll probably stick to the standard functions for now. Once everything's built I might change them to inline functions.
There's really no reason to convert functions to inlines these days.
 
Just so I'm clear on this, when scripting in Python,
getOwnerINLINE(), getGameINLINE(), or anythingINLINE() is the same as getOwner(), getGame(), or anything(), yes?
 
No INLINE functions are exposed to python but not all non-inline versions are (in fact they are really the same function but I don't want to complicate things). In general you are correct, but there are several cases where the python version is slightly different in name or argument (number or order) from the C++ version. Look in the various cpp files with 'interface' in their name, those will be the functions exposed to python.
 
Top Bottom