+bool
+HLAFederate::getTimeConstrained() const
+{
+ return _timeConstrained;
+}
+
+bool
+HLAFederate::setTimeConstrained(bool timeConstrained)
+{
+ _timeConstrained = timeConstrained;
+
+ if (_rtiFederate.valid() && _rtiFederate->getJoined()) {
+ if (_timeConstrained && !_rtiFederate->getTimeConstrainedEnabled()) {
+ if (!enableTimeConstrained())
+ return false;
+ } else if (!_timeConstrained && _rtiFederate->getTimeConstrainedEnabled()) {
+ if (!disableTimeConstrained())
+ return false;
+ }
+
+ }
+
+ return true;
+}
+
+bool
+HLAFederate::getTimeConstrainedByLocalClock() const
+{
+ return _timeConstrainedByLocalClock;
+}
+
+bool
+HLAFederate::setTimeConstrainedByLocalClock(bool timeConstrainedByLocalClock)
+{
+ _timeConstrainedByLocalClock = timeConstrainedByLocalClock;
+
+ if (_rtiFederate.valid() && _rtiFederate->getJoined()) {
+ if (_timeConstrainedByLocalClock) {
+ if (!enableTimeConstrainedByLocalClock())
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool
+HLAFederate::getTimeRegulating() const
+{
+ return _timeRegulating;
+}
+
+bool
+HLAFederate::setTimeRegulating(bool timeRegulating)
+{
+ _timeRegulating = timeRegulating;
+
+ if (_rtiFederate.valid() && _rtiFederate->getJoined()) {
+ if (_timeRegulating && !_rtiFederate->getTimeRegulationEnabled()) {
+ if (!enableTimeRegulation())
+ return false;
+ } else if (!_timeRegulating && _rtiFederate->getTimeRegulationEnabled()) {
+ if (!disableTimeRegulation())
+ return false;
+ }
+
+ }
+ return true;
+}
+
+bool
+HLAFederate::setLeadTime(const SGTimeStamp& leadTime)
+{
+ if (leadTime < SGTimeStamp::fromSec(0)) {
+ SG_LOG(SG_NETWORK, SG_WARN, "Ignoring negative lead time!");
+ return false;
+ }
+
+ _leadTime = leadTime;
+
+ if (_rtiFederate.valid() && _rtiFederate->getJoined()) {
+ if (!modifyLookahead(_leadTime + SGTimeStamp::fromSec(_timeIncrement.toSecs()*0.9))) {
+ SG_LOG(SG_NETWORK, SG_WARN, "Cannot modify lookahead!");
+ return false;
+ }
+ }
+
+ return true;
+}
+
+const SGTimeStamp&
+HLAFederate::getLeadTime() const
+{
+ return _leadTime;
+}
+
+bool
+HLAFederate::setTimeIncrement(const SGTimeStamp& timeIncrement)
+{
+ if (timeIncrement < SGTimeStamp::fromSec(0)) {
+ SG_LOG(SG_NETWORK, SG_WARN, "Ignoring negative time increment!");
+ return false;
+ }
+
+ _timeIncrement = timeIncrement;
+
+ if (_rtiFederate.valid() && _rtiFederate->getJoined()) {
+ if (!modifyLookahead(_leadTime + SGTimeStamp::fromSec(_timeIncrement.toSecs()*0.9))) {
+ SG_LOG(SG_NETWORK, SG_WARN, "Cannot modify lookahead!");
+ return false;
+ }
+ }
+
+ return true;
+}
+
+const SGTimeStamp&
+HLAFederate::getTimeIncrement() const
+{
+ return _timeIncrement;
+}
+