change executor impls. to pass memory strategy to parent constructor
This commit is contained in:
parent
370cdcc733
commit
bc89a4c2f0
4 changed files with 6 additions and 3 deletions
|
@ -42,7 +42,7 @@ class Executor
|
|||
public:
|
||||
RCLCPP_MAKE_SHARED_DEFINITIONS(Executor);
|
||||
|
||||
Executor(memory_strategy::MemoryStrategy::SharedPtr ms =
|
||||
explicit Executor(memory_strategy::MemoryStrategy::SharedPtr ms =
|
||||
memory_strategy::create_default_strategy())
|
||||
: interrupt_guard_condition_(rmw_create_guard_condition()),
|
||||
memory_strategy_(ms)
|
||||
|
|
|
@ -40,7 +40,8 @@ class MultiThreadedExecutor : public executor::Executor
|
|||
public:
|
||||
RCLCPP_MAKE_SHARED_DEFINITIONS(MultiThreadedExecutor);
|
||||
|
||||
MultiThreadedExecutor()
|
||||
MultiThreadedExecutor(memory_strategy::MemoryStrategy::SharedPtr ms =
|
||||
memory_strategy::create_default_strategy()) : executor::Executor(ms)
|
||||
{
|
||||
number_of_threads_ = std::thread::hardware_concurrency();
|
||||
if (number_of_threads_ == 0) {
|
||||
|
|
|
@ -41,7 +41,8 @@ class SingleThreadedExecutor : public executor::Executor
|
|||
public:
|
||||
RCLCPP_MAKE_SHARED_DEFINITIONS(SingleThreadedExecutor);
|
||||
|
||||
SingleThreadedExecutor() {}
|
||||
SingleThreadedExecutor(memory_strategy::MemoryStrategy::SharedPtr ms =
|
||||
memory_strategy::create_default_strategy()) : executor::Executor(ms) { }
|
||||
|
||||
virtual ~SingleThreadedExecutor() {}
|
||||
|
||||
|
|
|
@ -55,6 +55,7 @@ public:
|
|||
|
||||
void ** borrow_handles(HandleType type, size_t number_of_handles)
|
||||
{
|
||||
std::cout << "static borrow handles" << std::endl;
|
||||
switch (type) {
|
||||
case HandleType::subscriber_handle:
|
||||
if (number_of_handles > max_subscribers_) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue