ThroughputControllerDescriptor.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #ifndef _FASTDDS_RTPS_THROUGHPUT_CONTROLLER_DESCRIPTOR_H
  15. #define _FASTDDS_RTPS_THROUGHPUT_CONTROLLER_DESCRIPTOR_H
  16. #include <fastrtps/fastrtps_dll.h>
  17. #include <cstdint>
  18. namespace eprosima{
  19. namespace fastrtps{
  20. namespace rtps{
  21. /**
  22. * Descriptor for a Throughput Controller, containing all constructor information
  23. * for it.
  24. * @ingroup NETWORK_MODULE
  25. */
  26. struct ThroughputControllerDescriptor
  27. {
  28. //! Packet size in bytes that this controller will allow in a given period.
  29. uint32_t bytesPerPeriod;
  30. //! Window of time in which no more than 'bytesPerPeriod' bytes are allowed.
  31. uint32_t periodMillisecs;
  32. RTPS_DllAPI ThroughputControllerDescriptor();
  33. RTPS_DllAPI ThroughputControllerDescriptor(uint32_t size, uint32_t time);
  34. bool operator==(const ThroughputControllerDescriptor& b) const
  35. {
  36. return (this->bytesPerPeriod == b.bytesPerPeriod) &&
  37. (this->periodMillisecs == b.periodMillisecs);
  38. }
  39. };
  40. } // namespace rtps
  41. } // namespace fastrtps
  42. } // namespace eprosima
  43. #endif // THROUGHPUT_CONTROLLER_DESCRIPTOR_H