This panel is available only for publishing FedItems.
When an Entity is created (either at simulation Start or during Runtime), when the (

) option is selected, the
Runtime part is called right after, with the entity pointer.
If the FedItem shall not retain the new entity, then the code must set it to NULL, otherwise, the new entity will be added to the used_by list.
Sample of code for Register:
if (!((Entity*)entity)->status ||
((Entity*)entity)->status->isType(_Unknown)) entity = NULL;
|
This panel is available only for subscribing FedItems.
Whenever a new Object is found on the Federation (Object vsTASKER is subscribing to), this part will be called.
If the

option is checked, then the discover code will automatically try to create a
"default" entity.
If you want to create another entity type, the entity pointer setting must be set in this panel before the automatic code is reached.
The Object base code is called at the requested frequency (or upon event or manual call) and the return values will tell what to do with the request to publish:
-
PROCEED: all attributes will be processed (call of all attribute code in sequence)
-
CONTINUE: same as PROCEED but the same function will be called again immediately after (and not at next cycle)
-
LEAVE: do nothing and stop looping (only way to quit a CONTINUE loop).
-
SKIP: do not proceed attributes/parameters but continue looping.
For subscribed Object the code section will be called after all attributes have been received.
Normally, it is in this section that the data of each attribute will be used and stored in the simulation environment.
Each time the code part is called, ent_idx index is increased to parse all used_by slots.
entity pointer is then usable to set the data that will be updated.
This code is called when the object is destroyed by the RTI.
Normally, putting this code is enough:
This part of the code is put just before sending the Object Attributes.
Some variables (like _userTime) can be locally modified if needed.
You can see this code in the following function of the [database_name].intfc.cpp file:
int vsTaskerAmbassador::updateObject();
|
just after the comment: // parameters user code: