Skip to content

Commit 5a3d47c

Browse files
committed
const viam channel
1 parent 67aec53 commit 5a3d47c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+69
-69
lines changed

src/viam/examples/modules/complex/gizmo/api.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ grpc::Status GizmoServer::DoTwo(::grpc::ServerContext* context,
169169

170170
/* Gizmo client methods */
171171

172-
GizmoClient::GizmoClient(std::string name, ViamChannel& channel)
172+
GizmoClient::GizmoClient(std::string name, const ViamChannel& channel)
173173
: Gizmo(std::move(name)), stub_(GizmoService::NewStub(channel.channel())), channel_(&channel) {}
174174

175175
bool GizmoClient::do_one(std::string arg1) {

src/viam/examples/modules/complex/gizmo/api.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ struct API::traits<Gizmo> {
4141
class GizmoClient : public Gizmo {
4242
public:
4343
using interface_type = Gizmo;
44-
GizmoClient(std::string name, ViamChannel& channel);
44+
GizmoClient(std::string name, const ViamChannel& channel);
4545

4646
const ViamChannel& channel() const {
4747
return *channel_;
@@ -56,7 +56,7 @@ class GizmoClient : public Gizmo {
5656
private:
5757
using StubType = GizmoService::StubInterface;
5858
std::unique_ptr<StubType> stub_;
59-
ViamChannel* channel_;
59+
const ViamChannel* channel_;
6060
};
6161

6262
// `GizmoServer` is the gRPC server implementation of a `Gizmo` component.

src/viam/examples/modules/complex/summation/api.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ grpc::Status SummationServer::Sum(grpc::ServerContext* context,
5555

5656
/* Summation client methods */
5757

58-
SummationClient::SummationClient(std::string name, ViamChannel& channel)
58+
SummationClient::SummationClient(std::string name, const ViamChannel& channel)
5959
: Summation(std::move(name)),
6060
stub_(SummationService::NewStub(channel.channel())),
6161
channel_(&channel) {}

src/viam/examples/modules/complex/summation/api.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ struct API::traits<Summation> {
4242
class SummationClient : public Summation {
4343
public:
4444
using interface_type = Summation;
45-
SummationClient(std::string name, ViamChannel& channel);
45+
SummationClient(std::string name, const ViamChannel& channel);
4646

4747
const ViamChannel& channel() const {
4848
return *channel_;
@@ -53,7 +53,7 @@ class SummationClient : public Summation {
5353
private:
5454
using StubType = SummationService::StubInterface;
5555
std::unique_ptr<StubType> stub_;
56-
ViamChannel* channel_;
56+
const ViamChannel* channel_;
5757
};
5858

5959
// `SummationServer` is the gRPC server implementation of a `Summation`

src/viam/sdk/components/private/arm_client.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace viam {
1111
namespace sdk {
1212
namespace impl {
1313

14-
ArmClient::ArmClient(std::string name, ViamChannel& channel)
14+
ArmClient::ArmClient(std::string name, const ViamChannel& channel)
1515
: Arm(std::move(name)),
1616
stub_(viam::component::arm::v1::ArmService::NewStub(channel.channel())),
1717
channel_(&channel) {}

src/viam/sdk/components/private/arm_client.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace impl {
1818
class ArmClient : public Arm {
1919
public:
2020
using interface_type = Arm;
21-
ArmClient(std::string name, ViamChannel& channel);
21+
ArmClient(std::string name, const ViamChannel& channel);
2222

2323
const ViamChannel& channel() const {
2424
return *channel_;
@@ -52,7 +52,7 @@ class ArmClient : public Arm {
5252
private:
5353
using StubType = viam::component::arm::v1::ArmService::StubInterface;
5454
std::unique_ptr<StubType> stub_;
55-
ViamChannel* channel_;
55+
const ViamChannel* channel_;
5656
};
5757

5858
} // namespace impl

src/viam/sdk/components/private/base_client.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace viam {
2424
namespace sdk {
2525
namespace impl {
2626

27-
BaseClient::BaseClient(std::string name, ViamChannel& channel)
27+
BaseClient::BaseClient(std::string name, const ViamChannel& channel)
2828
: Base(std::move(name)),
2929
stub_(viam::component::base::v1::BaseService::NewStub(channel.channel())),
3030
channel_(&channel) {}

src/viam/sdk/components/private/base_client.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace impl {
2323
class BaseClient : public Base {
2424
public:
2525
using interface_type = Base;
26-
BaseClient(std::string name, ViamChannel& channel);
26+
BaseClient(std::string name, const ViamChannel& channel);
2727

2828
const ViamChannel& channel() const {
2929
return *channel_;
@@ -62,7 +62,7 @@ class BaseClient : public Base {
6262
private:
6363
using StubType = viam::component::base::v1::BaseService::StubInterface;
6464
std::unique_ptr<StubType> stub_;
65-
ViamChannel* channel_;
65+
const ViamChannel* channel_;
6666
};
6767

6868
} // namespace impl

src/viam/sdk/components/private/board_client.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ viam::component::board::v1::PowerMode to_proto(Board::power_mode power_mode) {
5151
}
5252
}
5353

54-
BoardClient::BoardClient(std::string name, ViamChannel& channel)
54+
BoardClient::BoardClient(std::string name, const ViamChannel& channel)
5555
: Board(std::move(name)),
5656
stub_(viam::component::board::v1::BoardService::NewStub(channel.channel())),
5757
channel_(&channel) {}

src/viam/sdk/components/private/board_client.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace impl {
2121
class BoardClient : public Board {
2222
public:
2323
using interface_type = Board;
24-
BoardClient(std::string name, ViamChannel& channel);
24+
BoardClient(std::string name, const ViamChannel& channel);
2525

2626
const ViamChannel& channel() const {
2727
return *channel_;

0 commit comments

Comments
 (0)