Entity functions

Updated: October 26, 2022

The ham_attach_*() functions are normally used when an entity is either already running or will be started by a HAM, and monitoring begins with the invocation of the ham_attach*() call. The HAM API also provides two functions that allow users to create placeholders for entities that are not yet running and that might be started in the future. This allows subscribers of interesting events to indicate their interest in these events, without necessarily waiting for a publisher (other entity/HAM) to create the entity.

ham_entity_t *ham_entity(const char *ename, int nd, unsigned flags);
ham_entity_t *ham_entity_node(const char *ename, const char *nodename, 
              unsigned flags);

These functions create entity placeholders with the name specified ename, on the corresponding node described by either the node identifier nd or the nodename given by nodename. Once created, these placeholders can be used to add conditions and actions to their associated entities. When a subsequent ham_attach*() call is made that references the same ename, it will fill the entity placeholder with the appropriate process ID. From that time onwards, the entity is monitored normally.