version_message.cpp
Go to the documentation of this file.
1 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
2 
3 // -- BEGIN LICENSE BLOCK ----------------------------------------------
4 // Copyright 2019 FZI Forschungszentrum Informatik (ur_robot_driver)
5 // Copyright 2017, 2018 Simon Rasmussen (refactor)
6 //
7 // Copyright 2015, 2016 Thomas Timm Andersen (original version)
8 //
9 // Licensed under the Apache License, Version 2.0 (the "License");
10 // you may not use this file except in compliance with the License.
11 // You may obtain a copy of the License at
12 //
13 // http://www.apache.org/licenses/LICENSE-2.0
14 //
15 // Unless required by applicable law or agreed to in writing, software
16 // distributed under the License is distributed on an "AS IS" BASIS,
17 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 // See the License for the specific language governing permissions and
19 // limitations under the License.
20 // -- END LICENSE BLOCK ------------------------------------------------
21 
22 //----------------------------------------------------------------------
29 //----------------------------------------------------------------------
30 
31 #include "ur_client_library/log.h"
34 
35 namespace urcl
36 {
37 namespace primary_interface
38 {
40 {
45  bp.parse(svn_version_);
46  bp.parse(build_number_);
48 
49  return true; // not really possible to check dynamic size packets
50 }
51 
53 {
54  return consumer.consume(*this);
55 }
56 
57 std::string VersionMessage::toString() const
58 {
59  std::stringstream ss;
60  ss << "project name: " << project_name_ << std::endl;
61  ss << "version: " << unsigned(major_version_) << "." << unsigned(minor_version_) << "." << svn_version_ << std::endl;
62  ss << "build date: " << build_date_;
63 
64  return ss.str();
65 }
66 } // namespace primary_interface
67 } // namespace urcl
void parse(T &val)
Parses the next bytes as given type.
Definition: bin_parser.h:139
virtual bool parseWith(comm::BinParser &bp)
Sets the attributes of the package by parsing a serialized representation of the package.
virtual std::string toString() const
Produces a human readable representation of the package object.
void parseRemainder(std::string &val)
Parses the remaining bytes as a string.
Definition: bin_parser.h:255
The BinParser class handles a byte buffer and functionality to iteratively parse the content...
Definition: bin_parser.h:44
virtual bool consume(std::shared_ptr< PrimaryPackage > product) final
This consume method is usally being called by the Pipeline structure. We don&#39;t necessarily need to kn...
virtual bool consumeWith(AbstractPrimaryConsumer &consumer)
Consume this package with a specific consumer.


ur_client_library
Author(s): Thomas Timm Andersen, Simon Rasmussen, Felix Exner, Lea Steffen, Tristan Schnell
autogenerated on Sun May 9 2021 02:16:26