FairMQ  1.4.33
C++ Message Queuing Library and Framework
DDSTask.h
1 /********************************************************************************
2  * Copyright (C) 2019 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 
9 #ifndef FAIR_MQ_SDK_DDSTASK_H
10 #define FAIR_MQ_SDK_DDSTASK_H
11 
12 #include <fairmq/sdk/DDSCollection.h>
13 
14 #include <ostream>
15 #include <cstdint>
16 
17 namespace fair::mq::sdk
18 {
19 
24 class DDSTask
25 {
26  public:
27  using Id = std::uint64_t;
28 
29  explicit DDSTask(Id id, Id collectionId)
30  : fId(id)
31  , fCollectionId(collectionId)
32  {}
33 
34  Id GetId() const { return fId; }
35  DDSCollection::Id GetCollectionId() const { return fCollectionId; }
36 
37  friend auto operator<<(std::ostream& os, const DDSTask& task) -> std::ostream&
38  {
39  return os << "DDSTask id: " << task.fId << ", collection id: " << task.fCollectionId;
40  }
41 
42  private:
43  Id fId;
44  DDSCollection::Id fCollectionId;
45 };
46 
47 } // namespace fair::mq::sdk
48 
49 #endif /* FAIR_MQ_SDK_DDSTASK_H */

privacy