how to use set_template_handler()

I see this funtion in(elgg1.8): engine/lib/views.php;  

In my piont of view, it is a way to customize the layout of a theme,, but how to use it? is there any example?