| |||
| Home > The Cycle Accurate Simulation Interface > The component factory class CASIFactory |
The factory class in the ESL API provides a standardized mechanism for dynamic component creation and enables instantiating and creating a component without the need for access to its constructor.
Example 2.26. CASIFactory class
class CASIFactory
{
public:
CASIFactory(const std::string& name);
virtual ~CASIFactory() {};
virtual CASIModuleIF *createInstance(CASIModuleIF *parent,
const std::string& instance_name) = 0;
};
Typically the component factory not does require any changes. The factory class is not required if you are using the models in a pure SystemC environment.
Only two functions must be implemented in the CASIFactory class: