VR-Exchange 2.1 API Documentation
throttle.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2006 MÄK Technologies, Inc.** All rights reserved.
3 ******************************************************************************/
4 /*******************************************************************************
5 * $RCSfile: throttle.h,v $ $Revision: 1.6 $ $State:
6 $******************************************************************************/
7 
8 #ifndef throttle_H_
9 #define throttle_H_
10 
13 
14 /* VR-Exchange includes */
15 
16 
17 /* VR-Link includes */
18 #include <vlpi/entityIdentifier.h> //DtEntityIdentifier
19 #include <vlpi/entityType.h> //DtEntityType
20 
21 #include <map> //std::map<>
22 #include <namespace.h>
23 
24 class DtBaseEntityStateRepository;
25 
26 namespace MAKVrExchange { namespace DtTenaBroker {
27 
35 
37 {
38 
39 public:
40 
44  typedef std::map< DtEntityIdentifier, DtTime > entityIdContainerType;
45 
49  typedef std::map< DtEntityType, DtTime > entityTypeContainerType;
50 
56  typedef std::map< DtString, DtTime > simpleThrottleContainerType;
57 
59  DtThrottle( DtTime defaultValue = DtThrottle::thisDefaultValue );
60 
62  virtual ~DtThrottle();
63 
65  DtThrottle( const DtThrottle& original );
66 
68  DtThrottle &operator=( const DtThrottle& rightOperand );
69 
71  bool operator==( const DtThrottle& rightOperand ) const;
72 
74  bool operator!=( const DtThrottle& rightOperand ) const;
75 
77 
78 
79  virtual void addEntityIdRate( const DtEntityIdentifier& id, const DtTime& time );
80 
81  virtual void addEntityIdRates( const entityIdContainerType& rates );
82  virtual void addEntityIdRates( const simpleThrottleContainerType& rates );
83 
84  virtual void addEntityTypeRate( const DtEntityType& type, const DtTime& time );
85 
86  virtual void addEntityTypeRates( const entityTypeContainerType& rates );
87  virtual void addEntityTypeRates( const simpleThrottleContainerType& rates );
88 
89  virtual void setDefaultRate( DtTime& time );
90 
92 
109  virtual bool isThrottlingRateOk( const DtBaseEntityStateRepository& stateInformation,
110  const DtTime& lastTick,
111  const DtTime& thisUpdate ) const;
112 
128  virtual bool isThrottlingRateOk( const DtTime& lastTick,
129  const DtTime& thisUpdate ) const;
130 
141  virtual DtTime objectThrottleRate( const DtBaseEntityStateRepository& stateInformation ) const;
142 
146  virtual DtTime objectThrottleRate() const;
147 
149  static const DtTime thisDefaultValue;
150 
151 protected:
152 
158 
159 
162 
165 
168 
170 
171 }; //end class DtThrottle
172 
173 inline void DtThrottle::addEntityIdRate( const DtEntityIdentifier& id, const DtTime& time )
174 {
175  myEntityIdThrottleSettings[ id ] = time;
176 } //end addEntityIdRate
177 
178 inline void DtThrottle::addEntityTypeRate( const DtEntityType& type, const DtTime& time )
179 {
180  myEntityTypeThrottleSettings[ type ] = time;
181 } //end addEntityTypeRate
182 
183 inline void DtThrottle::setDefaultRate( DtTime& time )
184 {
186 } //end setDefaultRate
187 
188 }}
189 
190 #endif //end #ifndef throttle_H_

Document ID: Generated on Tue Aug 7 22:07:13 EDT 2012 from SVN revision 117874
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)