Inherited by Eaagles::Network::DisIO.
Inheritance diagram for Eaagles::Simulation::NetworkIO:


Public Types | |
| enum | TSource { EXEC, UTC } |
| enum | IoType { INPUT_NIB, OUTPUT_NIB } |
Public Member Functions | |
| NetworkIO () | |
| virtual void | inputFrame (const LCreal dt) |
| virtual void | outputFrame (const LCreal dt) |
| unsigned short | getNetworkID () const |
| virtual const Basic::LcString * | getFederateName () const |
| virtual const Basic::LcString * | getFederationName () const |
| double | getCurrentTime () |
| TSource | getTimeline () const |
| bool | isInputEnabled () const |
| bool | isOutputEnabled () const |
| bool | isRelayEnabled () const |
| virtual LCreal | getMaxEntityRange (const Nib *const nib=0) const |
| virtual LCreal | getMaxEntityRangeSquared (const Nib *const nib=0) const |
| virtual LCreal | getMaxTimeDR (const Nib *const nib=0) const |
| virtual LCreal | getMaxPositionErr (const Nib *const nib=0) const |
| virtual LCreal | getMaxOrientationErr (const Nib *const nib=0) const |
| virtual LCreal | getMaxAge (const Nib *const nib=0) const |
| const Ntm * | findEntityTypeMapper (const Nib *const nib, const IoType ioType) const |
| const Ntm * | findEntityTypeMapper (const Player *const p, const IoType ioType) const |
| bool | isNetworkInitialized () const |
| bool | didInitializationFail () const |
| virtual bool | networkInitialization () |
| Station * | getStation () |
| const Station * | getStation () const |
| Simulation * | getSimulation () |
| const Simulation * | getSimulation () const |
| unsigned short | getNewIffEventID () |
| unsigned short | getNewEmissionEventID () |
| virtual Nib * | findNib (const unsigned short playerID, const Basic::LcString *const federateName, const IoType ioType) |
| virtual Nib * | findNib (const Player *const player, const IoType ioType) |
| virtual bool | addNibToList (Nib *const nib, const IoType ioType) |
| virtual void | removeNibFromList (Nib *const nib, const IoType ioType) |
| virtual Nib * | createNewInputNib () |
| virtual Nib * | createNewOutputNib (Player *const player) |
| virtual void | destroyInputNib (Nib *const nib) |
| virtual void | destroyOutputNib (Nib *const nib) |
| virtual bool | addNib2InputList (Nib *const nib) |
| virtual Player * | createIPlayer (Nib *const nib) |
| virtual void | reset () |
Protected Member Functions | |
| unsigned int | getInputListSize () const |
| Nib * | getInputNib (const unsigned int idx) |
| const Nib * | getInputNib (const unsigned int idx) const |
| Nib ** | getInputList () |
| unsigned int | getOutputListSize () const |
| Nib ** | getOutputList () |
| Nib * | getOutputNib (const unsigned int idx) |
| const Nib * | getOutputNib (const unsigned int idx) const |
| virtual void | addInputEntityType (const Ntm *const item) |
| virtual void | addOutputEntityType (const Ntm *const item) |
| virtual void | clearInputEntityTypes () |
| virtual void | clearOutputEntityTypes () |
| virtual bool | initNetwork ()=0 |
| virtual void | processOutputList () |
| virtual void | netInputHander ()=0 |
| virtual void | processInputList ()=0 |
| virtual Nib * | nibFactory (const NetworkIO::IoType ioType)=0 |
| virtual bool | setNetworkID (const unsigned short v) |
| virtual bool | setTimeline (const TSource ts) |
| virtual bool | setMaxTimeDR (const LCreal v) |
| virtual bool | setMaxPositionErr (const LCreal v) |
| virtual bool | setMaxOrientationErr (const LCreal v) |
| virtual bool | setMaxAge (const LCreal v) |
| virtual bool | setMaxEntityRange (const LCreal v) |
| virtual bool | setFederateName (const Basic::LcString *const msg) |
| virtual bool | setFederationName (const Basic::LcString *const msg) |
| virtual bool | setSlotNetworkID (const Basic::LcNumber *const p) |
| virtual bool | setSlotFederateName (const Basic::LcString *const msg) |
| virtual bool | setSlotFederationName (const Basic::LcString *const msg) |
| virtual bool | setSlotEnableInput (const Basic::LcNumber *const p) |
| virtual bool | setSlotEnableOutput (const Basic::LcNumber *const p) |
| virtual bool | setSlotEnableRelay (const Basic::LcNumber *const p) |
| virtual bool | setSlotTimeline (const Basic::LcIdent *const p) |
| virtual bool | setSlotInputEntityTypes (const Basic::LcPairStream *const msg) |
| virtual bool | setSlotOutputEntityTypes (const Basic::LcPairStream *const msg) |
| virtual bool | setSlotMaxTimeDR (const Basic::LcTime *const msg) |
| virtual bool | setSlotMaxPositionErr (const Basic::LcDistance *const msg) |
| virtual bool | setSlotMaxOrientationErr (const Basic::LcAngle *const msg) |
| virtual bool | setSlotMaxAge (const Basic::LcTime *const msg) |
| virtual bool | setSlotMaxEntityRange (const Basic::LcDistance *const msg) |
Static Protected Attributes | |
| static const int | MAX_OBJECTS = 5000 |
Private Member Functions | |
| void | updateOutputList () |
| void | cleanupInputList () |
| Nib * | insertNewOutputNib (Player *const player) |
Static Private Member Functions | |
| static int | compareKey2Nib (const void *key, const void *nib) |
Private Attributes | |
| SPtr< Station > | station |
| SPtr< Simulation > | simulation |
| TSource | timeline |
| unsigned short | iffEventID |
| unsigned short | emEventID |
| unsigned short | netID |
| SPtr< const Basic::LcString > | federationName |
| SPtr< const Basic::LcString > | federateName |
| bool | inputFlg |
| bool | outputFlg |
| bool | relayFlg |
| bool | netInit |
| bool | netInitFail |
| LCreal | maxEntityRange |
| LCreal | maxEntityRange2 |
| LCreal | maxTimeDR |
| LCreal | maxPositionErr |
| LCreal | maxOrientationErr |
| LCreal | maxAge |
| const Ntm * | inputEntityTypes [MAX_ENTITY_TYPES] |
| unsigned int | nInputEntityTypes |
| const Ntm * | outputEntityTypes [MAX_ENTITY_TYPES] |
| unsigned int | nOutputEntityTypes |
| Nib * | inputList [MAX_OBJECTS] |
| unsigned int | nInNibs |
| Nib * | outputList [MAX_OBJECTS] |
| unsigned int | nOutNibs |
Static Private Attributes | |
| static const int | MAX_ENTITY_TYPES = 2000 |
Classes | |
| struct | NibKey |
| NIB quick lookup key. More... | |
Abstract interface class for interoperability network IO.
Derived classes manage the network unique protocols.
Notes:
1) This class manages two lists of Network Interface Blocks (NIB);
one to manage out-going players to the network and
one for manage in-coming players from the network.
2) The network ID slot (default: 1) is required when multible
interoperability networks are attached to a single application.
3) The slots inputEntityTypes and outputEntityTypes are required to
map player types to/from network unique entity types.
Slots:
networkID: ! Network ID (this interface)
federationName: ! Federation name
federateName: ! Name of this federate
enableInput: ! Input Enable: accept players from this network
enableOutput: ! Output enable: send players to this network
enableRelay: ! Relay enable: send other network players to this network
timeline: ! Source of the time line { UTC or EXEC } (default: UTC) (Basic::LcIdent)
inputEntityTypes: ! Input entity type mappers (Ntm objects that map players to entity types)
outputEntityTypes: ! Output entity type mappers (Ntm objects that entity types to players)
maxTimeDR: ! Max DR time (Basic::LcTime)
maxPositionError: ! Max DR position error (Basic::LcDistance)
maxOrientationError: ! Max DR anglular error (Basic::LcAngle)
maxAge: ! Max age (without update) of networked players (Basic::LcTime)
maxEntityRange: ! Max enity range of networked players (Basic::LcDistance)
toNet(const void* inData, void* outData, int nl, int ns)
toHost(const void* inData, void* outData, int nl, int ns)
Byte swaps 'nl' 4 byte long words, followed by 'ns' 2 byte
short words, from 'inData' to 'outData'.
Protocol (derived class) unique callbacks:
bool initNetwork() // Initialize the network
processOutputList() // Create output packets from NIB output list
netInputHander() // Handle inputs from the network
processInputList() // Update players/systems from the NIB input list
Nib* nibFactory() // Create a NIB unique to this protocol
Source of the time line.
| EXEC | Using our executive time. |
| UTC | Using Coordinated Universal Time (UTC) from the Operating System. |
| Eaagles::Simulation::NetworkIO::NetworkIO | ( | ) |
| void Eaagles::Simulation::NetworkIO::inputFrame | ( | const LCreal | dt | ) | [virtual] |
Updates the 'input' side of the network.
| void Eaagles::Simulation::NetworkIO::outputFrame | ( | const LCreal | dt | ) | [virtual] |
Updates the 'output' side of the network.
| unsigned short Eaagles::Simulation::NetworkIO::getNetworkID | ( | ) | const [inline] |
Network identifications.
| const Basic::LcString * Eaagles::Simulation::NetworkIO::getFederateName | ( | ) | const [virtual] |
Federate name as LcString.
| const Basic::LcString * Eaagles::Simulation::NetworkIO::getFederationName | ( | ) | const [virtual] |
Federation name as LcString.
| double Eaagles::Simulation::NetworkIO::getCurrentTime | ( | ) |
Current time (seconds: UTC or EXEC).
| TSource Eaagles::Simulation::NetworkIO::getTimeline | ( | ) | const [inline] |
Timeline (UTC or EXEC).
| bool Eaagles::Simulation::NetworkIO::isInputEnabled | ( | ) | const [inline] |
Network input/output enable flags True if inputs are enabled
| bool Eaagles::Simulation::NetworkIO::isOutputEnabled | ( | ) | const [inline] |
True if outputs are enabled.
| bool Eaagles::Simulation::NetworkIO::isRelayEnabled | ( | ) | const [inline] |
True if relaying is enabled.
| LCreal Eaagles::Simulation::NetworkIO::getMaxEntityRangeSquared | ( | const Nib *const | nib = 0 |
) | const [virtual] |
Entity filter: Returns max entity ranged squared (meters^2).
Reimplemented in Eaagles::Network::DisIO.
Dead-Reckoning: Returns max DR time before next 'heart beat' (seconds).
Reimplemented in Eaagles::Network::DisIO.
| LCreal Eaagles::Simulation::NetworkIO::getMaxOrientationErr | ( | const Nib *const | nib = 0 |
) | const [virtual] |
Dead-Reckoning: Returns max DR orientation error (radians).
Reimplemented in Eaagles::Network::DisIO.
Dead-Reckoning: Returns max age before a networked player is removed (seconds).
Reimplemented in Eaagles::Network::DisIO.
| const Ntm * Eaagles::Simulation::NetworkIO::findEntityTypeMapper | ( | const Nib *const | nib, | |
| const IoType | ioType | |||
| ) | const |
Finds the entity type mapper by NIB type codes.
| const Ntm * Eaagles::Simulation::NetworkIO::findEntityTypeMapper | ( | const Player *const | p, | |
| const IoType | ioType | |||
| ) | const |
Finds the entity type mapper by Player.
| bool Eaagles::Simulation::NetworkIO::isNetworkInitialized | ( | ) | const [inline] |
Initialization status access functions.
| bool Eaagles::Simulation::NetworkIO::didInitializationFail | ( | ) | const [inline] |
| bool Eaagles::Simulation::NetworkIO::networkInitialization | ( | ) | [virtual] |
startup. Init the network (usually called by updateData())
Main network initialization routine. Must be called during
| Station* Eaagles::Simulation::NetworkIO::getStation | ( | ) | [inline] |
Other eaagles components.
| const Station* Eaagles::Simulation::NetworkIO::getStation | ( | ) | const [inline] |
| Simulation* Eaagles::Simulation::NetworkIO::getSimulation | ( | ) | [inline] |
| const Simulation* Eaagles::Simulation::NetworkIO::getSimulation | ( | ) | const [inline] |
| unsigned short Eaagles::Simulation::NetworkIO::getNewIffEventID | ( | ) | [inline] |
Event IDs.
| unsigned short Eaagles::Simulation::NetworkIO::getNewEmissionEventID | ( | ) | [inline] |
| Nib * Eaagles::Simulation::NetworkIO::findNib | ( | const unsigned short | playerID, | |
| const Basic::LcString *const | federateName, | |||
| const IoType | ioType | |||
| ) | [virtual] |
NIB support.
| Nib * Eaagles::Simulation::NetworkIO::findNib | ( | const Player *const | player, | |
| const IoType | ioType | |||
| ) | [virtual] |
| void Eaagles::Simulation::NetworkIO::removeNibFromList | ( | Nib *const | nib, | |
| const IoType | ioType | |||
| ) | [virtual] |
| Nib * Eaagles::Simulation::NetworkIO::createNewInputNib | ( | ) | [virtual] |
More NIB support,Create NIBs.
Reimplemented in Eaagles::Network::DisIO.
| void Eaagles::Simulation::NetworkIO::destroyInputNib | ( | Nib *const | nib | ) | [virtual] |
Destroy NIBs.
| void Eaagles::Simulation::NetworkIO::destroyOutputNib | ( | Nib *const | nib | ) | [virtual] |
| bool Eaagles::Simulation::NetworkIO::addNib2InputList | ( | Nib *const | nib | ) | [virtual] |
Adds this 'nib' to the list of NIBs controlling network input.
based on the NIB data.
IPlayer factory, Networked player (IPlayer) factory. Create a networked player
| void Eaagles::Simulation::NetworkIO::reset | ( | ) | [virtual] |
| unsigned int Eaagles::Simulation::NetworkIO::getInputListSize | ( | ) | const [inline, protected] |
Number of NIBs on the input list.
| Nib* Eaagles::Simulation::NetworkIO::getInputNib | ( | const unsigned int | idx | ) | [inline, protected] |
Returns the idx'th NIB from the input list.
| const Nib* Eaagles::Simulation::NetworkIO::getInputNib | ( | const unsigned int | idx | ) | const [inline, protected] |
Returns the idx'th NIB from the input list (const version).
| Nib** Eaagles::Simulation::NetworkIO::getInputList | ( | ) | [inline, protected] |
Returns the input list Input/output streams (Lists of NIBs)
| unsigned int Eaagles::Simulation::NetworkIO::getOutputListSize | ( | ) | const [inline, protected] |
Number of NIBs on the output list.
| Nib** Eaagles::Simulation::NetworkIO::getOutputList | ( | ) | [inline, protected] |
Returns the input list.
| Nib* Eaagles::Simulation::NetworkIO::getOutputNib | ( | const unsigned int | idx | ) | [inline, protected] |
Returns the idx'th NIB from the output list.
| const Nib* Eaagles::Simulation::NetworkIO::getOutputNib | ( | const unsigned int | idx | ) | const [inline, protected] |
Returns the idx'th NIB from the output list (const version).
| void Eaagles::Simulation::NetworkIO::addInputEntityType | ( | const Ntm *const | item | ) | [protected, virtual] |
Type lists Adds an item to the input entity type table
| void Eaagles::Simulation::NetworkIO::addOutputEntityType | ( | const Ntm *const | item | ) | [protected, virtual] |
Adds an item to the output entity type table.
| void Eaagles::Simulation::NetworkIO::clearInputEntityTypes | ( | ) | [protected, virtual] |
Clears the input entity type table.
| void Eaagles::Simulation::NetworkIO::clearOutputEntityTypes | ( | ) | [protected, virtual] |
Clears the output entity type table.
| virtual bool Eaagles::Simulation::NetworkIO::initNetwork | ( | ) | [protected, pure virtual] |
| void Eaagles::Simulation::NetworkIO::processOutputList | ( | ) | [protected, virtual] |
Create output packets from Output-List.
| virtual void Eaagles::Simulation::NetworkIO::netInputHander | ( | ) | [protected, pure virtual] |
| virtual void Eaagles::Simulation::NetworkIO::processInputList | ( | ) | [protected, pure virtual] |
| virtual Nib* Eaagles::Simulation::NetworkIO::nibFactory | ( | const NetworkIO::IoType | ioType | ) | [protected, pure virtual] |
| bool Eaagles::Simulation::NetworkIO::setNetworkID | ( | const unsigned short | v | ) | [protected, virtual] |
Sets the Network's ID.
| bool Eaagles::Simulation::NetworkIO::setTimeline | ( | const TSource | ts | ) | [protected, virtual] |
Sets the timeline (UTC or EXEC).
| bool Eaagles::Simulation::NetworkIO::setMaxTimeDR | ( | const LCreal | v | ) | [protected, virtual] |
Sets the max dead-rec time; forces next update (sec).
| bool Eaagles::Simulation::NetworkIO::setMaxPositionErr | ( | const LCreal | v | ) | [protected, virtual] |
Sets the max positional error (meters).
| bool Eaagles::Simulation::NetworkIO::setMaxOrientationErr | ( | const LCreal | v | ) | [protected, virtual] |
Sets the max orientational error (rad).
| bool Eaagles::Simulation::NetworkIO::setMaxAge | ( | const LCreal | v | ) | [protected, virtual] |
Sets the max age; for removal (sec).
| bool Eaagles::Simulation::NetworkIO::setMaxEntityRange | ( | const LCreal | v | ) | [protected, virtual] |
Sets the max entity range (meters).
| bool Eaagles::Simulation::NetworkIO::setFederateName | ( | const Basic::LcString *const | msg | ) | [protected, virtual] |
| bool Eaagles::Simulation::NetworkIO::setFederationName | ( | const Basic::LcString *const | msg | ) | [protected, virtual] |
Sets our federate name Sets our federation name
| bool Eaagles::Simulation::NetworkIO::setSlotNetworkID | ( | const Basic::LcNumber *const | p | ) | [protected, virtual] |
Set slot routines Sets the network ID
| bool Eaagles::Simulation::NetworkIO::setSlotFederateName | ( | const Basic::LcString *const | msg | ) | [protected, virtual] |
| bool Eaagles::Simulation::NetworkIO::setSlotFederationName | ( | const Basic::LcString *const | msg | ) | [protected, virtual] |
| bool Eaagles::Simulation::NetworkIO::setSlotEnableInput | ( | const Basic::LcNumber *const | p | ) | [protected, virtual] |
Sets input enabled flag.
| bool Eaagles::Simulation::NetworkIO::setSlotEnableOutput | ( | const Basic::LcNumber *const | p | ) | [protected, virtual] |
Sets output enabled flag.
| bool Eaagles::Simulation::NetworkIO::setSlotEnableRelay | ( | const Basic::LcNumber *const | p | ) | [protected, virtual] |
Sets relay enabled flag.
| bool Eaagles::Simulation::NetworkIO::setSlotTimeline | ( | const Basic::LcIdent *const | p | ) | [protected, virtual] |
Sets the source of the time ( UTC or EXEC ).
| bool Eaagles::Simulation::NetworkIO::setSlotInputEntityTypes | ( | const Basic::LcPairStream *const | msg | ) | [protected, virtual] |
Sets the table of input entity to player mapper objects.
| bool Eaagles::Simulation::NetworkIO::setSlotOutputEntityTypes | ( | const Basic::LcPairStream *const | msg | ) | [protected, virtual] |
Sets the table of output entity to player mapper objects.
| bool Eaagles::Simulation::NetworkIO::setSlotMaxTimeDR | ( | const Basic::LcTime *const | msg | ) | [protected, virtual] |
| bool Eaagles::Simulation::NetworkIO::setSlotMaxPositionErr | ( | const Basic::LcDistance *const | msg | ) | [protected, virtual] |
| bool Eaagles::Simulation::NetworkIO::setSlotMaxOrientationErr | ( | const Basic::LcAngle *const | msg | ) | [protected, virtual] |
| bool Eaagles::Simulation::NetworkIO::setSlotMaxAge | ( | const Basic::LcTime *const | msg | ) | [protected, virtual] |
| bool Eaagles::Simulation::NetworkIO::setSlotMaxEntityRange | ( | const Basic::LcDistance *const | msg | ) | [protected, virtual] |
| void Eaagles::Simulation::NetworkIO::updateOutputList | ( | ) | [private] |
Update the Output-List from the simulation player list (Background thread).
| void Eaagles::Simulation::NetworkIO::cleanupInputList | ( | ) | [private] |
Cleanup the Input-List (remove out of date items).
| int Eaagles::Simulation::NetworkIO::compareKey2Nib | ( | const void * | key, | |
| const void * | nib | |||
| ) | [static, private] |
bsearch callbacks: object name compare function -- True types are (const NibKey* key, const Nib** nib)
const int Eaagles::Simulation::NetworkIO::MAX_OBJECTS = 5000 [static, protected] |
const int Eaagles::Simulation::NetworkIO::MAX_ENTITY_TYPES = 2000 [static, private] |
Max entity model type table size.
SPtr<Station> Eaagles::Simulation::NetworkIO::station [private] |
Our station class.
SPtr<Simulation> Eaagles::Simulation::NetworkIO::simulation [private] |
Our simulation class.
Source of our timeline.
unsigned short Eaagles::Simulation::NetworkIO::iffEventID [private] |
IFF event ID (as needed).
unsigned short Eaagles::Simulation::NetworkIO::emEventID [private] |
Emission event ID (as needed).
unsigned short Eaagles::Simulation::NetworkIO::netID [private] |
Network Model IDs Networkd ID
SPtr<const Basic::LcString> Eaagles::Simulation::NetworkIO::federationName [private] |
Federation name.
SPtr<const Basic::LcString> Eaagles::Simulation::NetworkIO::federateName [private] |
Federate name.
bool Eaagles::Simulation::NetworkIO::inputFlg [private] |
Network Model mode flags.
bool Eaagles::Simulation::NetworkIO::outputFlg [private] |
Network input enabled.
bool Eaagles::Simulation::NetworkIO::relayFlg [private] |
Network output enabled.
bool Eaagles::Simulation::NetworkIO::netInit [private] |
Network relay enabled.
bool Eaagles::Simulation::NetworkIO::netInitFail [private] |
Network has been initialized.
Max range squared from ownship (meters^2).
Dead Reckoning (DR) parameters b Maximum DR time (seconds)y entity kind/domain
Reimplemented in Eaagles::Network::DisIO.
LCreal Eaagles::Simulation::NetworkIO::maxAge [private] |
const Ntm* Eaagles::Simulation::NetworkIO::inputEntityTypes[MAX_ENTITY_TYPES] [private] |
Input entity type table Table of pointers to input entity type mappers; Ntm objects
unsigned int Eaagles::Simulation::NetworkIO::nInputEntityTypes [private] |
Number of input entity mappers (Ntm objects) in the table, 'inputEntityTypes'.
const Ntm* Eaagles::Simulation::NetworkIO::outputEntityTypes[MAX_ENTITY_TYPES] [private] |
Output entity type table Table of pointers to output entity type mappers; Ntm objects
unsigned int Eaagles::Simulation::NetworkIO::nOutputEntityTypes [private] |
Number of output entity mappers (Ntm objects) in the table, 'outputEntityTypes'.
Nib* Eaagles::Simulation::NetworkIO::inputList[MAX_OBJECTS] [private] |
input tables Table of input objects in name order
unsigned int Eaagles::Simulation::NetworkIO::nInNibs [private] |
Number of input objects in both tables.
Nib* Eaagles::Simulation::NetworkIO::outputList[MAX_OBJECTS] [private] |
output tables Table of output objects in name order
unsigned int Eaagles::Simulation::NetworkIO::nOutNibs [private] |
Number of output objects in both tables.
1.5.0