MAK RTIspy API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
networkMapCentralNode.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2016 VT MAK
3  * All rights reserved.
4  ****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include "networkMapNode.h"
13 #include <vlutil/vlString.h>
14 #include <iterator>
15 #include <vector>
16 
18 {
19 public:
20 
23 
25  virtual ~DtNetworkMapCentralNode();
26 
28  DtNetworkMapNode* addNode( int fedId,
29  const MAKRti::DtString& federationName,
30  const MAKRti::DtString& processName, const MAKRti::DtString &fedType,
31  const MAKRti::DtString& fedName, float rad );
32 
34  DtNetworkMapNode* addExecNode( int id, const MAKRti::DtString & name, float rad );
35 
37  DtNetworkMapNode* addForwarderNode( int id, const MAKRti::DtString & name,
38  int port, float rad );
39 
41  void removeForwarderNode(const MAKRti::DtString & name, int port);
42 
44  void update( float delta );
45 
47  void shutdown();
48 
50  bool searchNodes( int fedId, const MAKRti::DtString & federationName,
51  int & resultIndex );
52 
55 
58 
60  void setCentraLightweightlNode( const MAKRti::DtString& name,
61  const MAKRti::DtString& displayName,
62  int id, float radius );
63 
65  void setCentralForwarderNode( const MAKRti::DtString& name,
66  int port,
67  const MAKRti::DtString& displayName,
68  int id, float radius );
69 
70 private:
71 
74  void updatePositions( std::vector<DtNetworkMapNode *> & myNodes,
75  bool areForwarders = false );
76 
77 public:
78 
80  DtNetworkMapNode * getNode(unsigned int index);
81 
83  DtNetworkMapNode * getNodeByFederateHandle( unsigned int fedHandle,
84  const MAKRti::DtString & federationName );
85 
87  DtNetworkMapNode * getNodeByFederateName( const MAKRti::DtString & fedName,
88  const MAKRti::DtString & federationName );
89 
91  DtNetworkMapNode * getForwarderNode( unsigned int index );
92 
94  DtNetworkMapNode * getForwarderNodeByName( const MAKRti::DtString& forwarderName, int port );
95 
98  int removeNode( unsigned int fedHandle, const MAKRti::DtString & federationName );
99 
101  void clearList();
102 
104  void clearTouchedNodes();
105 
107  void searchForDeadNodes();
108 
110  inline bool drawLines() { return myShouldDrawLines; }
111 
113  inline bool drawText() { return myShouldDrawText; }
114 
116  inline unsigned int getSize() { return myNodes.size(); }
117  inline unsigned int getFwdSize() { return myForwarderNodes.size(); }
118 
120  inline const std::vector<DtNetworkMapNode*> getNodes() { return myNodes; }
121 
123  inline MAKRti::DtString getCentralNodeName() { return myName; }
124 
126  inline int getPort() { return myPort; }
127 
129  inline bool isLightweight() { return myIsLightweight; }
130 
132  inline bool hasRtiExec() { return myHasExec; }
133 
135  inline void setHasExec( bool hasAnExec ) { myHasExec = hasAnExec; }
136 
138  bool hasCentralForwarder() const;
139 
140 protected:
141 
143  inline void setIsLightweight( bool isLw ) { myIsLightweight = isLw; }
144 
146  void setCentralNodeName( const MAKRti::DtString & string ) { myName = string; }
147 
149  void setCentralNodePort(int port) { myPort = port; }
150 
152  _vec2 calcFederateDestination(int max_federates, int federate_no );
153 
154 protected:
155 
156  bool myHasExec; // has an rtiExec
157  bool myIsLightweight; // this is a lightweight connection
158  bool myShouldDrawLines; // should we draw the lines?
159  bool myShouldDrawText; // should we draw the id text?
160  bool myHasDoneShutdown; // has done a shutdown on ourselves
161  float myRadius; // the radius of this node and its children
162  MAKRti::DtString myName; // our central node name
163  int myPort; // our central node port
164  std::vector<DtNetworkMapNode *> myNodes; // our nodes
165  std::vector<DtNetworkMapNode *> myForwarderNodes; // Peer forwarders
166 
167 };

Document ID: Generated on Mon Jul 9 10:30:41 EDT 2018 from SVN revision 190224
Copyright © 2005-2018 VT MÄK Inc. All Rights Reserved (www.mak.com)