RTI Recording Service  Version 6.0.0
 All Data Structures Namespaces Files Functions Typedefs Enumerations Enumerator Groups
StorageStreamWriter.hpp
1 /*
2  * (c) Copyright, Real-Time Innovations, 2017-.
3  * All rights reserved.
4  * No duplications, whole or partial, manual or electronic, may be made
5  * without express written permission. Any such copies, or
6  * revisions thereof, must display this notice unaltered.
7  * This code contains trade secrets of Real-Time Innovations, Inc.
8  */
9 
10 #ifndef RTI_RECORDING_STORAGE_STORAGESTREAMWRITER_HPP_
11 #define RTI_RECORDING_STORAGE_STORAGESTREAMWRITER_HPP_
12 
13 #include <vector>
14 
15 #include "dds/dds.hpp"
16 
17 #include "rti/routing/detail/ForwarderUtils.hpp"
18 
19 namespace rti { namespace recording { namespace storage {
20 
29 public:
30 
31  typedef void* SamplePtr;
32  typedef void* InfoPtr;
33 
37  virtual ~StorageStreamWriter() {}
38 
50  virtual void store(
51  const std::vector<SamplePtr>& sample_seq,
52  const std::vector<InfoPtr>& info_seq) = 0;
53 };
54 
55 
64 template <typename Data, typename Info>
66 public:
67 
71  typedef Data DataRep;
75  typedef Info InfoRep;
76 
78 
83  void store(
84  const std::vector<SamplePtr>& sample_seq,
85  const std::vector<InfoPtr>& info_seq)
86  {
87  RTI_ROUTING_SAMPLE_VECTOR_COPY_PTRS(sample_seq_, sample_seq);
88  RTI_ROUTING_SAMPLE_VECTOR_COPY_PTRS(info_seq_, info_seq);
89 
90  store(sample_seq_, info_seq_);
91  }
92 
98  virtual void store(
99  const std::vector<Data *>& sample_seq,
100  const std::vector<Info *>& info_seq) = 0;
101 
106  {
107  }
108 
109 private:
110  std::vector<Data *> sample_seq_;
111  std::vector<Info *> info_seq_;
112 
113 };
114 
121 typedef TStorageStreamWriter<
122  dds::core::xtypes::DynamicData,
123  dds::sub::SampleInfo> DynamicDataStorageStreamWriter;
124 
125 
126 } } } // namespace rti::recording::storage
127 
128 #endif /* HPP_RTI_RECORDING_STORAGE_STORAGESTREAMWRITER_HPP_ */

RTI Recording Service Version 6.0.0 Copyright © Sun Mar 3 2019 Real-Time Innovations, Inc