Skip to content

Commit dbd32da

Browse files
committed
cleanup
1 parent b1186c4 commit dbd32da

File tree

12 files changed

+17
-25
lines changed

12 files changed

+17
-25
lines changed

src/viam/examples/modules/complex/client.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ int main() {
3232
dial_options.set_allow_insecure_downgrade(true); // set to false if connecting securely
3333

3434
// Uncomment and fill out your credentials details if connecting securely
35-
std::string type = "<your authentication type>";
36-
std::string payload = "<your authentication payload>";
37-
Credentials credentials(type, payload);
38-
dial_options.set_credentials(credentials);
35+
// std::string type = "<your authentication type>";
36+
// std::string payload = "<your authentication payload>";
37+
// Credentials credentials(type, payload);
38+
// dial_options.set_credentials(credentials);
3939

4040
boost::optional<DialOptions> opts(dial_options);
4141
std::string address(uri);

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ API API::traits<Gizmo>::api() {
2424
return {"viam", "component", "gizmo"};
2525
}
2626

27-
Gizmo::Gizmo(std::string name) : Component(std::move(name)) {};
27+
Gizmo::Gizmo(std::string name) : Component(std::move(name)){};
2828

2929
/* Gizmo server methods */
3030

3131
GizmoServer::GizmoServer(std::shared_ptr<ResourceManager> manager)
32-
: ResourceServer(std::move(manager)) {};
32+
: ResourceServer(std::move(manager)){};
3333

3434
grpc::Status GizmoServer::DoOne(grpc::ServerContext* context,
3535
const DoOneRequest* request,
@@ -170,9 +170,7 @@ grpc::Status GizmoServer::DoTwo(::grpc::ServerContext* context,
170170
/* Gizmo client methods */
171171

172172
GizmoClient::GizmoClient(std::string name, std::shared_ptr<grpc::Channel> channel)
173-
: Gizmo(std::move(name)),
174-
stub_(GizmoService::NewStub(channel)),
175-
channel_(std::move(channel)) {};
173+
: Gizmo(std::move(name)), stub_(GizmoService::NewStub(channel)), channel_(std::move(channel)){};
176174

177175
bool GizmoClient::do_one(std::string arg1) {
178176
return make_client_helper(this, *stub_, &StubType::DoOne)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ using namespace viam::sdk;
1414
// `validate` method that checks config validity.
1515
class MyGizmo : public Gizmo, public Reconfigurable {
1616
public:
17-
MyGizmo(std::string name, std::string arg1) : Gizmo(std::move(name)), arg1_(std::move(arg1)) {};
17+
MyGizmo(std::string name, std::string arg1) : Gizmo(std::move(name)), arg1_(std::move(arg1)){};
1818
MyGizmo(const Dependencies& deps, const ResourceConfig& cfg) : Gizmo(cfg.name()) {
1919
this->reconfigure(deps, cfg);
2020
};

src/viam/examples/modules/complex/main.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ using namespace viam::sdk;
2929
int main(int argc, char** argv) {
3030
Model mybase_model("viam", "base", "mybase");
3131

32-
std::cout << "registering resource servers\n" << std::flush;
33-
3432
// Make sure to explicity register resources with custom APIs.
3533
Registry::register_resource_server<GizmoServer>();
3634
Registry::register_resource_server<SummationServer>();
@@ -57,7 +55,6 @@ int main(int argc, char** argv) {
5755

5856
std::vector<std::shared_ptr<ModelRegistration>> mrs = {mybase_mr, mygizmo_mr, mysummation_mr};
5957
auto my_mod = std::make_shared<ModuleService>(argc, argv, mrs);
60-
std::cout << "we have created the module and gotten ready to serve\n" << std::flush;
6158
my_mod->serve();
6259

6360
return EXIT_SUCCESS;

src/viam/sdk/common/client_helper.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ class ClientHelper {
3535
static void default_rsc_(RequestType&) {}
3636
static void default_rhc_(const ResponseType&) {}
3737
static void default_ehc_(const ::grpc::Status& status) {
38-
std::cout << "error is " << status.error_details() << " " << status.error_code() << " "
39-
<< status.error_message() << "\n"
40-
<< std::flush;
4138
throw GRPCException(status);
4239
}
4340

src/viam/sdk/common/logger.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ ValueType set_get_attrib(const char* name, ValueType value) {
185185

186186
void Logger::log(const std::string& msg, log_level level, const char* filename, int line_no) const {
187187
// in case logging hasn't been initialized, let's set it up.
188+
// (RSDK-9172) This should be called from within an initializer object that handles all SDK
189+
// initialization for us.
188190
init_logging();
189191

190192
BOOST_LOG_STREAM_WITH_PARAMS(

src/viam/sdk/common/logger.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ void init_logging(std::ostream& custom_strm);
115115

116116
} // namespace sdk
117117
} // namespace viam
118-
//
119118

120119
// New macro that includes severity, filename and line number
121120
#define VIAM_SDK_CUSTOM_FORMATTED_LOG(logger, sev, msg) \

src/viam/sdk/components/component.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ namespace sdk {
1414

1515
using viam::common::v1::ResourceName;
1616

17-
Component::Component() : Resource("component") {};
17+
Component::Component() : Resource("component"){};
1818

19-
Component::Component(std::string name) : Resource(std::move(name)) {};
19+
Component::Component(std::string name) : Resource(std::move(name)){};
2020

2121
ResourceName Component::get_resource_name(std::string name) const {
2222
auto r = this->Resource::get_resource_name(name);

src/viam/sdk/config/resource.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,7 @@ viam::app::v1::ComponentConfig ResourceConfig::to_proto() const {
144144
return proto_cfg;
145145
}
146146

147-
ResourceConfig::ResourceConfig(std::string type)
148-
: api_({kRDK, type, ""}), type_(std::move(type)) {};
147+
ResourceConfig::ResourceConfig(std::string type) : api_({kRDK, type, ""}), type_(std::move(type)){};
149148

150149
} // namespace sdk
151150
} // namespace viam

src/viam/sdk/module/handler_map.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ viam::module::v1::HandlerMap HandlerMap_::to_proto() const {
3232
return proto;
3333
};
3434

35-
HandlerMap_::HandlerMap_() {};
35+
HandlerMap_::HandlerMap_(){};
3636

3737
// NOLINTNEXTLINE(readability-const-return-type)
3838
const HandlerMap_ HandlerMap_::from_proto(const viam::module::v1::HandlerMap& proto) {

0 commit comments

Comments
 (0)