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

add getConstraintOf

parent 99f8e483
No related branches found
No related tags found
1 merge request!135add getConstraintOf
...@@ -135,6 +135,9 @@ class FrameBase : public NodeBase, public std::enable_shared_from_this<FrameBase ...@@ -135,6 +135,9 @@ class FrameBase : public NodeBase, public std::enable_shared_from_this<FrameBase
CaptureBasePtr getCaptureOf(const SensorBasePtr _sensor_ptr); CaptureBasePtr getCaptureOf(const SensorBasePtr _sensor_ptr);
void unlinkCapture(CaptureBasePtr _cap_ptr); void unlinkCapture(CaptureBasePtr _cap_ptr);
ConstraintBasePtr getConstraintOf(const ProcessorBasePtr _processor_ptr);
ConstraintBasePtr getConstraintOf(const ProcessorBasePtr _processor_ptr, const std::string& type);
void getConstraintList(ConstraintBaseList& _ctr_list); void getConstraintList(ConstraintBaseList& _ctr_list);
virtual ConstraintBasePtr addConstrainedBy(ConstraintBasePtr _ctr_ptr); virtual ConstraintBasePtr addConstrainedBy(ConstraintBasePtr _ctr_ptr);
unsigned int getHits() const; unsigned int getHits() const;
...@@ -323,6 +326,25 @@ inline void FrameBase::unlinkCapture(CaptureBasePtr _cap_ptr) ...@@ -323,6 +326,25 @@ inline void FrameBase::unlinkCapture(CaptureBasePtr _cap_ptr)
capture_list_.remove(_cap_ptr); capture_list_.remove(_cap_ptr);
} }
inline ConstraintBasePtr
FrameBase::getConstraintOf(const ProcessorBasePtr _processor_ptr)
{
for (const ConstraintBasePtr& constaint_ptr : getConstrainedByList())
if (constaint_ptr->getProcessor() == _processor_ptr)
return constaint_ptr;
return nullptr;
}
inline ConstraintBasePtr
FrameBase::getConstraintOf(const ProcessorBasePtr _processor_ptr, const std::string& type)
{
for (const ConstraintBasePtr& constaint_ptr : getConstrainedByList())
if (constaint_ptr->getProcessor() == _processor_ptr &&
constaint_ptr->getType() == type)
return constaint_ptr;
return nullptr;
}
inline void FrameBase::getConstraintList(ConstraintBaseList& _ctr_list) inline void FrameBase::getConstraintList(ConstraintBaseList& _ctr_list)
{ {
for (auto c_ptr : getCaptureList()) for (auto c_ptr : getCaptureList())
......
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