Here's how I think it is supposed to work in HLA 1516-2010. From HLA 1516-2010, the RTI is required to provide two time representations: HLAinteger64Time
and HLAfloat64Time
(sections 12.4 and 12.11.2 of the HLA Interface Specification). To access these, you use the LogicalTimeFactoryFactory
. For example, the following code gets a HLAfloat64TimeFactory
:
HLAfloat64TimeFactory timeFactory =
(HLAfloat64TimeFactory)LogicalTimeFactoryFactory.getLogicalTimeFactory("HLAfloat64Time")
This timeFactory
instance can then be used to create HLAfloat64Time
and HLAfloat64Interval
instances:
HLAfloat64Time t = timeFactory.makeTime(3.0);
HLAfloat64Interval interval = timeFactory.makeInterval(1.0);
or, using the interfaces
LogicalTime t = timeFactory.makeTime(3.0);
LogicalTimeInterval interval = timeFactory.makeInterval(1.0);
Similar code is used for an Integer time factory.