rw.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "aron_conversions.h"
5 
6 namespace armarx::aron
7 {
8  template <class ReaderT, class T>
9 
10  requires(data::isReader<ReaderT> && armarx::aron::cpp::isAronGeneratedClass<T>)
11  inline void
12  read(ReaderT& aron_r, typename ReaderT::InputType& input, T& ret)
13  {
14  ret.read(aron_r, input);
15  }
16 
17  template <class WriterT, class T>
18 
19  requires(data::isWriter<WriterT> && armarx::aron::cpp::isAronGeneratedClass<T>)
20  inline void
21  write(WriterT& aron_w,
22  const T& input,
23  typename WriterT::ReturnType& ret,
25  {
26  ret = input.write(aron_w, aron_p);
27  }
28 
29  template <class ReaderT, class DtoT, class BoT>
30 
31  requires(data::isReader<ReaderT> && armarx::aron::cpp::isAronGeneratedClass<DtoT> &&
32  !detail::DtoAndBoAreSame<DtoT, BoT>)
33  inline void
34  read(ReaderT& aron_r, typename ReaderT::InputType& input, BoT& ret)
35  {
36  DtoT aron;
37  aron.read(aron_r, input);
38 
39  armarx::fromAron(aron, ret);
40  }
41 
42  template <class WriterT, class DtoT, class BoT>
43 
44  requires(data::isWriter<WriterT> && armarx::aron::cpp::isAronGeneratedClass<DtoT> &&
45  !detail::DtoAndBoAreSame<DtoT, BoT>)
46  inline void
47  write(WriterT& aron_w,
48  const BoT& input,
49  typename WriterT::ReturnType& ret,
51  {
52  DtoT aron;
53  armarx::toAron(aron, input);
54  ret = aron.write(aron_w, aron_p);
55  }
56 } // namespace armarx::aron
armarx::aron::ret
ReaderT::InputType T & ret
Definition: rw.h:13
armarx::aron::aron_p
const T WriterT::ReturnType const armarx::aron::Path & aron_p
Definition: rw.h:24
aron_conversions.h
armarx::aron::Path
The Path class.
Definition: Path.h:35
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:23
armarx::aron::input
ReaderT::InputType & input
Definition: rw.h:12
armarx::aron::requires
requires(!aron::detail::DtoAndBoAreSame< DtoT, BoT >) void toAron(std
Definition: aron_conversions.h:129
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:138
armarx::toAron
void toAron(arondto::PackagePath &dto, const PackageFileLocation &bo)
T
float T
Definition: UnscentedKalmanFilterTest.cpp:38
AronGeneratedClass.h