VR-Exchange 2.5 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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 }

Document ID: Generated on Wed Dec 21 15:05:11 EST 2016 from SVN revision 171891
Copyright © 2005-2016 VT MÄK. All Rights Reserved (www.mak.com)