Program Listing for File data_recorder.hpp
↰ Return to documentation for file (include/caret_trace/data_recorder.hpp
)
// Copyright 2021 Research Institute of Systems Planning, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "caret_trace/container_traits.hpp"
#include "caret_trace/recordable_data.hpp"
#include <functional>
#include <initializer_list>
#include <memory>
#include <shared_mutex>
#include <string>
#include <vector>
#ifndef CARET_TRACE__DATA_RECORDER_HPP_
class DataRecorder
{
public:
DataRecorder();
explicit DataRecorder(std::initializer_list<std::shared_ptr<RecordableDataInterface>> data);
explicit DataRecorder(std::vector<std::shared_ptr<RecordableDataInterface>> data);
bool finished() const;
bool is_recording() const;
size_t size() const;
std::vector<std::string> trace_points() const;
void start();
void record_next_one();
void reset();
private:
RecordableDataInterface & get_iterating();
RecordableDataInterface & get_next_iter();
void next_();
std::vector<std::shared_ptr<RecordableDataInterface>> iterables_;
};
#endif // CARET_TRACE__DATA_RECORDER_HPP_
#define CARET_TRACE__DATA_RECORDER_HPP_