]> git.sesse.net Git - casparcg/commitdiff
2.1.0: Refactoring.
authorronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Fri, 3 Feb 2012 16:27:16 +0000 (16:27 +0000)
committerronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Fri, 3 Feb 2012 16:27:16 +0000 (16:27 +0000)
git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches/2.1.0@2216 362d55ac-95cf-4e76-9f9a-cbaa9c17b72d

common/common.vcxproj
common/common.vcxproj.filters
common/concurrency/executor.h
common/param.h [moved from common/utility/param.h with 100% similarity]
common/utility/move_on_copy.h [deleted file]
core/producer/frame_producer.h
modules/decklink/producer/decklink_producer.cpp
modules/ffmpeg/consumer/ffmpeg_consumer.cpp
modules/ffmpeg/producer/ffmpeg_producer.cpp

index 329b3006b46060c36eb711a2ed13ba8e8bb7b4e7..1b8da8d537b89ad51e411b47a30f33f2f57bf7f5 100644 (file)
     <ClInclude Include="os\windows\system_info.h" />\r
     <ClInclude Include="enum_class.h" />\r
     <ClInclude Include="os\windows\windows.h" />\r
+    <ClInclude Include="param.h" />\r
     <ClInclude Include="reactive.h" />\r
     <ClInclude Include="stdafx.h" />\r
     <ClInclude Include="tweener.h" />\r
     <ClInclude Include="utf.h" />\r
     <ClInclude Include="prec_timer.h" />\r
-    <ClInclude Include="utility\move_on_copy.h" />\r
-    <ClInclude Include="utility\param.h" />\r
   </ItemGroup>\r
   <ItemGroup>\r
     <ClCompile Include="diagnostics\graph.cpp">\r
index 38f206d846491de80f83a1fbb914df125da79675..50698effa7a7c872e80e905f098a66fc8c0ad7d6 100644 (file)
@@ -10,9 +10,6 @@
     <Filter Include="source\os\windows">\r
       <UniqueIdentifier>{1f3002ae-ebb8-4195-8cf3-1a5b87822f38}</UniqueIdentifier>\r
     </Filter>\r
-    <Filter Include="source\utility">\r
-      <UniqueIdentifier>{11860e2d-8adf-4573-956b-785e59aef2b0}</UniqueIdentifier>\r
-    </Filter>\r
     <Filter Include="source\memory">\r
       <UniqueIdentifier>{9259676d-c225-4422-a50e-30d152d78dc2}</UniqueIdentifier>\r
     </Filter>\r
     <ClInclude Include="env.h">\r
       <Filter>source</Filter>\r
     </ClInclude>\r
-    <ClInclude Include="utility\move_on_copy.h">\r
-      <Filter>source\utility</Filter>\r
-    </ClInclude>\r
-    <ClInclude Include="utility\param.h">\r
-      <Filter>source\utility</Filter>\r
-    </ClInclude>\r
     <ClInclude Include="concurrency\lock.h">\r
       <Filter>source\concurrency</Filter>\r
     </ClInclude>\r
     <ClInclude Include="concurrency\async.h">\r
       <Filter>source\concurrency</Filter>\r
     </ClInclude>\r
+    <ClInclude Include="param.h" />\r
   </ItemGroup>\r
 </Project>
\ No newline at end of file
index 171e0e28c668ca142ff158ec028019b3b35837a9..8d1ed1a1b846360fc80889346173cf71b9fa2efa 100644 (file)
@@ -24,7 +24,6 @@
 #include "../except.h"\r
 #include "../log.h"\r
 #include "../enum_class.h"\r
