Skip to content
Snippets Groups Projects
Commit 5440f892 authored by Jeremie Deray's avatar Jeremie Deray
Browse files

NodeBase & CaptureBase *id_count atomic_uint

parent 63e79c14
No related branches found
No related tags found
1 merge request!90[WIP] ProcessorBase multi-threading
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
namespace wolf{ namespace wolf{
unsigned int CaptureBase::capture_id_count_ = 0; std::atomic_uint CaptureBase::capture_id_count_(0);
CaptureBase::CaptureBase(const std::string& _type, const TimeStamp& _ts, SensorBasePtr _sensor_ptr) : CaptureBase::CaptureBase(const std::string& _type, const TimeStamp& _ts, SensorBasePtr _sensor_ptr) :
NodeBase("CAPTURE", _type), NodeBase("CAPTURE", _type),
......
...@@ -23,7 +23,7 @@ class CaptureBase : public NodeBase, public std::enable_shared_from_this<Capture ...@@ -23,7 +23,7 @@ class CaptureBase : public NodeBase, public std::enable_shared_from_this<Capture
FrameBaseWPtr frame_ptr_; FrameBaseWPtr frame_ptr_;
FeatureBaseList feature_list_; FeatureBaseList feature_list_;
static unsigned int capture_id_count_; static std::atomic_uint capture_id_count_;
protected: protected:
unsigned int capture_id_; unsigned int capture_id_;
......
...@@ -3,6 +3,6 @@ ...@@ -3,6 +3,6 @@
namespace wolf { namespace wolf {
//init static node counter //init static node counter
unsigned int NodeBase::node_id_count_ = 0; std::atomic_uint NodeBase::node_id_count_(0);
} // namespace wolf } // namespace wolf
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
// Wolf includes // Wolf includes
#include "wolf.h" #include "wolf.h"
// std includes
#include <atomic>
namespace wolf { namespace wolf {
...@@ -54,7 +56,7 @@ namespace wolf { ...@@ -54,7 +56,7 @@ namespace wolf {
class NodeBase class NodeBase
{ {
private: private:
static unsigned int node_id_count_; ///< Object counter (acts as simple ID factory) static std::atomic_uint node_id_count_; ///< Object counter (acts as simple ID factory)
protected: protected:
ProblemWPtr problem_ptr_; ProblemWPtr problem_ptr_;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment