iFun Engine API  1.0.0-b2936
Great Technology for Great Games
 All Classes Files Functions Variables Typedefs Macros
Public Member Functions | List of all members
fun::ComponentEnabler Class Reference

ComponentEnabler is to preload components. More...

#include <unit_test.h>

Public Member Functions

 ComponentEnabler (const std::set< string > &enabled_components)
 
 ComponentEnabler (const string &enabled_component)
 
 ComponentEnabler (const string &enabled_component1, const string &enabled_component2)
 

Detailed Description

Though the framework automatically loads all the registered components, it is sometimes necessary to enable only subset of components. (e.g., unit test) This class satisfies such a case. It traverses the component dependency tree and also loads required ancestor components. Its constructor topologically sorts components and invoke Install() method on each component. And destructor calls Uninstall() method in the reverse order.

Constructor & Destructor Documentation

fun::ComponentEnabler::ComponentEnabler ( const std::set< string > &  enabled_components)
explicit
Parameters
enabled_componentstarget component names to be enabled.
fun::ComponentEnabler::ComponentEnabler ( const string &  enabled_component)
explicit
Parameters
enabled_componenttarget component name to be enabled.
fun::ComponentEnabler::ComponentEnabler ( const string &  enabled_component1,
const string &  enabled_component2 
)
explicit
Parameters
enabled_component1first target component name to be enabled.
enabled_component2second target component name to be enabled.