summaryrefslogtreecommitdiff
path: root/ACE/Kokyu
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2020-12-17 13:17:31 +0100
committerJohnny Willemsen <jwillemsen@remedy.nl>2020-12-17 13:17:31 +0100
commita466e4133b6de32437a27c2694edaeedf5a6d90c (patch)
tree314454b0bd1cbdf20980a804127e86df7524ff25 /ACE/Kokyu
parent0cc148c86d67af7cc179e44f4c67a12dae60ac5b (diff)
downloadATCD-a466e4133b6de32437a27c2694edaeedf5a6d90c.tar.gz
Replace auto_ptr with std::unique_ptr and remove redundant void
* ACE/Kokyu/Default_Dispatcher_Impl.cpp: * ACE/Kokyu/Default_Dispatcher_Impl.h: * ACE/Kokyu/Dispatcher_Task.cpp: * ACE/Kokyu/Dispatcher_Task.h: * ACE/Kokyu/Kokyu.cpp: * ACE/Kokyu/Kokyu.h: * ACE/Kokyu/Kokyu_defs.cpp: * ACE/Kokyu/Kokyu_defs.h: * ACE/Kokyu/Kokyu_dsrt.cpp: * ACE/Kokyu/Kokyu_dsrt.h: * ACE/Kokyu/tests/EDF/test.cpp: * ACE/Kokyu/tests/FIFO/README: * ACE/Kokyu/tests/FIFO/test.cpp: * ACE/ace/Get_Opt.h: * ACE/ace/Get_Opt.inl: * ACE/ace/Malloc_T.cpp: * ACE/ace/Malloc_T.h: * ACE/ace/Malloc_T.inl: * ACE/ace/Sched_Params.h: * ACE/ace/Sched_Params.inl:
Diffstat (limited to 'ACE/Kokyu')
-rw-r--r--ACE/Kokyu/Default_Dispatcher_Impl.cpp6
-rw-r--r--ACE/Kokyu/Default_Dispatcher_Impl.h2
-rw-r--r--ACE/Kokyu/Dispatcher_Task.cpp2
-rw-r--r--ACE/Kokyu/Dispatcher_Task.h2
-rw-r--r--ACE/Kokyu/Kokyu.cpp6
-rw-r--r--ACE/Kokyu/Kokyu.h5
-rw-r--r--ACE/Kokyu/Kokyu_defs.cpp2
-rw-r--r--ACE/Kokyu/Kokyu_defs.h4
-rw-r--r--ACE/Kokyu/Kokyu_dsrt.cpp4
-rw-r--r--ACE/Kokyu/Kokyu_dsrt.h4
-rw-r--r--ACE/Kokyu/tests/EDF/test.cpp5
-rw-r--r--ACE/Kokyu/tests/FIFO/README2
-rw-r--r--ACE/Kokyu/tests/FIFO/test.cpp5
13 files changed, 25 insertions, 24 deletions
diff --git a/ACE/Kokyu/Default_Dispatcher_Impl.cpp b/ACE/Kokyu/Default_Dispatcher_Impl.cpp
index 29d6ef1a9be..30709efe3f0 100644
--- a/ACE/Kokyu/Default_Dispatcher_Impl.cpp
+++ b/ACE/Kokyu/Default_Dispatcher_Impl.cpp
@@ -1,5 +1,7 @@
#include "Default_Dispatcher_Impl.h"
+
#include "ace/Sched_Params.h"
+#include <utility>
#if ! defined (__ACE_INLINE__)
#include "Default_Dispatcher_Impl.inl"
@@ -50,8 +52,8 @@ Default_Dispatcher_Impl::init_i (const Dispatcher_Attributes& attrs)
Dispatcher_Task (*config,
ACE_Thread_Manager::instance()),
-1);
- auto_ptr<Dispatcher_Task> tmp_task_auto_ptr (task);
- tasks_[i++] = tmp_task_auto_ptr;
+ std::unique_ptr<Dispatcher_Task> tmp_task_auto_ptr (task);
+ tasks_[i++] = std::move(tmp_task_auto_ptr);
//I couldn't use reset because MSVC6 auto_ptr does not have reset method.
//So in configurations where the auto_ptr maps to the std::auto_ptr instead
//of ACE auto_ptr, this would be a problem.
diff --git a/ACE/Kokyu/Default_Dispatcher_Impl.h b/ACE/Kokyu/Default_Dispatcher_Impl.h
index 9d9c4c3f6bf..32a790e0d65 100644
--- a/ACE/Kokyu/Default_Dispatcher_Impl.h
+++ b/ACE/Kokyu/Default_Dispatcher_Impl.h
@@ -48,7 +48,7 @@ namespace Kokyu
Dispatcher_Task* find_task_with_preemption_prio (Priority_t);
private:
- typedef auto_ptr<Dispatcher_Task> Dispatcher_Task_Auto_Ptr;
+ typedef std::unique_ptr<Dispatcher_Task> Dispatcher_Task_Auto_Ptr;
ACE_Auto_Array_Ptr<Dispatcher_Task_Auto_Ptr> tasks_;
int ntasks_;
ConfigInfoSet curr_config_info_;
diff --git a/ACE/Kokyu/Dispatcher_Task.cpp b/ACE/Kokyu/Dispatcher_Task.cpp
index 07857091e60..b128dcab6bf 100644
--- a/ACE/Kokyu/Dispatcher_Task.cpp
+++ b/ACE/Kokyu/Dispatcher_Task.cpp
@@ -66,7 +66,7 @@ Dispatcher_Task::initialize ()
}
int
-Dispatcher_Task::svc (void)
+Dispatcher_Task::svc ()
{
int done = 0;
diff --git a/ACE/Kokyu/Dispatcher_Task.h b/ACE/Kokyu/Dispatcher_Task.h
index d565be94f5d..ca602ca2be7 100644
--- a/ACE/Kokyu/Dispatcher_Task.h
+++ b/ACE/Kokyu/Dispatcher_Task.h
@@ -69,7 +69,7 @@ public:
const QoSDescriptor& qos_info);
/// Process the events in the queue.
- int svc (void);
+ int svc ();
const ConfigInfo& get_curr_config_info() const;
Priority_t preemption_priority() const;
diff --git a/ACE/Kokyu/Kokyu.cpp b/ACE/Kokyu/Kokyu.cpp
index 5c1f4fe9d17..1f89b5f712b 100644
--- a/ACE/Kokyu/Kokyu.cpp
+++ b/ACE/Kokyu/Kokyu.cpp
@@ -1,5 +1,7 @@
#include "Kokyu.h"
+#include <utility>
+
#include "Default_Dispatcher_Impl.h"
#if ! defined (__ACE_INLINE__)
@@ -26,8 +28,8 @@ int Dispatcher::activate ()
void Dispatcher::implementation (Dispatcher_Impl* impl)
{
- auto_ptr<Dispatcher_Impl> tmp_impl (impl);
- dispatcher_impl_ = tmp_impl;
+ std::unique_ptr<Dispatcher_Impl> tmp_impl (impl);
+ dispatcher_impl_ = std::move(tmp_impl);
//I couldn't use reset because MSVC++ auto_ptr does not have reset method.
//So in configurations where the auto_ptr maps to the std::auto_ptr instead
diff --git a/ACE/Kokyu/Kokyu.h b/ACE/Kokyu/Kokyu.h
index 086f95eb67b..119d9827195 100644
--- a/ACE/Kokyu/Kokyu.h
+++ b/ACE/Kokyu/Kokyu.h
@@ -17,6 +17,7 @@
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
+#include <utility>
#include "kokyu_export.h"
#include "Kokyu_defs.h"
@@ -74,10 +75,10 @@ namespace Kokyu
private:
/// Auto ptr to the implementation. Implementation will be created on the
/// heap and deleted automatically when the dispatcher object is destructed.
- auto_ptr<Dispatcher_Impl> dispatcher_impl_;
+ std::unique_ptr<Dispatcher_Impl> dispatcher_impl_;
};
- typedef auto_ptr<Dispatcher> Dispatcher_Auto_Ptr;
+ typedef std::unique_ptr<Dispatcher> Dispatcher_Auto_Ptr;
/**
* @class Dispatcher_Factory
diff --git a/ACE/Kokyu/Kokyu_defs.cpp b/ACE/Kokyu/Kokyu_defs.cpp
index afda89b8016..e474da88d0b 100644
--- a/ACE/Kokyu/Kokyu_defs.cpp
+++ b/ACE/Kokyu/Kokyu_defs.cpp
@@ -6,7 +6,7 @@
namespace Kokyu
{
- Dispatch_Command::~Dispatch_Command (void)
+ Dispatch_Command::~Dispatch_Command ()
{
}
diff --git a/ACE/Kokyu/Kokyu_defs.h b/ACE/Kokyu/Kokyu_defs.h
index e0942a97845..409991c9670 100644
--- a/ACE/Kokyu/Kokyu_defs.h
+++ b/ACE/Kokyu/Kokyu_defs.h
@@ -134,12 +134,12 @@ namespace Kokyu
int can_be_deleted () const;
- void destroy (void);
+ void destroy ();
protected:
/// Destructor
// only inheritance is possible and object should be on heap,
// since object could be handed over to a different thread.
- virtual ~Dispatch_Command (void);
+ virtual ~Dispatch_Command ();
private:
int dont_delete_;
diff --git a/ACE/Kokyu/Kokyu_dsrt.cpp b/ACE/Kokyu/Kokyu_dsrt.cpp
index 604e3c57d48..5832b22dd03 100644
--- a/ACE/Kokyu/Kokyu_dsrt.cpp
+++ b/ACE/Kokyu/Kokyu_dsrt.cpp
@@ -15,8 +15,8 @@ template <class DSRT_Scheduler_Traits>
void
DSRT_Dispatcher<DSRT_Scheduler_Traits>::implementation (DSRT_Dispatcher_Impl<DSRT_Scheduler_Traits>* impl)
{
- auto_ptr<DSRT_Dispatcher_Impl<DSRT_Scheduler_Traits> > tmp_impl (impl);
- dispatcher_impl_ = tmp_impl;
+ std::unique_ptr<DSRT_Dispatcher_Impl<DSRT_Scheduler_Traits> > tmp_impl (impl);
+ dispatcher_impl_ = std::move(tmp_impl);
}
template <class DSRT_Scheduler_Traits>
diff --git a/ACE/Kokyu/Kokyu_dsrt.h b/ACE/Kokyu/Kokyu_dsrt.h
index 0c00c1f346c..6cba50c3d68 100644
--- a/ACE/Kokyu/Kokyu_dsrt.h
+++ b/ACE/Kokyu/Kokyu_dsrt.h
@@ -67,7 +67,7 @@ namespace Kokyu
private:
/// Auto ptr to the implementation. Implementation will be created on the
/// heap and deleted automatically when the dispatcher object is destructed.
- auto_ptr<DSRT_Dispatcher_Impl<DSRT_Scheduler_Traits> > dispatcher_impl_;
+ std::unique_ptr<DSRT_Dispatcher_Impl<DSRT_Scheduler_Traits> > dispatcher_impl_;
};
@@ -85,7 +85,7 @@ namespace Kokyu
class DSRT_Dispatcher_Factory : private ACE_Copy_Disabled
{
public:
- typedef auto_ptr<DSRT_Dispatcher<DSRT_Scheduler_Traits> > DSRT_Dispatcher_Auto_Ptr;
+ typedef std::unique_ptr<DSRT_Dispatcher<DSRT_Scheduler_Traits> > DSRT_Dispatcher_Auto_Ptr;
/**
* Create a dispatcher for dynamic dispatching of threads.
diff --git a/ACE/Kokyu/tests/EDF/test.cpp b/ACE/Kokyu/tests/EDF/test.cpp
index 32a0860ee36..ed90eafaf87 100644
--- a/ACE/Kokyu/tests/EDF/test.cpp
+++ b/ACE/Kokyu/tests/EDF/test.cpp
@@ -1,5 +1,3 @@
-#include "ace/Auto_Ptr.h"
-
#include "Kokyu.h"
#include "ace/Task.h"
#include "ace/Sched_Params.h"
@@ -7,6 +5,7 @@
#include "ace/Get_Opt.h"
#include "ace/OS_NS_strings.h"
#include "ace/OS_NS_sys_time.h"
+#include <utility>
ACE_CString sched_policy_str = "fifo";
@@ -88,7 +87,7 @@ int ACE_TMAIN (int argc, ACE_TCHAR** argv)
ACE_DEBUG ((LM_DEBUG, "before create_dispatcher\n" ));
attrs.config_info_set_ = config_info;
- auto_ptr<Kokyu::Dispatcher>
+ std::unique_ptr<Kokyu::Dispatcher>
disp (Kokyu::Dispatcher_Factory::create_dispatcher (attrs));
ACE_ASSERT (disp.get() != 0);
diff --git a/ACE/Kokyu/tests/FIFO/README b/ACE/Kokyu/tests/FIFO/README
index c3d271caaf8..55438c99683 100644
--- a/ACE/Kokyu/tests/FIFO/README
+++ b/ACE/Kokyu/tests/FIFO/README
@@ -1,5 +1,3 @@
-
-
This example is a very simple example, showing how to use the Kokyu
dispatcher to dispatch command objects in a FIFO manner. The test
configures the Kokyu dispatcher with 3 FIFO lanes, each having a
diff --git a/ACE/Kokyu/tests/FIFO/test.cpp b/ACE/Kokyu/tests/FIFO/test.cpp
index d9a86aeb225..e7cd1071cb9 100644
--- a/ACE/Kokyu/tests/FIFO/test.cpp
+++ b/ACE/Kokyu/tests/FIFO/test.cpp
@@ -1,10 +1,9 @@
-#include "ace/Auto_Ptr.h"
-
#include "Kokyu.h"
#include "ace/Task.h"
#include "ace/SString.h"
#include "ace/Get_Opt.h"
#include "ace/OS_NS_strings.h"
+#include <utility>
ACE_CString sched_policy_str = "fifo";
@@ -98,7 +97,7 @@ int ACE_TMAIN (int argc, ACE_TCHAR** argv)
attrs.config_info_set_ = config_info;
ACE_DEBUG ((LM_DEBUG, "before create_dispatcher\n" ));
- auto_ptr<Kokyu::Dispatcher>
+ std::unique_ptr<Kokyu::Dispatcher>
disp (Kokyu::Dispatcher_Factory::create_dispatcher (attrs));
ACE_ASSERT (disp.get() != 0);