You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SID uses "resources" for code encapsulation, grouping, hierarchy and generic handling. Besides generic and shared resource-handling functions, each resource can have additional dedicated interface functions which accept a resource as an argument (of sid_resource_t * type). All these functions should check whether the type of the resource passed in is correct and error out if not (so we need to check the internal type field in sid_resource_t instance).
For example a function where we expect only a concrete single type of resource:
SID uses "resources" for code encapsulation, grouping, hierarchy and generic handling. Besides generic and shared resource-handling functions, each resource can have additional dedicated interface functions which accept a resource as an argument (of
sid_resource_t *
type). All these functions should check whether the type of the resource passed in is correct and error out if not (so we need to check the internaltype
field insid_resource_t
instance).For example a function where we expect only a concrete single type of resource:
sid_resource_t *worker_control_get_idle_worker(sid_resource_t *worker_control_res);
The
worker_control_res
here must be an instance ofsid_resource_type_worker_control
only.Another example where we allow two types of resources:
const char *worker_control_get_worker_id(sid_resource_t *res);
The
res
must be an instance of eithersid_resource_type_worker
orsid_resource_type_worker_proxy
.Similar checks should be done for any other resource which has such additional type-specific interface.
The text was updated successfully, but these errors were encountered: