rw.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <map>
4 #include <memory>
5 #include <optional>
6 #include <vector>
7 
8 #include "aron_conversions.h"
10 #include "data/rw/Reader.h"
11 #include "data/rw/Writer.h"
12 
13 namespace armarx::aron
14 {
15  template <class ReaderT, class T>
16 
17  requires(data::isReader<ReaderT>&& armarx::aron::cpp::isAronGeneratedClass<T>) inline void read(
18  ReaderT& aron_r,
19  typename ReaderT::InputType& input,
20  T& ret)
21  {
22  ret.read(aron_r, input);
23  }
24 
25  template <class WriterT, class T>
26 
27  requires(data::isWriter<WriterT>&& armarx::aron::cpp::isAronGeneratedClass<
28  T>) inline void write(WriterT& aron_w,
29  const T& input,
30  typename WriterT::ReturnType& ret,
31  const armarx::aron::Path& aron_p = armarx::aron::Path())
32  {
33  ret = input.write(aron_w, aron_p);
34  }
35 
36  template <class ReaderT, class DtoT, class BoT>
37 
38  requires(
39  data::isReader<ReaderT>&& armarx::aron::cpp::isAronGeneratedClass<DtoT> &&
40  !detail::DtoAndBoAreSame<DtoT, BoT>) inline void read(ReaderT& aron_r,
41  typename ReaderT::InputType& input,
42  BoT& ret)
43  {
44  DtoT aron;
45  aron.read(aron_r, input);
46 
47  armarx::fromAron(aron, ret);
48  }
49 
50  template <class WriterT, class DtoT, class BoT>
51 
52  requires(
53  data::isWriter<WriterT>&& armarx::aron::cpp::isAronGeneratedClass<DtoT> &&
54  !detail::DtoAndBoAreSame<DtoT, BoT>) inline void write(WriterT& aron_w,
55  const BoT& input,
56  typename WriterT::ReturnType& ret,
57  const armarx::aron::Path& aron_p =
59  {
60  DtoT aron;
61  armarx::toAron(aron, input);
62  ret = aron.write(aron_w, aron_p);
63  }
64 } // namespace armarx::aron
armarx::aron::ret
ReaderT::InputType T & ret
Definition: rw.h:21
armarx::aron::aron_p
const T WriterT::ReturnType const armarx::aron::Path & aron_p
Definition: rw.h:31
Reader.h
aron_conversions.h
armarx::aron::Path
The Path class.
Definition: Path.h:36
armarx::aron
Definition: DataDisplayVisitor.cpp:5
armarx::aron::read
requires data::isReader< ReaderT > void read(ReaderT &aron_r, typename ReaderT::InputType &input, Eigen::Matrix< EigenT, rows, cols, options > &ret)
Definition: eigen.h:20
armarx::aron::input
ReaderT::InputType & input
Definition: rw.h:19
armarx::aron::requires
requires(!aron::detail::DtoAndBoAreSame< DtoT, BoT >) void toAron(std
Definition: aron_conversions.h:127
armarx::aron::cpp::isAronGeneratedClass
concept isAronGeneratedClass
Definition: AronGeneratedClass.h:60
armarx::fromAron
void fromAron(const arondto::PackagePath &dto, PackageFileLocation &bo)
armarx::aron::write
requires data::isWriter< WriterT > void write(WriterT &aron_w, const Eigen::Matrix< EigenT, rows, cols, options > &input, typename WriterT::ReturnType &ret, const armarx::aron::Path &aron_p=armarx::aron::Path())
Definition: eigen.h:134
armarx::toAron
void toAron(arondto::PackagePath &dto, const PackageFileLocation &bo)
T
float T
Definition: UnscentedKalmanFilterTest.cpp:35
Writer.h
AronGeneratedClass.h
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28