helics  3.5.2
Probe.hpp
1 /*
2 Copyright (c) 2017-2024,
3 Battelle Memorial Institute; Lawrence Livermore National Security, LLC; Alliance for Sustainable
4 Energy, LLC. See the top-level NOTICE for additional details. All rights reserved.
5 SPDX-License-Identifier: BSD-3-Clause
6 */
7 
8 #pragma once
9 #include "../application_api/Endpoints.hpp"
10 #include "../application_api/HelicsPrimaryTypes.hpp"
11 #include "../application_api/Publications.hpp"
12 #include "helicsApp.hpp"
13 
14 #include <deque>
15 #include <map>
16 #include <memory>
17 #include <set>
18 #include <string>
19 #include <vector>
20 
21 namespace helics::apps {
22 
26 class HELICS_CXX_EXPORT Probe: public App {
27  public:
29  Probe() = default;
33  explicit Probe(std::vector<std::string> args);
38  Probe(int argc, char* argv[]);
43  Probe(std::string_view name, const FederateInfo& fedInfo);
49  Probe(std::string_view name, const std::shared_ptr<Core>& core, const FederateInfo& fedInfo);
50 
56  Probe(std::string_view name, CoreApp& core, const FederateInfo& fedInfo);
61  Probe(std::string_view name, const std::string& configString);
62 
64  Probe(Probe&& other_source) = default;
65 
67  Probe& operator=(Probe&& fed) = default;
68 
72  virtual void initialize() override;
73 
77  virtual void runTo(Time stopTime_input) override;
79  int getConnections() const { return connections; }
81  int getMessageCount() const { return messagesReceived; }
82 
83  private:
84  void runProbe();
85 
86  Endpoint endpoint;
87  int connections{0};
88  int messagesReceived{0};
89 };
90 } // namespace helics::apps
Definition: Endpoints.hpp:21
Definition: FederateInfo.hpp:29
Definition: helicsApp.hpp:32
Definition: Probe.hpp:26
Probe(Probe &&other_source)=default
Probe & operator=(Probe &&fed)=default
int getConnections() const
Definition: Probe.hpp:79
int getMessageCount() const
Definition: Probe.hpp:81
TimeRepresentation< count_time< 9 > > Time
Definition: helicsTime.hpp:27