openlvc / portico

Portico is an open source, cross-platform, fully supported HLA RTI implementation. Designed with modularity and flexibility in mind, Portico is a production-grade RTI for the Simulation and Training Community, so come say hi!
http://www.porticoproject.org
151 stars 81 forks source link

Adds new centralized MomManager and initial support for MOM interactions #270

Closed michaelrfraser closed 6 years ago

michaelrfraser commented 6 years ago

This commit contains work for Portico tickets #229, #230 and #238

Centralized MomManager (#230)

A MomManager for the new centralized RTI has been put in place. The instance lives within the RTI's Federation class and creates a HLAfederation object instance that mirrors it. As federates join, new HLAfederate object instances are added to the Federation's object Repository, so that ordinary federates can discover them.

The RTI handler code for RequestObjectUpdate has been modified to route requests for any HLAFederation or HLAFederate objects to the MomManager which will generate an appropriate ReflectAttributeValues message for them (ordinarily these requests would be forwarded to the federate that owns the objects).

Code to serialize the values of all previously supported HLAFederation and HLAFederate attributes has been ported over. In some cases the encoding needed to be fixed to be standard compliant (Handles and Time Values are actually HLAvariableArrays of HLAbyte not just a plain HLAinteger64BE etc.

I've also added metric tracking for the following Federate attributes:

All of these metrics are contained in the class FederateMetrics, which is saved against the RTI Federate object. While these weren't part of the original request, they are essential for the subsequent MOM Request/Report interactions that need to be implemented, so it felt like an appropriate time to add them.

The Mom object has been significantly reworked to support the nested nature of MOM interactions, and to allow for a cross-version name lookup. Both object and interactions have been updated to the new system and unit tests have been updated accordingly.

Everything looks to be working ok using the test federate that Tim provided.

MOM Support for request/report synchronization point status (#238)

This task involved creating a framework for the processing of MOM request interactions. All SendInteraction message that the RTI hears about are forwarded to the MomSendInteractionHandler which inspects the handle of the interaction and passes it onto a relevant processor.

Decoding of request parameter values is taken care of by the framework. The handler then compiles response parameters, and then asks the framework to encode them and send the response.

If an exception is raised during the processing of the request (e.g. missing parameters, invalid parameters) the processor raises a MomException which the framework reports back to the Federate through the HLAreportMOMexception interaction.

Using this framework I've implemented the following request/response interaction pairs

michaelrfraser commented 6 years ago

PS: I have no idea how the two header files got in there. I think it may have been line ending changes from Brady's C++ Datatype work. I could not for the life of me revert them, and I was hoping the squash would cancel them out :(

timpokorny commented 6 years ago

Approved and merging. I hate cross-spec naming.