WebLVC 1.7d API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
tenaBroker/tenaBroker/throttle.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2013 VT MAK
3  * All rights reserved.
4  ****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include "dllExport.h"
13 
14 #include <vlpi/entityIdentifier.h>
15 #include <vlpi/entityType.h>
16 
17 #include <map>
18 
19 class DtBaseEntityStateRepository;
20 
21 namespace MAKVrExchange
22 {
23 
24  namespace DtTenaBroker
25  {
26 
35  {
36  public:
37 
41  typedef std::map< DtEntityIdentifier, DtTime > entityIdContainerType;
42 
46  typedef std::map< DtEntityType, DtTime > entityTypeContainerType;
47 
53  typedef std::map< DtString, DtTime > simpleThrottleContainerType;
54 
56  DtThrottle( DtTime defaultValue = DtThrottle::thisDefaultValue );
57 
59  virtual ~DtThrottle();
60 
62  DtThrottle( const DtThrottle& original );
63 
65  DtThrottle &operator=( const DtThrottle& rightOperand );
66 
68  bool operator==( const DtThrottle& rightOperand ) const;
69 
71  bool operator!=( const DtThrottle& rightOperand ) const;
72 
74 
75 
76  virtual void addEntityIdRate( const DtEntityIdentifier& id, const DtTime& time );
77 
78  virtual void addEntityIdRates( const entityIdContainerType& rates );
79  virtual void addEntityIdRates( const simpleThrottleContainerType& rates );
80 
81  virtual void addEntityTypeRate( const DtEntityType& type, const DtTime& time );
82 
83  virtual void addEntityTypeRates( const entityTypeContainerType& rates );
84  virtual void addEntityTypeRates( const simpleThrottleContainerType& rates );
85 
86  virtual void setDefaultRate( DtTime& time );
87 
89 
106  virtual bool isThrottlingRateOk( const DtBaseEntityStateRepository& stateInformation,
107  const DtTime& lastTick,
108  const DtTime& thisUpdate ) const;
109 
125  virtual bool isThrottlingRateOk( const DtTime& lastTick,
126  const DtTime& thisUpdate ) const;
127 
138  virtual DtTime objectThrottleRate( const DtBaseEntityStateRepository& stateInformation ) const;
139 
143  virtual DtTime objectThrottleRate() const;
144 
146  static const DtTime thisDefaultValue;
147 
148  protected:
149 
155 
156 
159 
162 
165 
167 
168  }; //end class DtThrottle
169 
170  inline void DtThrottle::addEntityIdRate( const DtEntityIdentifier& id, const DtTime& time )
171  {
172  myEntityIdThrottleSettings[ id ] = time;
173  } //end addEntityIdRate
174 
175  inline void DtThrottle::addEntityTypeRate( const DtEntityType& type, const DtTime& time )
176  {
177  myEntityTypeThrottleSettings[ type ] = time;
178  } //end addEntityTypeRate
179 
180  inline void DtThrottle::setDefaultRate( DtTime& time )
181  {
183  } //end setDefaultRate
184 
185  }
186 }
static const DtTime thisDefaultValue
The default throttling rate in Hz.
Definition: tenaBroker/tenaBroker/throttle.h:146
virtual void setDefaultRate(DtTime &time)
Definition: tenaBroker/tenaBroker/throttle.h:180
#define DT_DLL_TENABROKER
Definition: brokers/tenaBroker/tenaBroker/dllExport.h:26
virtual void addEntityIdRate(const DtEntityIdentifier &id, const DtTime &time)
Definition: tenaBroker/tenaBroker/throttle.h:170
DtTime myDefaultThrottleSetting
Default throttle setting.
Definition: tenaBroker/tenaBroker/throttle.h:164
std::map< DtString, DtTime > simpleThrottleContainerType
A generic container of throttle times which is keyed on DtString.
Definition: tenaBroker/tenaBroker/throttle.h:53
Tracks and verifies throttling for different object identifiers.
Definition: tenaBroker/tenaBroker/throttle.h:34
entityTypeContainerType myEntityTypeThrottleSettings
Collection of Entity Types and their throttle settings.
Definition: tenaBroker/tenaBroker/throttle.h:161
entityIdContainerType myEntityIdThrottleSettings
Collection of Entity IDs and their throttle settings.
Definition: tenaBroker/tenaBroker/throttle.h:158
virtual void addEntityTypeRate(const DtEntityType &type, const DtTime &time)
Definition: tenaBroker/tenaBroker/throttle.h:175
std::map< DtEntityIdentifier, DtTime > entityIdContainerType
A container of throttle times.
Definition: tenaBroker/tenaBroker/throttle.h:41
std::map< DtEntityType, DtTime > entityTypeContainerType
A container of throttle times.
Definition: tenaBroker/tenaBroker/throttle.h:46

Document ID: Generated on Wed Jun 21 15:05:44 EDT 2023 from SVN revision 256253
Copyright © 2005-2023 MAK Technologies. All Rights Reserved (www.mak.com)