Skip to content

Commit

Permalink
iox-eclipse-iceoryx#1391 Remove 'cxx' namespace from classes in time …
Browse files Browse the repository at this point in the history
…module

Signed-off-by: Simon Hoinkis <simon.hoinkis@apex.ai>
  • Loading branch information
mossmaurice committed Feb 7, 2023
1 parent e832ccb commit 2195a43
Show file tree
Hide file tree
Showing 13 changed files with 12 additions and 27 deletions.
2 changes: 1 addition & 1 deletion iceoryx_dust/source/posix_wrapper/named_pipe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ bool NamedPipe::NamedPipeData::waitForInitialization() const noexcept
return true;
}

cxx::DeadlineTimer deadlineTimer(WAIT_FOR_INIT_TIMEOUT);
DeadlineTimer deadlineTimer(WAIT_FOR_INIT_TIMEOUT);

while (!deadlineTimer.hasExpired())
{
Expand Down
2 changes: 1 addition & 1 deletion iceoryx_hoofs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ setTimeout(5_ms); // 5 milliseconds
| class | internal | description |
|:-------------------:|:--------:|:--------------------------------------------------------------------------------------------------------------------------------------------|
|`Duration` | i | Represents the unit time, is convertible to `timespec` and `timeval`. User defined literals are available for convenience and readability. |
|`DeadlineTimer` | | Polling based timer to check for an elapsed deadline. |
|`deadline_timer | | Polling based timer to check for an elapsed deadline. |
|`adaptive_wait` | i | Building block to realize busy waiting loops with low CPU load. |
<center>
Expand Down
4 changes: 0 additions & 4 deletions iceoryx_hoofs/include/iceoryx_hoofs/cxx/deadline_timer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@

namespace iox
{
namespace cxx
{
/// @brief This offers the deadline timer functionality. It has user convenient methods to reset the timer [by default
/// it uses the intialized duration], reset timer to a customized duration, check if the timer is active and user can
/// also get to know about the remaining time before the timer goes off
Expand Down Expand Up @@ -71,8 +69,6 @@ class DeadlineTimer
iox::units::Duration m_timeToWait;
iox::units::Duration m_endTime;
};

} // namespace cxx
} // namespace iox


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@

namespace iox
{
namespace cxx
{
namespace internal
{
/// @brief Building block to implement a busy waiting loop efficiently. It
Expand Down Expand Up @@ -56,7 +54,7 @@ class adaptive_wait

/// @brief Waits in a loop in a smart wait until continueToWait returns false.
/// @param[in] continueToWait callable which returns if the wait should continue
void wait_loop(const function_ref<bool()>& continueToWait) noexcept;
void wait_loop(const cxx::function_ref<bool()>& continueToWait) noexcept;

protected:
/// @note All numbers are not accurate and are just rough estimates
Expand Down Expand Up @@ -105,7 +103,6 @@ class adaptive_wait
uint64_t m_yieldCount = 0U;
};
} // namespace internal
} // namespace cxx
} // namespace iox

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#include <chrono>
#include <cmath>
#include <iostream>
//#include <iostream>
#include <numeric>

namespace iox
Expand Down
5 changes: 1 addition & 4 deletions iceoryx_hoofs/source/cxx/adaptive_wait.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@

namespace iox
{
namespace cxx
{
namespace internal
{
constexpr std::chrono::microseconds adaptive_wait::INITIAL_WAITING_TIME;
Expand All @@ -47,13 +45,12 @@ void adaptive_wait::wait() noexcept
}
}

void adaptive_wait::wait_loop(const function_ref<bool()>& continueToWait) noexcept
void adaptive_wait::wait_loop(const cxx::function_ref<bool()>& continueToWait) noexcept
{
while (continueToWait())
{
wait();
}
}
} // namespace internal
} // namespace cxx
} // namespace iox
5 changes: 0 additions & 5 deletions iceoryx_hoofs/source/cxx/deadline_timer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@

namespace iox
{
namespace cxx
{
DeadlineTimer::DeadlineTimer(const iox::units::Duration timeToWait) noexcept
: m_timeToWait(timeToWait)
, m_endTime(getCurrentMonotonicTime() + timeToWait)
Expand Down Expand Up @@ -57,7 +55,4 @@ iox::units::Duration DeadlineTimer::getCurrentMonotonicTime() noexcept
{
return iox::units::Duration{std::chrono::steady_clock::now().time_since_epoch()};
}


} // namespace cxx
} // namespace iox
2 changes: 1 addition & 1 deletion iceoryx_hoofs/test/moduletests/test_cxx_adaptive_wait.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ using namespace ::testing;
#include <atomic>
#include <thread>

using namespace iox::cxx::internal;
using namespace iox::internal;

namespace
{
Expand Down
2 changes: 1 addition & 1 deletion iceoryx_hoofs/test/moduletests/test_cxx_deadline_timer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ using namespace ::testing;
using namespace iox::units;
using namespace iox::units::duration_literals;

using Timer = iox::cxx::DeadlineTimer;
using Timer = iox::DeadlineTimer;

class DeadlineTimer_test : public Test
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ inline uint64_t ChunkDistributor<ChunkDistributorDataType>::deliverToAllStoredQu
}

// busy waiting until every queue is served
cxx::internal::adaptive_wait adaptiveWait;
iox::internal::adaptive_wait adaptiveWait;
while (!remainingQueues.empty())
{
adaptiveWait.wait();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class IpcRuntimeInterface
TIMEOUT
};

void waitForRoudi(cxx::DeadlineTimer& timer) noexcept;
void waitForRoudi(DeadlineTimer& timer) noexcept;

RegAckResult waitForRegAck(const int64_t transmissionTimestamp) noexcept;

Expand Down
2 changes: 1 addition & 1 deletion iceoryx_posh/source/roudi/roudi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ void RouDi::shutdown() noexcept

if (m_killProcessesInDestructor)
{
cxx::DeadlineTimer finalKillTimer(m_processKillDelay);
DeadlineTimer finalKillTimer(m_processKillDelay);

m_prcMgr->requestShutdownOfAllProcesses();

Expand Down
4 changes: 2 additions & 2 deletions iceoryx_posh/source/runtime/ipc_runtime_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ IpcRuntimeInterface::IpcRuntimeInterface(const RuntimeName_t& roudiName,
return;
}

cxx::DeadlineTimer timer(roudiWaitingTimeout);
DeadlineTimer timer(roudiWaitingTimeout);

enum class RegState
{
Expand Down Expand Up @@ -181,7 +181,7 @@ size_t IpcRuntimeInterface::getShmTopicSize() noexcept
return m_shmTopicSize;
}

void IpcRuntimeInterface::waitForRoudi(cxx::DeadlineTimer& timer) noexcept
void IpcRuntimeInterface::waitForRoudi(DeadlineTimer& timer) noexcept
{
bool printWaitingWarning = true;
bool printFoundMessage = false;
Expand Down

0 comments on commit 2195a43

Please sign in to comment.