Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API: Introduce experimental namespace to mark new api as not yet stable. #1307

Merged
merged 1 commit into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/meas_cutter/src/measurement_exporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <ecal/measurement/hdf5/writer.h>

MeasurementExporter::MeasurementExporter():
_writer(std::make_unique<eCAL::measurement::hdf5::Writer>())
_writer(std::make_unique<eCAL::experimental::measurement::hdf5::Writer>())
{
}

Expand Down
2 changes: 1 addition & 1 deletion app/meas_cutter/src/measurement_exporter.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class MeasurementExporter
std::string getRootOutputPath() const;

private:
std::unique_ptr<eCAL::measurement::base::Writer> _writer;
std::unique_ptr<eCAL::experimental::measurement::base::Writer> _writer;
std::string _current_channel_name;
std::string _output_path;
std::string _root_output_path;
Expand Down
4 changes: 2 additions & 2 deletions app/meas_cutter/src/measurement_importer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <ecal/measurement/hdf5/reader.h>

MeasurementImporter::MeasurementImporter() :
_reader(std::make_unique<eCAL::measurement::hdf5::Reader>()),
_reader(std::make_unique<eCAL::experimental::measurement::hdf5::Reader>()),
_current_opened_channel_data()
{
}
Expand Down Expand Up @@ -80,7 +80,7 @@ void MeasurementImporter::openChannel(const std::string& channel_name)
_current_opened_channel_data._channel_info.description = _reader->GetChannelDescription(channel_name);
_current_opened_channel_data._channel_info.name = channel_name;

eCAL::measurement::base::EntryInfoSet entry_info_set;
eCAL::experimental::measurement::base::EntryInfoSet entry_info_set;
_reader->GetEntriesInfo(channel_name, entry_info_set);

for (const auto& entry_info : entry_info_set)
Expand Down
2 changes: 1 addition & 1 deletion app/meas_cutter/src/measurement_importer.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class MeasurementImporter
private:
bool isEcalMeasFile(const std::string& path);
bool isProtoChannel(const std::string& channel_type);
std::unique_ptr<eCAL::measurement::base::Reader> _reader;
std::unique_ptr<eCAL::experimental::measurement::base::Reader> _reader;
eCALMeasCutterUtils::ChannelData _current_opened_channel_data;
std::string _loaded_path;
eCALMeasCutterUtils::ChannelNameSet _channel_names;
Expand Down
2 changes: 1 addition & 1 deletion app/meas_cutter/src/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,6 @@ namespace eCALMeasCutterUtils
{
ChannelInfo _channel_info;
TimestampSet _timestamps;
std::unordered_map<Timestamp, eCAL::measurement::base::EntryInfo> _timestamp_entry_info_map;
std::unordered_map<Timestamp, eCAL::experimental::measurement::base::EntryInfo> _timestamp_entry_info_map;
};
}
4 changes: 2 additions & 2 deletions app/play/play_core/src/ecal_play.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ bool EcalPlay::LoadMeasurement(const std::string& path)
{
EcalPlayLogger::Instance()->info("Loading measurement...");

std::shared_ptr<eCAL::measurement::base::Reader> measurement(std::make_shared<eCAL::measurement::hdf5::Reader>());
std::shared_ptr<eCAL::experimental::measurement::base::Reader> measurement(std::make_shared<eCAL::experimental::measurement::hdf5::Reader>());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'measurement' of type 'std::shared_ptreCAL::experimental::measurement::base::Reader' can be declared 'const' [misc-const-correctness]

Suggested change
std::shared_ptr<eCAL::experimental::measurement::base::Reader> measurement(std::make_shared<eCAL::experimental::measurement::hdf5::Reader>());
std::shared_ptr<eCAL::experimental::measurement::base::Reader> const measurement(std::make_shared<eCAL::experimental::measurement::hdf5::Reader>());


std::string meas_dir; // The directory of the measurement
std::string path_to_load; // The actual path we load the measurement from. May be a directory or a .hdf5 file
Expand Down Expand Up @@ -129,7 +129,7 @@ bool EcalPlay::LoadMeasurement(const std::string& path)
void EcalPlay::CloseMeasurement()
{
description_ = "";
play_thread_->SetMeasurement(std::shared_ptr<eCAL::measurement::base::Reader>(nullptr));
play_thread_->SetMeasurement(std::shared_ptr<eCAL::experimental::measurement::base::Reader>(nullptr));
measurement_path_ = "";
clearScenariosPath();
channel_mapping_path_ = "";
Expand Down
8 changes: 4 additions & 4 deletions app/play/play_core/src/measurement_container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <math.h>
#include <stdlib.h>

MeasurementContainer::MeasurementContainer(std::shared_ptr<eCAL::measurement::base::Reader> hdf5_meas, const std::string& meas_dir, bool use_receive_timestamp)
MeasurementContainer::MeasurementContainer(std::shared_ptr<eCAL::experimental::measurement::base::Reader> hdf5_meas, const std::string& meas_dir, bool use_receive_timestamp)
: hdf5_meas_ (hdf5_meas)
, meas_dir_ (meas_dir)
, use_receive_timestamp_ (use_receive_timestamp)
Expand All @@ -49,7 +49,7 @@ void MeasurementContainer::CreateFrameTable()
auto channel_names = hdf5_meas_->GetChannelNames();
for (auto& channel_name : channel_names)
{
eCAL::measurement::base::EntryInfoSet entry_info_set;
eCAL::experimental::measurement::base::EntryInfoSet entry_info_set;
if (hdf5_meas_->GetEntriesInfo(channel_name, entry_info_set))
{
for (auto& entry_info : entry_info_set)
Expand Down Expand Up @@ -84,7 +84,7 @@ void MeasurementContainer::CalculateEstimatedSizeForChannels()
auto channel_names = hdf5_meas_->GetChannelNames();
for (auto& channel_name : channel_names)
{
eCAL::measurement::base::EntryInfoSet entry_info_set;
eCAL::experimental::measurement::base::EntryInfoSet entry_info_set;
if (hdf5_meas_->GetEntriesInfo(channel_name, entry_info_set))
{
auto size = entry_info_set.size();
Expand Down Expand Up @@ -452,7 +452,7 @@ std::map<std::string, ContinuityReport> MeasurementContainer::CreateContinuityRe
auto channel_names = hdf5_meas_->GetChannelNames();
for (auto& channel_name : channel_names)
{
eCAL::measurement::base::EntryInfoSet entry_info_set;
eCAL::experimental::measurement::base::EntryInfoSet entry_info_set;
if (hdf5_meas_->GetEntriesInfo(channel_name, entry_info_set))
{

Expand Down
4 changes: 2 additions & 2 deletions app/play/play_core/src/measurement_container.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
class MeasurementContainer
{
public:
MeasurementContainer(std::shared_ptr<eCAL::measurement::base::Reader> hdf5_meas, const std::string& meas_dir = "", bool use_receive_timestamp = true);
MeasurementContainer(std::shared_ptr<eCAL::experimental::measurement::base::Reader> hdf5_meas, const std::string& meas_dir = "", bool use_receive_timestamp = true);
~MeasurementContainer();

void CreatePublishers();
Expand Down Expand Up @@ -108,7 +108,7 @@ class MeasurementContainer
PublisherInfo* publisher_info_;
};

std::shared_ptr<eCAL::measurement::base::Reader> hdf5_meas_;
std::shared_ptr<eCAL::experimental::measurement::base::Reader> hdf5_meas_;
std::string meas_dir_;
bool use_receive_timestamp_;

Expand Down
2 changes: 1 addition & 1 deletion app/play/play_core/src/play_thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ void PlayThread::LogChannelMapping(const std::map<std::string, std::string>& cha
//// Measurement ////
////////////////////////////////////////////////////////////////////////////////

void PlayThread::SetMeasurement(const std::shared_ptr<eCAL::measurement::base::Reader>& measurement, const std::string& path)
void PlayThread::SetMeasurement(const std::shared_ptr<eCAL::experimental::measurement::base::Reader>& measurement, const std::string& path)
{
std::unique_ptr<MeasurementContainer> new_measurment_container;

Expand Down
2 changes: 1 addition & 1 deletion app/play/play_core/src/play_thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class PlayThread : public InterruptibleThread
* @param measurement The new measurement
* @param path The (optional) path from where the measurement was loaded
*/
void SetMeasurement(const std::shared_ptr<eCAL::measurement::base::Reader>& measurement, const std::string& path = "");
void SetMeasurement(const std::shared_ptr<eCAL::experimental::measurement::base::Reader>& measurement, const std::string& path = "");

/**
* @brief Returns whether a measurement has successfully been loaded
Expand Down
2 changes: 1 addition & 1 deletion app/rec/rec_client_core/src/job/hdf5_writer_thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace eCAL
, new_topic_info_map_available_(true)
, flushing_ (false)
{
hdf5_writer_ = std::make_unique<eCAL::measurement::hdf5::Writer>();
hdf5_writer_ = std::make_unique<eCAL::experimental::measurement::hdf5::Writer>();
}

Hdf5WriterThread::~Hdf5WriterThread()
Expand Down
2 changes: 1 addition & 1 deletion app/rec/rec_client_core/src/job/hdf5_writer_thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ namespace eCAL
mutable RecHdf5JobStatus last_status_;

mutable std::mutex hdf5_writer_mutex_;
std::unique_ptr<eCAL::measurement::base::Writer> hdf5_writer_;
std::unique_ptr<eCAL::experimental::measurement::base::Writer> hdf5_writer_;


std::atomic<bool> flushing_;
Expand Down
8 changes: 4 additions & 4 deletions contrib/ecalhdf5/include/ecalhdf5/eh5_meas.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ namespace eCAL
* @param access Access type
*
**/
explicit HDF5Meas(const std::string& path, measurement::base::AccessType access = measurement::base::AccessType::RDONLY);
explicit HDF5Meas(const std::string& path, eAccessType access = RDONLY);

/**
* @brief Destructor
Expand Down Expand Up @@ -105,7 +105,7 @@ namespace eCAL
* @return true if output (eAccessType::CREATE) measurement directory structure can be accessed/created, false otherwise.
* true if input (eAccessType::RDONLY) measurement/file path was opened, false otherwise.
**/
bool Open(const std::string& path, measurement::base::AccessType access = measurement::base::AccessType::RDONLY);
bool Open(const std::string& path, eAccessType access = RDONLY);

/**
* @brief Close file
Expand Down Expand Up @@ -241,7 +241,7 @@ namespace eCAL
*
* @return true if succeeds, false if it fails
**/
bool GetEntriesInfo(const std::string& channel_name, measurement::base::EntryInfoSet& entries) const;
bool GetEntriesInfo(const std::string& channel_name, EntryInfoSet& entries) const;

/**
* @brief Gets the header info for data entries for the given channel included in given time range (begin->end)
Expand All @@ -254,7 +254,7 @@ namespace eCAL
*
* @return true if succeeds, false if it fails
**/
bool GetEntriesInfoRange(const std::string& channel_name, long long begin, long long end, measurement::base::EntryInfoSet& entries) const;
bool GetEntriesInfoRange(const std::string& channel_name, long long begin, long long end, EntryInfoSet& entries) const;

/**
* @brief Gets data size of a specific entry
Expand Down
12 changes: 6 additions & 6 deletions contrib/ecalhdf5/include/ecalhdf5/eh5_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ namespace eCAL
const std::string kChnAttrTitle ("Channels");

// Remove @eCAL6 -> backwards compatibility with old interface!
using SEntryInfo = eCAL::measurement::base::EntryInfo;
using EntryInfoSet = eCAL::measurement::base::EntryInfoSet;
using EntryInfoVect = eCAL::measurement::base::EntryInfoVect;
using eAccessType = eCAL::measurement::base::AccessType;
using eCAL::measurement::base::RDONLY;
using eCAL::measurement::base::CREATE;
using SEntryInfo = eCAL::experimental::measurement::base::EntryInfo;
using EntryInfoSet = eCAL::experimental::measurement::base::EntryInfoSet;
using EntryInfoVect = eCAL::experimental::measurement::base::EntryInfoVect;
using eAccessType = eCAL::experimental::measurement::base::AccessType;
using eCAL::experimental::measurement::base::RDONLY;
using eCAL::experimental::measurement::base::CREATE;
//!< @endcond
} // namespace eh5
} // namespace eCAL
Loading
Loading