VR-Exchange 2.7 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ddsBroker/ddsBroker/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 <ddsBroker/dllExport.h>
13 #include <vlpi/entityIdentifier.h>
14 #include <vlpi/entityType.h>
15 #include <map>
16 
17 class DtBaseEntityStateRepository;
18 
19 namespace MAKVrExchange
20 {
21 
22  namespace DtDdsBroker
23  {
24 
31  {
32  public:
33 
36  typedef std::map< DtEntityIdentifier, DtTime > entityIdContainerType;
37 
40  typedef std::map< DtEntityType, DtTime > entityTypeContainerType;
41 
46  typedef std::map< DtString, DtTime > simpleThrottleContainerType;
47 
49  DtThrottle( DtTime defaultValue = 10 );
50 
52  DtThrottle( const DtThrottle& original );
53 
55  virtual ~DtThrottle();
56 
58  DtThrottle& operator = ( const DtThrottle& rightOperand );
59 
61  bool operator == ( const DtThrottle& rightOperand ) const;
62 
64  bool operator != ( const DtThrottle& rightOperand ) const;
65 
68 
69  virtual void addEntityIdRate( const DtEntityIdentifier& id, const DtTime& time );
70 
71  virtual void addEntityIdRates( const entityIdContainerType& rates );
72  virtual void addEntityIdRates( const simpleThrottleContainerType& rates );
73 
74  virtual void addEntityTypeRate( const DtEntityType& type, const DtTime& time );
75 
76  virtual void addEntityTypeRates( const entityTypeContainerType& rates );
77  virtual void addEntityTypeRates( const simpleThrottleContainerType& rates );
78 
79  virtual void setDefaultRate( DtTime time );
80 
82 
99  virtual bool isThrottlingRateOk( const DtBaseEntityStateRepository& stateInformation,
100  const DtTime& lastTick, const DtTime& thisUpdate ) const;
101 
117  virtual bool isThrottlingRateOk( const DtTime& lastTick, const DtTime& thisUpdate ) const;
118 
129  virtual DtTime objectThrottleRate( const DtBaseEntityStateRepository& stateInformation ) const;
130 
134  virtual DtTime objectThrottleRate() const;
135 
136  protected:
137 
144 
147 
150 
153 
155 
156  };
157 
158 
159  inline void DtThrottle::addEntityIdRate( const DtEntityIdentifier& id, const DtTime& time )
160  {
161  myEntityIdThrottleSettings[ id ] = time;
162  }
163 
164  inline void DtThrottle::addEntityTypeRate( const DtEntityType& type, const DtTime& time )
165  {
166  myEntityTypeThrottleSettings[ type ] = time;
167  }
168 
169  inline void DtThrottle::setDefaultRate( DtTime time )
170  {
172  }
173 
174  }
175 }
std::map< DtEntityType, DtTime > entityTypeContainerType
A container of throttle times.
Definition: ddsBroker/ddsBroker/throttle.h:40
virtual void addEntityIdRate(const DtEntityIdentifier &id, const DtTime &time)
Definition: ddsBroker/ddsBroker/throttle.h:159
std::map< DtString, DtTime > simpleThrottleContainerType
A generic container of throttle times which is keyed on DtString.
Definition: ddsBroker/ddsBroker/throttle.h:46
entityTypeContainerType myEntityTypeThrottleSettings
Collection of Entity Types and their throttle settings.
Definition: ddsBroker/ddsBroker/throttle.h:149
std::map< DtEntityIdentifier, DtTime > entityIdContainerType
A container of throttle times.
Definition: ddsBroker/ddsBroker/throttle.h:36
Tracks and verifies throttling for different object identifiers.
Definition: ddsBroker/ddsBroker/throttle.h:30
DtTime myDefaultThrottleSetting
Default throttle setting.
Definition: ddsBroker/ddsBroker/throttle.h:152
virtual void addEntityTypeRate(const DtEntityType &type, const DtTime &time)
Definition: ddsBroker/ddsBroker/throttle.h:164
virtual void setDefaultRate(DtTime time)
Definition: ddsBroker/ddsBroker/throttle.h:169
#define DT_DLL_DDSBROKER
Definition: brokers/ddsBroker/ddsBroker/dllExport.h:20
entityIdContainerType myEntityIdThrottleSettings
Collection of Entity IDs and their throttle settings.
Definition: ddsBroker/ddsBroker/throttle.h:146

Document ID: Generated on Mon Apr 19 15:55:22 EDT 2021 from SVN revision 227909
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)