client_proto_weighing.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #pragma once
  2. #include <library/cpp/unified_agent_client/f_maybe.h>
  3. #include <library/cpp/unified_agent_client/proto_weighing.h>
  4. namespace NUnifiedAgent::NPW {
  5. struct TMessageMetaItem: public TMessage {
  6. TMessageMetaItem()
  7. : TMessage()
  8. , Key(this)
  9. , Value(this)
  10. , SkipStart(this)
  11. , SkipLength(this)
  12. {
  13. }
  14. explicit TMessageMetaItem(TMessage* parent)
  15. : TMessage(parent)
  16. , Key(this)
  17. , Value(this)
  18. , SkipStart(this)
  19. , SkipLength(this)
  20. {
  21. }
  22. explicit TMessageMetaItem(const NUnifiedAgent::TFMaybe<TFieldLink>& link)
  23. : TMessage(link)
  24. , Key(this)
  25. , Value(this)
  26. , SkipStart(this)
  27. , SkipLength(this)
  28. {
  29. }
  30. TStringField Key;
  31. TRepeatedPtrField<TStringField> Value;
  32. TRepeatedField<ui32> SkipStart;
  33. TRepeatedField<ui32> SkipLength;
  34. };
  35. struct TDataBatch: public TMessage {
  36. TDataBatch()
  37. : TMessage()
  38. , SeqNo(this)
  39. , Timestamp(this)
  40. , Payload(this, 2)
  41. , Meta(this, 2)
  42. {
  43. }
  44. TDataBatch(TMessage* parent)
  45. : TMessage(parent)
  46. , SeqNo(this)
  47. , Timestamp(this)
  48. , Payload(this, 2)
  49. , Meta(this, 2)
  50. {
  51. }
  52. TRepeatedField<ui64> SeqNo; // 1
  53. TRepeatedField<ui64> Timestamp; // 2
  54. TRepeatedPtrField<TStringField> Payload; // 100
  55. TRepeatedPtrField<TMessageMetaItem> Meta; // 101
  56. };
  57. struct TRequest: public TMessage {
  58. TRequest()
  59. : TMessage()
  60. , DataBatch(this)
  61. {
  62. }
  63. TDataBatch DataBatch;
  64. };
  65. }