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

Document ID: Generated on Thu Jul 23 10:25:22 EDT 2015 from SVN revision 155065
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)