osa_tracker_control osa_tracker_state_notification
API Reference Manual  /  7 Simulator-to-Simulator Interfaces  / 

osa_tracker_state_admin

Description

begin is called from the tracker to start a transaction when modifying an entity in the node tree. The tracker argument specifies the tracker object for which the updates are done for. The initiator argument specifies the processor that initiated the transaction, this can be nil if it was not a processor that caused the transaction to begin, when enabling the tracker as an example. The initiator is passed as an argument to the tracker_updated function in the osa_mapper_admin interface. The function returns an ID that is used when calling end.

end is called from the tracker to end a transaction. This should be called at the end of a transaction when all entity modifications are done. The transaction_id argument should be the value returned from begin that started the transaction. Stacked calls to begin and end are possible, then the transaction will be ended when the first begin is ended. The begin methods must be ended in the opposite order that they were called. For stacked calls to begin only the initiator of the first call to begin will be used.

add adds a new entity with ID entity_id to the node tree. The new entity's attributes are set in the attributes argument, which is a dictionary.

remove removes the entity with ID entity_id for the current tracker from the node tree.

remove_all removes all entities for the current tracker from the node tree.

set_attribute adds or updates an attribute key for the entity with ID entity_id. The new value is specified in val.

update updates or adds one or more attributes for the entity with ID entity_id. The attributes argument is a dictionary with the attributes to be updated.

In order to remove a property, set the property value to nil when calling update or set_attribute.

event registers a new event, associated with the given entity_id argument. The event_name argument is the name of the event. The event_data argument is the data associated with the event and it is up to the responsible tracker to document its exact form. An event differes from other properties in the way that they are not persistent.

Entity attributes have the limitation that the value of the attribute can not be of type data or dictionary. The keys of entity attributes must be of string type.

SIM_INTERFACE(osa_tracker_state_admin) {
        transaction_id_t (*begin)(conf_object_t *NOTNULL obj,
                                  conf_object_t *NOTNULL tracker,
                                  conf_object_t *initiator);
        void (*end)(conf_object_t *NOTNULL obj, transaction_id_t txid);
        void (*add)(conf_object_t *NOTNULL obj, entity_id_t entity_id,
                    attr_value_t attributes);
        void (*remove)(conf_object_t *NOTNULL obj, entity_id_t entity_id);
        void (*remove_all)(conf_object_t *NOTNULL obj);
        void (*set_attribute)(conf_object_t *NOTNULL obj, entity_id_t entity_id,
                              const char *key, attr_value_t val);
        void (*update)(conf_object_t *NOTNULL obj, entity_id_t entity_id,
                       attr_value_t attributes);
        void (*event)(conf_object_t *NOTNULL obj, entity_id_t entity_id,
                      const char *event_name, attr_value_t event_data);
};

#define OSA_TRACKER_STATE_ADMIN_INTERFACE "osa_tracker_state_admin"

Execution Context
Cell Context for all methods.

osa_tracker_control osa_tracker_state_notification