-#include "../utility/move_on_copy.h"\r
 #include "../os/windows/windows.h"\r
 \r
 #include <tbb/atomic.h>\r
 #include <functional>\r
 \r
 namespace caspar {\r
+\r
+namespace detail {\r
+       \r
+template<typename T>\r
+struct move_on_copy\r
+{\r
+       move_on_copy(const move_on_copy<T>& other) : value(std::move(other.value)){}\r
+       move_on_copy(T&& value) : value(std::move(value)){}\r
+       mutable T value;\r
+};\r
+\r
+template<typename T>\r
+move_on_copy<T> make_move_on_copy(T&& value)\r
+{\r
+       return move_on_copy<T>(std::move(value));\r
+}\r
+\r
+}\r
        \r
 struct task_priority_def\r
 {\r
@@ -158,7 +175,7 @@ public:
                        BOOST_THROW_EXCEPTION(invalid_operation() << msg_info("executor not running."));\r
 \r
                // Create a move on copy adaptor to avoid copying the functor into the queue, tbb::concurrent_queue does not support move semantics.\r
-               auto task_adaptor = make_move_on_copy(create_task(func));\r
+               auto task_adaptor = detail::make_move_on_copy(create_task(func));\r
 \r
                auto future = task_adaptor.value.get_future();\r
 \r
similarity index 100%
rename from common/utility/param.h
rename to common/param.h
diff --git a/common/utility/move_on_copy.h b/common/utility/move_on_copy.h
deleted file mode 100644 (file)
index 0c272e5..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*\r
-* Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>\r
-*\r
-* This file is part of CasparCG (www.casparcg.com).\r
-*\r
-* CasparCG is free software: you can redistribute it and/or modify\r
-* it under the terms of the GNU General Public License as published by\r
-* the Free Software Foundation, either version 3 of the License, or\r
-* (at your option) any later version.\r
-*\r
-* CasparCG is distributed in the hope that it will be useful,\r
-* but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
-* GNU General Public License for more details.\r
-*\r
-* You should have received a copy of the GNU General Public License\r
-* along with CasparCG. If not, see <http://www.gnu.org/licenses/>.\r
-*\r
-* Author: Robert Nagy, ronag89@gmail.com\r
-*/\r
-\r
-#pragma once\r
-\r
-namespace caspar {\r
-               \r
-template<typename T>\r
-struct move_on_copy\r
-{\r
-       move_on_copy(const move_on_copy<T>& other) : value(std::move(other.value)){}\r
-       move_on_copy(T&& value) : value(std::move(value)){}\r
-       mutable T value;\r
-};\r
-\r
-template<typename T>\r
-move_on_copy<T> make_move_on_copy(T&& value)\r
-{\r
-       return move_on_copy<T>(std::move(value));\r
-}\r
-\r
-}
\ No newline at end of file
index e9310068e7d83e925ea003dc1475e2020eacf080..b6c5963a1eca27392c43cbab157cdcf60bcf8dc4 100644 (file)
@@ -29,6 +29,7 @@
 #include <limits>\r
 #include <functional>\r
 #include <string>\r
+#include <type_traits>\r
 #include <vector>\r
 \r
 #include <boost/noncopyable.hpp>\r
@@ -41,7 +42,6 @@ namespace caspar { namespace core {
        \r
 struct frame_producer : boost::noncopyable\r
 {\r
-public:\r
        struct flags_def\r
        {\r
                enum type\r
@@ -79,5 +79,5 @@ safe_ptr<core::frame_producer> create_producer(const safe_ptr<frame_factory>&, c
 safe_ptr<core::frame_producer> create_producer(const safe_ptr<frame_factory>&, const std::wstring& params);\r
 safe_ptr<core::frame_producer> create_producer_destroy_proxy(safe_ptr<core::frame_producer> producer);\r
 safe_ptr<core::frame_producer> create_producer_print_proxy(safe_ptr<core::frame_producer> producer);\r
-\r
+               \r
 }}\r
index 10411744fed30f5edd98118db690c6c850d5c177..6603ccb1a012cd338130b4eaddfafe6fe8b271ae 100644 (file)
@@ -35,7 +35,7 @@
 #include <common/diagnostics/graph.h>\r
 #include <common/except.h>\r
 #include <common/log.h>\r
-#include <common/utility/param.h>\r
+#include <common/param.h>\r
 \r
 #include <core/mixer/gpu/write_frame.h>\r
 #include <core/frame/frame_transform.h>\r
index f5b3048fea3a78ec00f2a00a93e593f375686540..62053643257c10f777c5915d417886979b195aae 100644 (file)
@@ -35,7 +35,7 @@
 #include <common/diagnostics/graph.h>\r
 #include <common/memory/safe_ptr.h>\r
 #include <common/utf.h>\r
-#include <common/utility/param.h>\r
+#include <common/param.h>\r
 \r
 #include <boost/algorithm/string.hpp>\r
 #include <boost/timer.hpp>\r
index 4c58d4acdad1c09a40e6a34fa3edc4dc86d0d7cd..af0307a96ddb096c1813570cc22d93c2fd084593 100644 (file)
@@ -33,7 +33,7 @@
 \r
 #include <common/env.h>\r
 #include <common/log.h>\r
-#include <common/utility/param.h>\r
+#include <common/param.h>\r
 #include <common/diagnostics/graph.h>\r
 \r
 #include <core/video_format.h>\r