Description
The BuildDevice method is called during the creation of the device object, to give the device a chance to perform any initialization tasks that it needs to perform. It is better to use this method rather than the constructor as the point where any significant tasks, such as building lookup tables or allocating significant memory buffers. Like the constructor, this method is only called once for the lifetime of the object, and it is called shortly after the constructor is called, but unlike the constructor, virtual functions can be invoked safely, the BindToSystemInterface, BindToDeviceContext, and Construct functions have already been called, and this function can return false to indicate failure.
Usage
virtual bool BuildDevice();
Return value
- [bool]
- True if the construction was successful, false otherwise. If a device returns false from this method, the creation of the device object will be considered to have failed, and the destructor of the device object will immediately be called.
See also
- IDevice
- BindToSystemInterface
- BindToDeviceContext
- Construct
- Plugin Model