HLAFederate: introduce read*ObjectModelTemplate.
Introduce read{RTI13,RTI1516,RTI1516E}ObjectModelTemplate methods. Deprecate the current readObjectModelTemplate method and provide a short term upgrade path.
This commit is contained in:
parent
37457fcb33
commit
42cc699263
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2009 - 2011 Mathias Froehlich - Mathias.Froehlich@web.de
|
// Copyright (C) 2009 - 2012 Mathias Froehlich - Mathias.Froehlich@web.de
|
||||||
//
|
//
|
||||||
// This library is free software; you can redistribute it and/or
|
// This library is free software; you can redistribute it and/or
|
||||||
// modify it under the terms of the GNU Library General Public
|
// modify it under the terms of the GNU Library General Public
|
||||||
@ -831,6 +831,27 @@ HLAFederate::readObjectModelTemplate(const std::string& objectModel,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
HLAFederate::readRTI13ObjectModelTemplate(const std::string& objectModel)
|
||||||
|
{
|
||||||
|
SG_LOG(SG_IO, SG_ALERT, "HLA version RTI13 not yet(!?) supported.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
HLAFederate::readRTI1516ObjectModelTemplate(const std::string& objectModel)
|
||||||
|
{
|
||||||
|
ObjectModelFactory objectModelFactory;
|
||||||
|
return readObjectModelTemplate(objectModel, objectModelFactory);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
HLAFederate::readRTI1516EObjectModelTemplate(const std::string& objectModel)
|
||||||
|
{
|
||||||
|
SG_LOG(SG_IO, SG_ALERT, "HLA version RTI1516E not yet(!?) supported.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
HLAObjectClass*
|
HLAObjectClass*
|
||||||
HLAFederate::getObjectClass(const std::string& name)
|
HLAFederate::getObjectClass(const std::string& name)
|
||||||
{
|
{
|
||||||
@ -849,6 +870,12 @@ HLAFederate::getObjectClass(const std::string& name) const
|
|||||||
return i->second.get();
|
return i->second.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HLAObjectClass*
|
||||||
|
HLAFederate::createObjectClass(const std::string& name)
|
||||||
|
{
|
||||||
|
return new HLAObjectClass(name, *this);
|
||||||
|
}
|
||||||
|
|
||||||
HLAInteractionClass*
|
HLAInteractionClass*
|
||||||
HLAFederate::getInteractionClass(const std::string& name)
|
HLAFederate::getInteractionClass(const std::string& name)
|
||||||
{
|
{
|
||||||
@ -884,6 +911,14 @@ HLAFederate::readObjectModel()
|
|||||||
{
|
{
|
||||||
/// Currently empty, but is called at the right time so that
|
/// Currently empty, but is called at the right time so that
|
||||||
/// the object model is present when it is needed
|
/// the object model is present when it is needed
|
||||||
|
// switch (getVersion()) {
|
||||||
|
// case RTI13:
|
||||||
|
// return readRTI13ObjectModelTemplate(getFederationObjectModel());
|
||||||
|
// case RTI1516:
|
||||||
|
// return readRTI1516ObjectModelTemplate(getFederationObjectModel());
|
||||||
|
// case RTI1516E:
|
||||||
|
// return readRTI1516EObjectModelTemplate(getFederationObjectModel());
|
||||||
|
// }
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2009 - 2011 Mathias Froehlich - Mathias.Froehlich@web.de
|
// Copyright (C) 2009 - 2012 Mathias Froehlich - Mathias.Froehlich@web.de
|
||||||
//
|
//
|
||||||
// This library is free software; you can redistribute it and/or
|
// This library is free software; you can redistribute it and/or
|
||||||
// modify it under the terms of the GNU Library General Public
|
// modify it under the terms of the GNU Library General Public
|
||||||
@ -161,7 +161,7 @@ public:
|
|||||||
/// a pending time advance is granted.
|
/// a pending time advance is granted.
|
||||||
bool processMessages();
|
bool processMessages();
|
||||||
|
|
||||||
/// Legacy tick call
|
/// Legacy tick call - deprecated
|
||||||
bool tick(const double& minimum, const double& maximum);
|
bool tick(const double& minimum, const double& maximum);
|
||||||
|
|
||||||
class ObjectModelFactory {
|
class ObjectModelFactory {
|
||||||
@ -170,7 +170,7 @@ public:
|
|||||||
{ }
|
{ }
|
||||||
|
|
||||||
virtual HLAObjectClass* createObjectClass(const std::string& name, HLAFederate& federate)
|
virtual HLAObjectClass* createObjectClass(const std::string& name, HLAFederate& federate)
|
||||||
{ return new HLAObjectClass(name, federate); }
|
{ return federate.createObjectClass(name); }
|
||||||
virtual bool subscribeObjectClass(const std::string& objectClassName, const std::string& sharing)
|
virtual bool subscribeObjectClass(const std::string& objectClassName, const std::string& sharing)
|
||||||
{ return sharing.find("Subscribe") != std::string::npos; }
|
{ return sharing.find("Subscribe") != std::string::npos; }
|
||||||
virtual bool publishObjectClass(const std::string& objectClassName, const std::string& sharing)
|
virtual bool publishObjectClass(const std::string& objectClassName, const std::string& sharing)
|
||||||
@ -182,13 +182,22 @@ public:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Read an omt xml file
|
/// Read an omt xml file - deprecated
|
||||||
bool readObjectModelTemplate(const std::string& objectModel,
|
bool readObjectModelTemplate(const std::string& objectModel,
|
||||||
ObjectModelFactory& objectModelFactory);
|
ObjectModelFactory& objectModelFactory);
|
||||||
|
|
||||||
|
/// Read an rti1.3 omt xml file
|
||||||
|
bool readRTI13ObjectModelTemplate(const std::string& objectModel);
|
||||||
|
/// Read an rti1516 omt xml file
|
||||||
|
bool readRTI1516ObjectModelTemplate(const std::string& objectModel);
|
||||||
|
/// Read an rti1516e omt xml file
|
||||||
|
bool readRTI1516EObjectModelTemplate(const std::string& objectModel);
|
||||||
|
|
||||||
/// Get the object class of a given name
|
/// Get the object class of a given name
|
||||||
HLAObjectClass* getObjectClass(const std::string& name);
|
HLAObjectClass* getObjectClass(const std::string& name);
|
||||||
const HLAObjectClass* getObjectClass(const std::string& name) const;
|
const HLAObjectClass* getObjectClass(const std::string& name) const;
|
||||||
|
/// Default create function. Creates a default object class
|
||||||
|
virtual HLAObjectClass* createObjectClass(const std::string& name);
|
||||||
|
|
||||||
/// Get the interaction class of a given name
|
/// Get the interaction class of a given name
|
||||||
HLAInteractionClass* getInteractionClass(const std::string& name);
|
HLAInteractionClass* getInteractionClass(const std::string& name);
|
||||||
|
Loading…
Reference in New Issue
Block a user