Browse Source

add move struct

leon 1 month ago
parent
commit
e6dddc029f
2 changed files with 3 additions and 2 deletions
  1. 1 0
      src/common/data.hpp
  2. 2 2
      src/main.cpp

+ 1 - 0
src/common/data.hpp

@@ -45,6 +45,7 @@ struct Box
     Box(float left, float top, float right, float bottom, float score, const std::string& label, bool need_classification = false) 
         : left(left), top(top), right(right), bottom(bottom), score(score), label(label), need_classification(need_classification) {}
     Box(const Box& b) : left(b.left), top(b.top), right(b.right), bottom(b.bottom), score(b.score), label(b.label), need_classification(b.need_classification), points(b.points) {}
+    Box(const Box&& b) : left(b.left), top(b.top), right(b.right), bottom(b.bottom), score(b.score), label(b.label), need_classification(b.need_classification), points(b.points) {}
     Box& operator=(const Box& b)
     {
         left = b.left;

+ 2 - 2
src/main.cpp

@@ -10,8 +10,8 @@ int main()
     src_node->set_skip_frame(10);
 
 
-    std::shared_ptr<Node::InferNode> infer_node = std::make_shared<Node::InferNode>("infer1");
-    std::shared_ptr<Node::DrawNode> draw_node = std::make_shared<Node::DrawNode>("infer2");
+    std::shared_ptr<Node::InferNode> infer_node = std::make_shared<Node::InferNode>("infer");
+    std::shared_ptr<Node::DrawNode> draw_node = std::make_shared<Node::DrawNode>("draw");
     Node::LinkNode(src_node, infer_node);
     Node::LinkNode(infer_node, draw_node);
     draw_node->start();