RStudio Launcher Plugin SDK  1.1.3
A software development kit for creating plugins that work the the RStudio Launcher.
ResponseTypes.hpp
1 /*
2  * ResponseTypes.hpp
3  *
4  * Copyright (C) 2020 by RStudio, PBC
5  *
6  * Unless you have received this program directly from RStudio pursuant to the terms of a commercial license agreement
7  * with RStudio, then this program is licensed to you under the following terms:
8  *
9  * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
10  * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
11  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
12  * permit persons to whom the Software is furnished to do so, subject to the following conditions:
13  *
14  * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
15  * Software.
16  *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
18  * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
20  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21  *
22  */
23 
24 #ifndef LAUNCHER_PLUGINS_RESPONSE_TYPES_HPP
25 #define LAUNCHER_PLUGINS_RESPONSE_TYPES_HPP
26 
27 #include <vector>
28 
29 #include <PImpl.hpp>
30 #include <api/Job.hpp>
31 
32 namespace rstudio {
33 namespace launcher_plugins {
34 namespace json {
35 
36 class Object;
37 
38 } // namespace json
39 } // namespace launcher_plugins
40 } // namespace rstudio
41 
42 namespace rstudio {
43 namespace launcher_plugins {
44 namespace api {
45 
49 class StreamSequenceId final
50 {
51 public:
58  StreamSequenceId(uint64_t in_requestId, uint64_t in_sequenceId);
59 
65  StreamSequenceId(const StreamSequenceId& in_other);
66 
72  StreamSequenceId(StreamSequenceId&& in_other) noexcept;
73 
77  ~StreamSequenceId() = default;
78 
87 
95  StreamSequenceId& operator=(StreamSequenceId&& in_other) noexcept;
96 
102  json::Object toJson() const;
103 
104 private:
105  PRIVATE_IMPL(m_impl);
106 };
107 
112 {
115 
118 
121 
124 };
125 
130 {
132  std::string Hostname;
133 
135  std::vector<std::string> IpAddresses;
136 };
137 
138 // Convenience typedefs.
139 typedef std::vector<StreamSequenceId> StreamSequences;
140 
141 } // namespace api
142 } // namespace launcher_plugins
143 } // namespace rstudio
144 
145 #endif
rstudio::launcher_plugins::api::NetworkInfo
Represents the network information for a job.
Definition: ResponseTypes.hpp:129
rstudio::launcher_plugins::json::Object
Class which represents a specific type of JSON Value: a JSON object.
Definition: Json.hpp:687
rstudio::launcher_plugins::api::ResourceUtilData::VirtualMem
Optional< double > VirtualMem
Definition: ResponseTypes.hpp:120
rstudio::launcher_plugins::api::NetworkInfo::Hostname
std::string Hostname
Definition: ResponseTypes.hpp:132
rstudio::launcher_plugins::api::StreamSequenceId::~StreamSequenceId
~StreamSequenceId()=default
Destructor.
rstudio::launcher_plugins::api::NetworkInfo::IpAddresses
std::vector< std::string > IpAddresses
Definition: ResponseTypes.hpp:135
rstudio::launcher_plugins::api::ResourceUtilData
Represents the current resource utilization of a job.
Definition: ResponseTypes.hpp:111
rstudio::launcher_plugins::api::ResourceUtilData::ResidentMem
Optional< double > ResidentMem
Definition: ResponseTypes.hpp:123
rstudio::launcher_plugins::api::StreamSequenceId::StreamSequenceId
StreamSequenceId(uint64_t in_requestId, uint64_t in_sequenceId)
Constructor.
rstudio::launcher_plugins::api::StreamSequenceId::operator=
StreamSequenceId & operator=(const StreamSequenceId &in_other)
Assignment operator.
rstudio::launcher_plugins::api::ResourceUtilData::CpuPercent
Optional< double > CpuPercent
Definition: ResponseTypes.hpp:114
rstudio::launcher_plugins::api::StreamSequenceId
An identifier for a MultiStreamResponse.
Definition: ResponseTypes.hpp:49
rstudio::launcher_plugins::api::ResourceUtilData::CpuSeconds
Optional< double > CpuSeconds
Definition: ResponseTypes.hpp:117
rstudio::launcher_plugins::Optional< double >
rstudio::launcher_plugins::api::StreamSequenceId::toJson
json::Object toJson() const
Converts this StreamSequenceId to a JSON Object.