VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
automaticBackendSelector.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2021 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
9 #include <vrfutil/backend.h>
10 
11 #include <map>
12 
19 
21 {
22 public:
24  virtual ~DtAutomaticBackendSelector();
25 
26  virtual bool init(DtVrfBackendListener*);
27  virtual DtSimulationAddress backendCreationAddress(const DtEntityType& ot, const DtSimulationAddress& original);
28 
29 protected:
30  static void backedDiscoveredCallback(const DtSimulationAddress&, void*);
31  virtual void processBackendDiscovered(const DtSimulationAddress&);
32 
33  static void backedRemovedCallback(const DtSimulationAddress&, void*);
34  virtual void processBackendRemoved(const DtSimulationAddress&);
35 
36  static void backendStatusMessageCallback(const DtSimulationAddress&, void*);
37  virtual void processBackendStatusMessage(const DtSimulationAddress&);
38 
40  virtual int totalScore(const DtBackend::ObjectCounts&) const;
41 
43  virtual int score(int kind, int category) const;
44 
45 protected:
47 
48  typedef std::map<int, std::vector<DtSimulationAddress> > Scores;
50 
52  {
53  BackendStatus() : score(0), loaded(false) {};
54 
55  DtBackend::ObjectCounts objectCounts;
56  int score;
57  bool loaded;
58  };
59 
60  typedef std::map<DtString, BackendStatus> Backends;
62 };
bool loaded
Definition: automaticBackendSelector.h:57
virtual DtSimulationAddress backendCreationAddress(const DtEntityType &ot, const DtSimulationAddress &original)=0
#define DT_DLL_vrfcontrol
This file is used to determine how to build.
Definition: vrfcontrolDefines.h:28
DtVrfBackendListener * myListener
Definition: automaticBackendSelector.h:46
Backends myBackends
Definition: automaticBackendSelector.h:61
Definition: automaticBackendSelector.h:51
Scores myScores
Definition: automaticBackendSelector.h:49
std::map< DtString, BackendStatus > Backends
Definition: automaticBackendSelector.h:60
int score
Definition: automaticBackendSelector.h:56
The DtBackendSelectionHandler is a implementation class that you must subclass in order to be able to...
Definition: backendSelectorHandler.h:16
Instances of DtVrfBackendListener are used to track the status of VRF applications. The applications are tracked in a list which is keyed by their message address. For each entry, isActive is true if the application sends out a status message and isLoaded is true if the application has completed the processing of a load scenario message.
Definition: vrfBackendListener.h:79
std::map< int, std::vector< DtSimulationAddress > > Scores
Definition: automaticBackendSelector.h:48
std::map< short, int > ObjectCounts
Definition: backend.h:84
The DtAutomaticBackendSelector will choose a backend based on the fewest number of simulated objects ...
Definition: automaticBackendSelector.h:20
virtual bool init(DtVrfBackendListener *)=0

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)