]> git.sesse.net Git - casparcg/commitdiff
Refactored to use range based for instead of BOOST_FOREACH
authorHelge Norberg <helge.norberg@svt.se>
Fri, 13 Feb 2015 15:00:53 +0000 (16:00 +0100)
committerHelge Norberg <helge.norberg@svt.se>
Fri, 13 Feb 2015 15:00:53 +0000 (16:00 +0100)
47 files changed:
accelerator/StdAfx.h
accelerator/cpu/image/image_mixer.cpp
accelerator/ogl/image/image_mixer.cpp
accelerator/ogl/util/device.cpp
common/blocking_priority_queue.h
common/diagnostics/graph.cpp
common/log.cpp
common/polling_filesystem_monitor.cpp
core/StdAfx.h
core/consumer/output.cpp
core/frame/draw_frame.cpp
core/frame/frame.cpp
core/mixer/audio/audio_mixer.cpp
core/mixer/mixer.cpp
core/producer/binding.h
core/producer/frame_producer.cpp
core/producer/scene/scene_producer.cpp
core/producer/scene/xml_scene_producer.cpp
core/producer/stage.cpp
modules/decklink/StdAfx.h
modules/decklink/producer/decklink_producer.cpp
modules/ffmpeg/StdAfx.h
modules/ffmpeg/consumer/ffmpeg_consumer.cpp
modules/ffmpeg/producer/ffmpeg_producer.cpp
modules/ffmpeg/producer/filter/filter.cpp
modules/ffmpeg/producer/muxer/frame_muxer.cpp
modules/ffmpeg/producer/tbb_avcodec.cpp
modules/flash/StdAfx.h
modules/flash/producer/flash_producer.cpp
modules/image/producer/image_producer.cpp
modules/image/producer/image_scroll_producer.cpp
modules/image/util/image_algorithms.h
modules/oal/consumer/oal_consumer.cpp
modules/psd/psd_scene_producer.cpp
modules/reroute/producer/reroute_producer.cpp
modules/screen/consumer/screen_consumer.cpp
protocol/StdAfx.h
protocol/amcp/AMCPCommandsImpl.cpp
protocol/amcp/AMCPProtocolStrategy.cpp
protocol/osc/client.cpp
protocol/util/AsyncEventServer.cpp
protocol/util/lock_container.cpp
protocol/util/strategy_adapters.h
shell/main.cpp
shell/server.cpp
unit-test/base64_test.cpp
unit-test/tweener_test.cpp

index f8594c47094d55891d3d0dab42f667f68ded7560..4858c3489729f8136d624ea07bc26c61b6769e3b 100644 (file)
@@ -47,7 +47,6 @@
 #include <boost/circular_buffer.hpp>
 #include <boost/timer.hpp>
 #include <boost/filesystem.hpp>
-#include <boost/foreach.hpp>
 #include <boost/range.hpp>
 #include <boost/range/adaptors.hpp>
 #include <boost/range/algorithm.hpp>
index e64223ca5fa871cc240e7afe8fa6a82aa9cccb07..64ed053624262cfbde4161ea92986bc0cbca9ecb 100644 (file)
@@ -46,7 +46,6 @@
 #include <tbb/parallel_for_each.h>
 #include <tbb/concurrent_queue.h>
 
-#include <boost/foreach.hpp>
 #include <boost/range.hpp>
 #include <boost/range/algorithm_ext/erase.hpp>
 #include <boost/thread/future.hpp>
@@ -166,7 +165,7 @@ public:
                });
                
                // Stills are progressive
-               BOOST_FOREACH(auto item, items)
+               for (auto& item : items)
                {
                        if(item.transform.is_still)
                                item.transform.field_mode = core::field_mode::progressive;
@@ -192,7 +191,7 @@ private:
 
        void draw(std::vector<item> items, uint8_t* dest, std::size_t width, std::size_t height, core::field_mode field_mode)
        {               
-               BOOST_FOREACH(auto& item, items)
+               for (auto& item : items)
                        item.transform.field_mode &= field_mode;
                
                // Remove empty items.
@@ -235,7 +234,7 @@ private:
        {
                std::set<std::array<const uint8_t*, 4>> buffers;
 
-               BOOST_FOREACH(auto& item, source_items)
+               for (auto& item : source_items)
                        buffers.insert(item.data);
                
                auto dest_items = source_items;
@@ -362,7 +361,7 @@ public:
        virtual core::mutable_frame create_frame(const void* tag, const core::pixel_format_desc& desc)
        {
                std::vector<array<std::uint8_t>> buffers;
-               BOOST_FOREACH(auto& plane, desc.planes)
+               for (auto& plane : desc.planes)
                {
                        auto buf = spl::make_shared<buffer>(plane.size);
                        buffers.push_back(array<std::uint8_t>(buf->data(), plane.size, true, buf));
index cb510a88b60533c3400ed33bb74a8bb673a33cbe..014ff196d4d699ba496a9e3a5f6a11e72fdbdbad 100644 (file)
@@ -42,7 +42,6 @@
 
 #include <gl/glew.h>
 
-#include <boost/foreach.hpp>
 #include <boost/range/algorithm_ext/erase.hpp>
 #include <boost/thread/future.hpp>
 
@@ -104,7 +103,7 @@ public:
 
                if(format_desc.field_mode != core::field_mode::progressive)
                { // Remove jitter from still.
-                       BOOST_FOREACH(auto& layer, layers)
+                       for (auto& layer : layers)
                        {       
                                // Remove first field stills.
                                boost::range::remove_erase_if(layer.items, [&](const item& item)
@@ -113,7 +112,7 @@ public:
                                });
                
                                // Stills are progressive
-                               BOOST_FOREACH(auto& item, layer.items)
+                               for (auto& item : layer.items)
                                {
                                        if(item.transform.is_still)
                                                item.transform.field_mode = core::field_mode::progressive;
@@ -146,7 +145,7 @@ private:
        {
                std::shared_ptr<texture> layer_key_texture;
 
-               BOOST_FOREACH(auto& layer, layers)
+               for (auto& layer : layers)
                        draw(target_texture, std::move(layer), layer_key_texture, format_desc, field_mode);
        }
 
@@ -178,7 +177,7 @@ private:
                //}
 
                // Mask out fields
-               BOOST_FOREACH(auto& item, layer.items)                          
+               for (auto& item : layer.items)                          
                        item.transform.field_mode &= field_mode;
                
                // Remove empty items.
@@ -197,7 +196,7 @@ private:
                {
                        auto layer_texture = ogl_->create_texture(target_texture->width(), target_texture->height(), 4);
 
-                       BOOST_FOREACH(auto& item, layer.items)
+                       for (auto& item : layer.items)
                                draw(layer_texture, std::move(item), layer_key_texture, local_key_texture, local_mix_texture);  
                
                        draw(layer_texture, std::move(local_mix_texture), core::blend_mode::normal);                                                    
@@ -205,7 +204,7 @@ private:
                }
                else // fast path
                {
-                       BOOST_FOREACH(auto& item, layer.items)          
+                       for (auto& item : layer.items)          
                                draw(target_texture, std::move(item), layer_key_texture, local_key_texture, local_mix_texture);         
                                        
                        draw(target_texture, std::move(local_mix_texture), core::blend_mode::normal);
@@ -225,7 +224,7 @@ private:
                draw_params.transform   = std::move(item.transform);
                draw_params.geometry    = item.geometry;
 
-               BOOST_FOREACH(auto& future_texture, item.textures)
+               for (auto& future_texture : item.textures)
                        draw_params.textures.push_back(spl::make_shared_ptr(future_texture.get()));
 
                if(item.transform.is_key)
@@ -347,7 +346,7 @@ public:
        core::mutable_frame create_frame(const void* tag, const core::pixel_format_desc& desc) override
        {
                std::vector<array<std::uint8_t>> buffers;
-               BOOST_FOREACH(auto& plane, desc.planes)         
+               for (auto& plane : desc.planes)         
                        buffers.push_back(ogl_->create_array(plane.size));              
 
                return core::mutable_frame(std::move(buffers), core::audio_buffer(), tag, desc);
index 6e0c2a7a52b70df45338e1df6a556c4c7d5dbcc9..e2dc5ba711b1195d4dbe208ea98bdcd068b769f4 100644 (file)
@@ -36,8 +36,6 @@
 #include <common/gl/gl_check.h>
 #include <common/os/windows/windows.h>
 
-#include <boost/foreach.hpp>
-
 #include <gl/glew.h>
 
 #include <SFML/Window/Context.hpp>
index 154a133559a895a84f2ebb2f733cabd602b53db3..7fd7e19fd3b4843e625ec7fbb34cbbc1d10de6b8 100644 (file)
@@ -26,7 +26,6 @@
 
 #include <tbb/concurrent_queue.h>
 
-#include <boost/foreach.hpp>
 #include <boost/thread/mutex.hpp>
 
 #include "semaphore.h"
@@ -65,7 +64,7 @@ public:
                , elements_available_(0u)
                , capacity_(capacity)
        {
-               BOOST_FOREACH(Prio priority, priorities)
+               for (Prio priority : priorities)
                {
                        queues_by_priority_.insert(std::make_pair(priority, tbb::concurrent_queue<T>()));
                }
@@ -165,7 +164,7 @@ public:
 
                acquire_transaction transaction(elements_available_, true);
 
-               BOOST_FOREACH(auto& queue, queues_by_priority_)
+               for (auto& queue : queues_by_priority_)
                {
                        if (queue.first < minimum_priority)
                        {
@@ -254,7 +253,7 @@ private:
 
        void pop_acquired_any_priority(T& element, acquire_transaction& transaction)
        {
-               BOOST_FOREACH(auto& queue, queues_by_priority_)
+               for (auto& queue : queues_by_priority_)
                {
                        if (queue.second.try_pop(element))
                        {
index b7241d4293b5d3b6f76ec134adb006f8335e5b66..c8ea356d75920f10e1b525f085c4a90cae6470b3 100644 (file)
@@ -31,7 +31,6 @@
 
 #include <SFML/Graphics.hpp>
 
-#include <boost/foreach.hpp>
 #include <boost/optional.hpp>
 #include <boost/circular_buffer.hpp>
 #include <boost/range/algorithm_ext/erase.hpp>
index 5301df6e95a85f0183852fd7abdf38d115886c88..9f68785c872e634ba9321aa16683dbf50c503768 100644 (file)
@@ -37,7 +37,6 @@
 #include <boost/filesystem/convenience.hpp>
 #include <boost/date_time/posix_time/posix_time.hpp>
 #include <boost/algorithm/string.hpp>
-#include <boost/foreach.hpp>
 
 #include <boost/log/core.hpp>
 #include <boost/log/trivial.hpp>
index dfad7135b2749f1f8c6b721cb70fc061d76f1c98..409addce11b6ec1f27175f382180c160816305f1 100644 (file)
@@ -29,7 +29,6 @@
 #include <cstdint>
 
 #include <boost/thread.hpp>
-#include <boost/foreach.hpp>
 #include <boost/range/adaptor/map.hpp>
 #include <boost/range/algorithm/copy.hpp>
 #include <boost/filesystem/fstream.hpp>
@@ -101,7 +100,7 @@ public:
                if ((events_mask_ & MODIFIED) == 0)
                        return;
 
-               BOOST_FOREACH(auto& file, files_)
+               for (auto& file : files_)
                        handler_(MODIFIED, file.first);
        }
 
@@ -186,7 +185,7 @@ public:
                        removed_files.erase(path);
                }
 
-               BOOST_FOREACH(auto& path, removed_files)
+               for (auto& path : removed_files)
                {
                        files_.erase(path);
                        being_written_sizes_.erase(path);
index cffcc2eb3b6c7a0a2ef9ceee9019143c56524b1e..c7a2f310fc280487aab122a2032b012d7ad5d8d5 100644 (file)
@@ -48,7 +48,6 @@
 #include <boost/circular_buffer.hpp>
 #include <boost/timer.hpp>
 #include <boost/filesystem.hpp>
-#include <boost/foreach.hpp>
 #include <boost/range.hpp>
 #include <boost/range/adaptors.hpp>
 #include <boost/range/algorithm.hpp>
index f1a578590062bd3d24e71ea7632be34ecbdd6aa1..915c4d11812f4e16d2b4d903873cebcad408365c 100644 (file)
@@ -236,7 +236,7 @@ public:
                return std::move(executor_.begin_invoke([&]() -> boost::property_tree::wptree
                {                       
                        boost::property_tree::wptree info;
-                       BOOST_FOREACH(auto& port, ports_)
+                       for (auto& port : ports_)
                        {
                                info.add_child(L"consumers.consumer", port.second.info())
                                        .add(L"index", port.first); 
index 180c8906011fecb185d181b4219c7de492d2ac16..21dcdab268f6cacadb8f37ea52762d80453d64d3 100644 (file)
@@ -27,8 +27,6 @@
 
 #include "frame_transform.h"
 
-#include <boost/foreach.hpp>
-
 namespace caspar { namespace core {
                
 enum tags
@@ -81,7 +79,7 @@ public:
                }
                else
                {
-                       BOOST_FOREACH(auto frame, frames_)
+                       for (auto& frame : frames_)
                                frame.accept(visitor);
                }
                visitor.pop();
index 0e25ed237133aa2be3970bb5895d9c7c20e6839a..3c0a092ffdb05881ba2bf774ba9d43f0aac8623f 100644 (file)
@@ -51,7 +51,7 @@ struct mutable_frame::impl : boost::noncopyable
                , tag_(tag)
                , geometry_(frame_geometry::get_default())
        {
-               BOOST_FOREACH(auto& buffer, buffers_)
+               for (auto& buffer : buffers_)
                        if(!buffer.data())
                                CASPAR_THROW_EXCEPTION(invalid_argument() << msg_info("mutable_frame: null argument"));
        }
index a970002992d4abd3504daaa9b6a5ff2d11f60e35..88752cb31fde3620f08d909a00c90399dbbeb751 100644 (file)
@@ -133,7 +133,7 @@ public:
                std::map<const void*, audio_stream>     next_audio_streams;
                std::vector<const void*> used_tags;
 
-               BOOST_FOREACH(auto& item, items_)
+               for (auto& item : items_)
                {                       
                        audio_buffer_ps next_audio;
 
@@ -195,7 +195,7 @@ public:
                }
                                
                std::vector<float> result_ps(audio_size(audio_cadence_.front()), 0.0f);
-               BOOST_FOREACH(auto& stream, audio_streams_ | boost::adaptors::map_values)
+               for (auto& stream : audio_streams_ | boost::adaptors::map_values)
                {
                        if(stream.audio_data.size() < result_ps.size())
                                stream.audio_data.resize(result_ps.size(), 0.0f);
index 8d5c1f6225ee281eee0c18e595b3204a592ea749..38f5b72304c017d77ba565f531e3636377696c6c 100644 (file)
@@ -41,7 +41,6 @@
 #include <core/frame/pixel_format.h>
 #include <core/video_format.h>
 
-#include <boost/foreach.hpp>
 #include <boost/timer.hpp>
 #include <boost/property_tree/ptree.hpp>
 #include <boost/range/algorithm_ext.hpp>
@@ -82,7 +81,7 @@ public:
                {               
                        try
                        {       
-                               BOOST_FOREACH(auto& frame, frames)
+                               for (auto& frame : frames)
                                {
                                        auto blend_it = blend_modes_.find(frame.first);
                                        image_mixer_->begin_layer(blend_it != blend_modes_.end() ? blend_it->second : blend_mode::normal);
index 06f8c0f8cf19339f84d886ae23b2262f31551f69..d87576ece6098a2f5f621e0566214a76670a85fd 100644 (file)
@@ -30,7 +30,6 @@
 #include <type_traits>
 
 #include <boost/lexical_cast.hpp>
-#include <boost/foreach.hpp>
 
 namespace caspar { namespace core {
 
@@ -62,7 +61,7 @@ struct impl_base : std::enable_shared_from_this<impl_base>
 
        bool depends_on(const std::shared_ptr<impl_base>& other) const
        {
-               BOOST_FOREACH(auto& dependency, dependencies_)
+               for (auto& dependency : dependencies_)
                {
                        if (dependency == other)
                                return true;
index c966733cc4dec35af4d09df605ce883d8c16e7dc..80c181f75c6d1bdf377f6f5f95b7d8e63556e353 100644 (file)
@@ -351,7 +351,7 @@ spl::shared_ptr<core::frame_producer> create_producer(const spl::shared_ptr<fram
        if(producer == frame_producer::empty())
        {
                std::wstring str;
-               BOOST_FOREACH(auto& param, params)
+               for (auto& param : params)
                        str += param + L" ";
                CASPAR_THROW_EXCEPTION(file_not_found() << msg_info("No match found for supplied commands. Check syntax.") << arg_value_info(u8(str)));
        }
index 51c89a0ecd7bdd32af8b10484ed70ecb5cf4db67..178b2c7271866aac0102c2cb57d28c00ed9fe5f7 100644 (file)
@@ -184,12 +184,12 @@ struct scene_producer::impl
 
        draw_frame render_frame()
        {
-               BOOST_FOREACH(auto& timeline, timelines_)
+               for (auto& timeline : timelines_)
                        timeline.second.on_frame(frame_number_.get());
 
                std::vector<draw_frame> frames;
 
-               BOOST_FOREACH(auto& layer, layers_)
+               for (auto& layer : layers_)
                {
                        if (layer.hidden.get())
                                continue;
@@ -223,7 +223,7 @@ struct scene_producer::impl
 
        boost::optional<interaction_target> collission_detect(double x, double y) const
        {
-               BOOST_FOREACH(auto& layer, layers_ | boost::adaptors::reversed)
+               for (auto& layer : layers_ | boost::adaptors::reversed)
                {
                        if (layer.hidden.get())
                                continue;
index e6861c4fd5797d16e20af27ebfcd9b19f2967263..e0b2b3a2c3896294246f968ebb2a97cde8db2827 100644 (file)
@@ -85,7 +85,7 @@ spl::shared_ptr<core::frame_producer> create_xml_scene_producer(
 
        auto scene = spl::make_shared<scene_producer>(width, height);
 
-       BOOST_FOREACH(auto elem, root.get_child(L"scene.variables"))
+       for (auto elem : root.get_child(L"scene.variables"))
        {
                auto type = elem.second.get<std::wstring>(L"<xmlattr>.type");
                auto id = elem.second.get<std::wstring>(L"<xmlattr>.id");
@@ -103,7 +103,7 @@ spl::shared_ptr<core::frame_producer> create_xml_scene_producer(
                        scene->create_variable<bool>(id, is_public, expr);
        }
 
-       BOOST_FOREACH(auto elem, root.get_child(L"scene.layers"))
+       for (auto& elem : root.get_child(L"scene.layers"))
        {
                auto id = elem.second.get<std::wstring>(L"<xmlattr>.id");
                auto producer = create_producer(frame_factory, format_desc, elem.second.get<std::wstring>(L"producer"));
@@ -119,7 +119,7 @@ spl::shared_ptr<core::frame_producer> create_xml_scene_producer(
                scene->create_variable<double>(variable_prefix + L"width", false) = layer.producer.get()->pixel_constraints().width;
                scene->create_variable<double>(variable_prefix + L"height", false) = layer.producer.get()->pixel_constraints().height;
 
-               BOOST_FOREACH(auto& var_name, producer->get_variables())
+               for (auto& var_name : producer->get_variables())
                {
                        auto& var = producer->get_variable(var_name);
                        auto expr = elem.second.get<std::wstring>(L"parameters." + var_name, L"");
@@ -133,11 +133,11 @@ spl::shared_ptr<core::frame_producer> create_xml_scene_producer(
                }
        }
 
-       BOOST_FOREACH(auto& elem, root.get_child(L"scene.timelines"))
+       for (auto& elem : root.get_child(L"scene.timelines"))
        {
                auto& variable = scene->get_variable(elem.second.get<std::wstring>(L"<xmlattr>.variable"));
 
-               BOOST_FOREACH(auto& k, elem.second)
+               for (auto& k : elem.second)
                {
                        if (k.first == L"<xmlattr>")
                                continue;
@@ -157,7 +157,7 @@ spl::shared_ptr<core::frame_producer> create_xml_scene_producer(
                return scene->get_variable(name); 
        };
 
-       BOOST_FOREACH(auto& var_name, scene->get_variables())
+       for (auto& var_name : scene->get_variables())
        {
                deduce_expression(scene->get_variable(var_name), repo);
        }
index f0bb0a47f8934e7d7756709458a42f17b8add290..dc7af671ef1e0bf5291751e8331e5356a7fdae47 100644 (file)
@@ -35,7 +35,6 @@
 
 #include <core/frame/frame_transform.h>
 
-#include <boost/foreach.hpp>
 #include <boost/timer.hpp>
 #include <boost/property_tree/ptree.hpp>
 #include <boost/range/algorithm_ext.hpp>
@@ -81,7 +80,7 @@ public:
                        {                       
                                std::vector<int> indices;
 
-                               BOOST_FOREACH(auto& layer, layers_)     
+                               for (auto& layer : layers_)     
                                {
                                        frames[layer.first] = draw_frame::empty();      
                                        indices.push_back(layer.first);
@@ -147,7 +146,7 @@ public:
        {
                return executor_.begin_invoke([=]
                {
-                       BOOST_FOREACH(auto& transform, transforms)
+                       for (auto& transform : transforms)
                        {
                                auto src = tweens_[std::get<0>(transform)].fetch();
                                auto dst = std::get<1>(transform)(src);
@@ -244,18 +243,18 @@ public:
                        auto layers                     = layers_ | boost::adaptors::map_values;
                        auto other_layers       = other_impl->layers_ | boost::adaptors::map_values;
 
-                       BOOST_FOREACH(auto& layer, layers)
+                       for (auto& layer : layers)
                                layer.monitor_output().detach_parent();
                        
-                       BOOST_FOREACH(auto& layer, other_layers)
+                       for (auto& layer : other_layers)
                                layer.monitor_output().detach_parent();
                        
                        std::swap(layers_, other_impl->layers_);
                                                
-                       BOOST_FOREACH(auto& layer, layers)
+                       for (auto& layer : layers)
                                layer.monitor_output().attach_parent(monitor_subject_);
                        
-                       BOOST_FOREACH(auto& layer, other_layers)
+                       for (auto& layer : other_layers)
                                layer.monitor_output().attach_parent(monitor_subject_);
                };              
 
@@ -323,7 +322,7 @@ public:
                return executor_.begin_invoke([this]() -> boost::property_tree::wptree
                {
                        boost::property_tree::wptree info;
-                       BOOST_FOREACH(auto& layer, layers_)                     
+                       for (auto& layer : layers_)                     
                                info.add_child(L"layers.layer", layer.second.info())
                                        .add(L"index", layer.first);    
                        return info;
@@ -356,7 +355,7 @@ public:
 
        boost::optional<interaction_target> collission_detect(double x, double y)
        {
-               BOOST_FOREACH(auto& layer, layers_ | boost::adaptors::reversed)
+               for (auto& layer : layers_ | boost::adaptors::reversed)
                {
                        auto transform = tweens_[layer.first].fetch();
                        auto translated = translate(x, y, transform);
index 94a128626546f9b5e8b45cc9d5d31f4c7222a5de..516ded1a1925825f3f4644f2103bb3eea5cb8566 100644 (file)
@@ -46,7 +46,6 @@
 #include <boost/circular_buffer.hpp>
 #include <boost/timer.hpp>
 #include <boost/filesystem.hpp>
-#include <boost/foreach.hpp>
 #include <boost/range.hpp>
 #include <boost/range/algorithm.hpp>
 #include <boost/property_tree/ptree.hpp>
index 4915bc83e796e2e702e6bc3fcb29bd209906d2d2..5ecd153fbfe3769395bab32c5399b7ec83a35099 100644 (file)
@@ -47,7 +47,6 @@
 #include <tbb/concurrent_queue.h>
 
 #include <boost/algorithm/string.hpp>
-#include <boost/foreach.hpp>
 #include <boost/property_tree/ptree.hpp>
 #include <boost/timer.hpp>
 
index 055d5ff12e76db561d873d1a8cd06c1e3392bc45..abf2ae996affb61003474be2bcf87210e6a9f31a 100644 (file)
@@ -35,7 +35,6 @@
 #include <boost/algorithm/string/case_conv.hpp>
 #include <boost/algorithm/string/predicate.hpp>
 #include <boost/filesystem.hpp>
-#include <boost/foreach.hpp>
 #include <boost/lexical_cast.hpp>
 #include <boost/noncopyable.hpp>
 #include <boost/property_tree/ptree.hpp>
index 2ab9ba2469e644927adfb6f74137cdb1ef05529a..e2edd0c976d60e1912da5ba6639708e2830bf485 100644 (file)
@@ -324,7 +324,7 @@ public:
 
                if(options.size() > 0)
                {
-                       BOOST_FOREACH(auto& option, options)
+                       for (auto& option : options)
                                CASPAR_LOG(warning) << L"Invalid option: -" << u16(option.name) << L" " << u16(option.value);
                }
 
index b696a723a6097ac8eca70c7f1c29af57a22805b5..ad1e718a32eebc69b67e1430aee92f329b871643 100644 (file)
@@ -47,7 +47,6 @@
 #include <boost/algorithm/string.hpp>
 #include <common/assert.h>
 #include <boost/timer.hpp>
-#include <boost/foreach.hpp>
 #include <boost/filesystem.hpp>
 #include <boost/range/algorithm/find_if.hpp>
 #include <boost/range/algorithm/find.hpp>
index f6ad8655d5ca4bce2716381b8e178caef0fa892f..1a349b0528f6c262be14ee2d5fed417a5670032c 100644 (file)
@@ -31,7 +31,6 @@
 #include <boost/range/iterator_range.hpp>
 #include <boost/range/adaptors.hpp>
 #include <boost/algorithm/string.hpp>
-#include <boost/foreach.hpp>
 #include <boost/thread.hpp>
 #include <boost/format.hpp>
 #include <boost/rational.hpp>
index a3ea49a6d0c37f33000eed6e67523f0cd6410e97..5e9ac89cbe7da71b7c0b743e37d95fc07db7a5ba 100644 (file)
@@ -53,7 +53,6 @@ extern "C"
 #endif
 
 #include <common/assert.h>
-#include <boost/foreach.hpp>
 #include <boost/range/algorithm_ext/push_back.hpp>
 #include <boost/algorithm/string/predicate.hpp>
 
@@ -113,7 +112,7 @@ struct frame_muxer::impl : boost::noncopyable
                                update_display_mode(video);
                                
                        filter_->push(video);
-                       BOOST_FOREACH(auto& av_frame, filter_->poll_all())                      
+                       for (auto& av_frame : filter_->poll_all())                      
                                video_stream_.push(make_frame(this, av_frame, format_desc_.fps, *frame_factory_));                      
                }
 
index 74edb0b47e4c541bc96fddb5759dd042978309e9..1205446902412cd453985d09b141931ee1f4e2c4 100644 (file)
@@ -32,8 +32,6 @@
 #include <tbb/parallel_for.h>
 #include <tbb/tbb_thread.h>
 
-#include <boost/foreach.hpp>
-
 #if defined(_MSC_VER)
 #pragma warning (push)
 #pragma warning (disable : 4244)
@@ -75,7 +73,7 @@ int thread_execute2(AVCodecContext* s, int (*func)(AVCodecContext* c2, void* arg
        
        tbb::parallel_for(0, MAX_THREADS, [&](int n)    
     {   
-               BOOST_FOREACH(auto k, jobs[n])
+               for (auto k : jobs[n])
                {
                        int r = func(s, arg, k, n);
                        if(ret) 
index a099e057802892f57a966c61227aede2d13e97ac..4237467c0e363539825c83d8eb94cb862f804c9a 100644 (file)
@@ -45,7 +45,6 @@
 #include <tbb/concurrent_queue.h>
 
 #include <boost/filesystem.hpp>
-#include <boost/foreach.hpp>
 #include <boost/range/algorithm.hpp>
 #include <boost/format.hpp>
 #include <boost/algorithm/string.hpp>
index 2710ba243b0d1e11e71622f2814efcfaa87f0873..1215ddf1e62af3e54f5432e2dbfd2c3d35bbdab9 100644 (file)
@@ -107,7 +107,7 @@ template_host get_template_host(const core::video_format_desc& desc)
        try
        {
                std::vector<template_host> template_hosts;
-               BOOST_FOREACH(auto& xml_mapping, env::properties().get_child(L"configuration.template-hosts"))
+               for (auto& xml_mapping : env::properties().get_child(L"configuration.template-hosts"))
                {
                        try
                        {
index 539590dd5e29b7d883c1043c15a96b88e1c6b060..bcdbda865d3a7bf30c340b51d2d9fd11fa1b67c1 100644 (file)
@@ -41,7 +41,6 @@
 #include <boost/filesystem.hpp>
 #include <boost/property_tree/ptree.hpp>
 #include <boost/algorithm/string.hpp>
-#include <boost/foreach.hpp>
 
 #include <algorithm>
 #include <set>
@@ -221,7 +220,7 @@ spl::shared_ptr<core::frame_producer> create_producer(const spl::shared_ptr<core
                std::vector<core::draw_frame> frames;
                frames.reserve(files.size());
 
-               BOOST_FOREACH(auto& file, files)
+               for (auto& file : files)
                {
                        auto frame = load_image(frame_factory, file);
 
index 93025faf06196412c443dffbc42efa56752ca47b..6b98ee1f3ba92af6bc09b80e91c407790a183fb4 100644 (file)
@@ -43,7 +43,6 @@
 #include <common/param.h>
 
 #include <boost/filesystem.hpp>
-#include <boost/foreach.hpp>
 #include <boost/lexical_cast.hpp>
 #include <boost/property_tree/ptree.hpp>
 #include <boost/scoped_array.hpp>
@@ -243,7 +242,7 @@ struct image_scroll_producer : public core::frame_producer_base
                std::vector<core::draw_frame> result;
                result.reserve(frames_.size());
 
-               BOOST_FOREACH(auto& frame, frames_)
+               for (auto& frame : frames_)
                {
                        auto& fill_translation = frame.transform().image_transform.fill_translation;
 
index 178b9af1f6a2334d1d86b87cfa380685f6799da1..839d84e39b4d8e360bc2dbc98bd2e7fba80c51a9 100644 (file)
@@ -25,7 +25,6 @@
 
 #include <cmath>
 #include <cstdint>
-#include <boost/foreach.hpp>
 
 namespace caspar { namespace image {
 
index 91b755414c3c82f32c6e9e183ee79c55e8aac2b2..9e28d318071aa4a0dba38feb9d353dc976559a2a 100644 (file)
@@ -39,7 +39,6 @@
 #include <boost/lexical_cast.hpp>
 #include <boost/property_tree/ptree.hpp>
 #include <boost/timer.hpp>
-#include <boost/foreach.hpp>
 #include <boost/thread/once.hpp>
 
 #include <tbb/concurrent_queue.h>
@@ -143,7 +142,7 @@ public:
                                alDeleteSources(1, &source_);
                        }
 
-                       BOOST_FOREACH(auto& buffer, buffers_)
+                       for (auto& buffer : buffers_)
                        {
                                if(buffer)
                                        alDeleteBuffers(1, &buffer);
index 96d30889403666259be0f2086980acf4b5daf11c..6e4e9d5f3faa50a8ae3f1147ca661e2a79210fbd 100644 (file)
@@ -38,7 +38,6 @@
 #include <common/log.h>
 
 #include <boost/filesystem.hpp>
-#include <boost/foreach.hpp>
 #include <boost/thread/future.hpp>
 #include <boost/algorithm/string.hpp>
 #include <boost/rational.hpp>
@@ -134,7 +133,7 @@ core::text::text_info get_text_info(const boost::property_tree::wptree& ptree)
                        {
                                auto& master = (*it);
                                //std::for_each(layers.begin(), layers.end(), [&master](linked_layer_record &r) mutable { 
-                               BOOST_FOREACH(auto &r, layers) {
+                               for (auto &r : layers) {
                                        if(r.link_id == master.link_id && r.layer != master.layer)
                                        {
                                                {       //x-coords
@@ -230,13 +229,13 @@ void create_timelines(
        double original_pos_x = psd_layer->location().x;
        double original_pos_y = psd_layer->location().y;
 
-       BOOST_FOREACH(auto& track, *tracklist)
+       for (auto& track : *tracklist)
        {
                auto track_id = track.second.get<std::wstring>(L"stdTrackID");
 
                if (track_id == L"sheetPositionTrack")
                {
-                       BOOST_FOREACH(auto& key, track.second.get_child(L"keyList"))
+                       for (auto& key : track.second.get_child(L"keyList"))
                        {
                                bool tween = key.second.get<std::wstring>(L"animInterpStyle")
                                                == L"Lnr ";
@@ -271,7 +270,7 @@ void create_timelines(
                {
                        auto& opacity = layer.adjustments.opacity;
 
-                       BOOST_FOREACH(auto& key, track.second.get_child(L"keyList"))
+                       for (auto& key : track.second.get_child(L"keyList"))
                        {
                                bool tween = key.second.get<std::wstring>(L"animInterpStyle")
                                                == L"Lnr ";
@@ -386,7 +385,7 @@ spl::shared_ptr<core::frame_producer> create_psd_scene_producer(const spl::share
        link_constructor.calculate();
 
        // Reset all dynamic text fields to empty strings and expose them as a scene parameter.
-       BOOST_FOREACH(auto& text_layer, text_producers_by_layer_name)
+       for (auto& text_layer : text_producers_by_layer_name)
                text_layer.second->text().bind(root->create_variable<std::wstring>(boost::to_lower_copy(text_layer.first), true, L""));
 
        auto params2 = params;
index 83d4d87b83dc4775ee54374c53c480c2e921dd2e..30147a4608730d303f010d94cb47e57187889e95 100644 (file)
@@ -41,7 +41,6 @@
 #include <tbb/concurrent_queue.h>
 
 #include <boost/property_tree/ptree.hpp>
-#include <boost/foreach.hpp>
 #include <boost/optional.hpp>
 #include <boost/range/algorithm_ext/push_back.hpp>
 #include <boost/range/numeric.hpp>
index 809ab498f6dc42aeb9ce79d0e5e551a9746d5494..768ea0a50a68fc6013d281f2154b6981301eee4b 100644 (file)
@@ -45,7 +45,6 @@
 #include <boost/timer.hpp>
 #include <boost/circular_buffer.hpp>
 #include <boost/lexical_cast.hpp>
-#include <boost/foreach.hpp>
 #include <boost/property_tree/ptree.hpp>
 #include <boost/thread.hpp>
 
@@ -293,7 +292,7 @@ public:
                if(texture_)
                        glDeleteTextures(1, &texture_);
 
-               BOOST_FOREACH(auto& pbo, pbos_)
+               for (auto& pbo : pbos_)
                {
                        if(pbo)
                                glDeleteBuffers(1, &pbo);
index 50bdda111325b9fe6e2177b686953862cd4f257d..e2c054ed5c78933e2e61d3174e2dc499474af6a7 100644 (file)
@@ -52,7 +52,6 @@
 #include <math.h>
 
 #include <boost/filesystem.hpp>
-#include <boost/foreach.hpp>
 #include <boost/range/algorithm.hpp>
 
 #include "../common/utf.h"
index 6c796b524ec60d22b3448054887cf95b9185adbc..0471489320347961daf05a4164f31bca08571854 100644 (file)
@@ -327,7 +327,7 @@ bool ChannelGridCommand::DoExecute()
 
        self->output().add(screen);
 
-       BOOST_FOREACH(auto channel, channels())
+       for (auto& channel : channels())
        {
                if(channel.channel != self)
                {
@@ -665,7 +665,7 @@ bool AddCommand::DoExecute()
        try
        {
                //create_consumer still expects all parameters to be uppercase
-               BOOST_FOREACH(std::wstring& str, parameters())
+               for (auto& str : parameters())
                {
                        boost::to_upper(str);
                }
@@ -700,7 +700,7 @@ bool RemoveCommand::DoExecute()
                if(index == std::numeric_limits<int>::min())
                {
                        //create_consumer still expects all parameters to be uppercase
-                       BOOST_FOREACH(std::wstring& str, parameters())
+                       for (auto& str : parameters())
                        {
                                boost::to_upper(str);
                        }
@@ -1520,10 +1520,10 @@ bool InfoCommand::DoExecute()
                        info.add(L"system.windows.service-pack",        caspar::win_sp_version());
                        info.add(L"system.cpu",                                         caspar::cpu_info());
        
-                       BOOST_FOREACH(auto device, caspar::decklink::device_list())
+                       for (auto& device : caspar::decklink::device_list())
                                info.add(L"system.decklink.device", device);
 
-                       BOOST_FOREACH(auto device, caspar::bluefish::device_list())
+                       for (auto& device : caspar::bluefish::device_list())
                                info.add(L"system.bluefish.device", device);
                                
                        info.add(L"system.flash",                                       caspar::flash::version());
@@ -1543,7 +1543,7 @@ bool InfoCommand::DoExecute()
                        boost::property_tree::wptree info;
 
                        int index = 0;
-                       BOOST_FOREACH(auto channel, channels())
+                       for (auto& channel : channels())
                                info.add_child(L"channels.channel", channel.channel->info())
                                        .add(L"index", ++index);
                        
index cdb4c8eda0834c5b96dc179344eabcff848dd188..6fdb807f8a9fb247ba0a93574c5648bf3224cc1e 100644 (file)
@@ -62,7 +62,7 @@ public:
                commandQueues_.push_back(std::make_shared<AMCPCommandQueue>());
 
                int index = 0;
-               BOOST_FOREACH(const spl::shared_ptr<core::video_channel>& channel,  channels)
+               for (const auto& channel : channels)
                {
                        std::wstring lifecycle_key = L"lock" + boost::lexical_cast<std::wstring>(index);
                        channels_.push_back(channel_context(channel, lifecycle_key));
index 5ea6d9a18827493adc3b67c14c183c89cb879ee0..f5ddea1e1df0b767e2b57d32b585001864dadd40 100644 (file)
@@ -38,7 +38,6 @@
 #include <unordered_map>
 
 #include <boost/asio.hpp>
-#include <boost/foreach.hpp>
 #include <boost/bind.hpp>
 #include <boost/thread.hpp>
 
@@ -93,7 +92,7 @@ void write_osc_event(byte_vector& destination, const core::monitor::message& e)
        o << ::osc::BeginMessage(e.path().c_str());
                                
        param_visitor<decltype(o)> param_visitor(o);
-       BOOST_FOREACH(const auto& data, e.data())
+       for (const auto& data : e.data())
                boost::apply_visitor(param_visitor, data);
                                
        o << ::osc::EndMessage;
@@ -208,7 +207,7 @@ private:
        {
                boost::system::error_code ec;
 
-               BOOST_FOREACH(const auto& endpoint, destinations)
+               for (const auto& endpoint : destinations)
                        socket_.send_to(buffers, endpoint, 0, ec);
        }
 
@@ -243,7 +242,7 @@ private:
                                {
                                        tbb::spin_mutex::scoped_lock lock(endpoints_mutex_);
 
-                                       BOOST_FOREACH(const auto& endpoint, reference_counts_by_endpoint_)
+                                       for (const auto& endpoint : reference_counts_by_endpoint_)
                                                destinations.push_back(endpoint.first);
                                }
 
@@ -258,7 +257,7 @@ private:
                                auto datagram_size = bundle_header.size();
                                buffers.push_back(boost::asio::buffer(bundle_header));
 
-                               BOOST_FOREACH(const auto& slot, updates)
+                               for (const auto& slot : updates)
                                {
                                        write_osc_bundle_element_start(element_headers[i], slot.second);
                                        const auto& headers = element_headers;
index c0c4cf035e5c6efb203918ec70857d079e974d63..746fa3325ad2617453ed5c15691ea00e27430ad4 100644 (file)
@@ -304,7 +304,7 @@ struct AsyncEventServer::implementation
                service_.post([=]
                {
                        auto connections = *connection_set_;
-                       BOOST_FOREACH(auto& connection, connections)
+                       for (auto& connection : connections)
                                connection->stop();                             
                });
 
@@ -327,7 +327,7 @@ struct AsyncEventServer::implementation
                        auto conn = connection::create(socket, protocol_factory_, connection_set_);
                        connection_set_->insert(conn);
 
-                       BOOST_FOREACH(auto& lifecycle_factory, lifecycle_factories_)
+                       for (auto& lifecycle_factory : lifecycle_factories_)
                        {
                                auto lifecycle_bound = lifecycle_factory(conn->ipv4_address());
                                conn->add_lifecycle_bound_object(lifecycle_bound.first, lifecycle_bound.second);
index ba116fcc25cd351670fe4606b7185e6a69fb0735..504b1c14b4db21494c2d8e692c832dd6ba2de080 100644 (file)
@@ -66,7 +66,7 @@ namespace caspar { namespace IO {
                        }
 
                        //now we can take our time to inform the clients that their locks have been released.
-                       BOOST_FOREACH(std::weak_ptr<client_connection<wchar_t>> conn, clients)
+                       for (auto& conn : clients)
                        {
                                auto ptr = conn.lock();
                                if(ptr)
index c5f4ccf47de9160384dacf624ef09155033fe019..5483c8eda70a1ad6a03db7c7dfb650546561a1b7 100644 (file)
@@ -22,7 +22,6 @@
 #pragma once\r
 \r
 #include <boost/algorithm/string/split.hpp>\r
-#include <boost/foreach.hpp>\r
 \r
 #include "protocol_strategy.h"\r
 #include "ProtocolStrategy.h"\r
index 73bf52025909d2e141e5b7a058e5ea4d0a2639b9..5a850369089350aa5bf986ea4131cdc11f4aba69 100644 (file)
@@ -63,7 +63,6 @@
 
 #include <boost/property_tree/detail/file_parser_error.hpp>
 #include <boost/property_tree/xml_parser.hpp>
-#include <boost/foreach.hpp>
 #include <boost/locale.hpp>
 #include <boost/lexical_cast.hpp>
 #include <boost/algorithm/string/predicate.hpp>
@@ -149,12 +148,12 @@ void print_info()
        CASPAR_LOG(info) << system_product_name();
        
        CASPAR_LOG(info) << L"Decklink " << decklink::version();
-       BOOST_FOREACH(auto device, decklink::device_list())
-               CASPAR_LOG(info) << L" - " << device;   
+       for (auto device : decklink::device_list())
+               CASPAR_LOG(info) << L" - " << device;
                
        CASPAR_LOG(info) << L"Bluefish " << bluefish::version();
-       BOOST_FOREACH(auto device, bluefish::device_list())
-               CASPAR_LOG(info) << L" - " << device;   
+       for (auto device : bluefish::device_list())
+               CASPAR_LOG(info) << L" - " << device;
        
        CASPAR_LOG(info) << L"Flash "                   << flash::version();
        CASPAR_LOG(info) << L"FreeImage "               << image::version();
index eed31a8296a07febb447f108e258cc87e179b1f0..ec9cac979a7bbef01e1b9996c221d50cb8985948 100644 (file)
@@ -68,7 +68,6 @@
 #include <boost/algorithm/string.hpp>
 #include <boost/thread.hpp>
 #include <boost/lexical_cast.hpp>
-#include <boost/foreach.hpp>
 #include <boost/property_tree/ptree.hpp>
 #include <boost/property_tree/xml_parser.hpp>
 
@@ -158,7 +157,7 @@ struct server::impl : boost::noncopyable
        void setup_channels(const boost::property_tree::wptree& pt)
        {   
                using boost::property_tree::wptree;
-               BOOST_FOREACH(auto& xml_channel, pt.get_child(L"configuration.channels"))
+               for (auto& xml_channel : pt.get_child(L"configuration.channels"))
                {               
                        auto format_desc = video_format_desc(xml_channel.second.get(L"video-mode", L"PAL"));            
                        if(format_desc.format == video_format::invalid)
@@ -166,7 +165,7 @@ struct server::impl : boost::noncopyable
                        
                        auto channel = spl::make_shared<video_channel>(static_cast<int>(channels_.size()+1), format_desc, accelerator_.create_image_mixer());
                        
-                       BOOST_FOREACH(auto& xml_consumer, xml_channel.second.get_child(L"consumers"))
+                       for (auto& xml_consumer : xml_channel.second.get_child(L"consumers"))
                        {
                                try
                                {
@@ -213,7 +212,7 @@ struct server::impl : boost::noncopyable
 
                if (predefined_clients)
                {
-                       BOOST_FOREACH(auto& predefined_client, *predefined_clients)
+                       for (auto& predefined_client : *predefined_clients)
                        {
                                const auto address =
                                                predefined_client.second.get<std::wstring>(L"address");
@@ -268,7 +267,7 @@ struct server::impl : boost::noncopyable
        void setup_controllers(const boost::property_tree::wptree& pt)
        {               
                using boost::property_tree::wptree;
-               BOOST_FOREACH(auto& xml_controller, pt.get_child(L"configuration.controllers"))
+               for (auto& xml_controller : pt.get_child(L"configuration.controllers"))
                {
                        try
                        {
index ae8313265eeb3d46fae266c3c85332cdeaf6a665..4f5f537febb25f6bc575224adb1eab4dbbf47e64 100644 (file)
@@ -26,7 +26,6 @@
 #include <set>
 
 #include <boost/assign.hpp>
-#include <boost/foreach.hpp>
 
 #include <common/base64.h>
 #include <common/except.h>
index eff00fe27e19a53643dcff7e9eb53a7f662a758d..1b6099d4c62b0dd875961de137a139aba0c730f5 100644 (file)
@@ -23,8 +23,6 @@
 
 #include <gtest/gtest.h>
 
-#include <boost/foreach.hpp>
-
 #include <common/tweener.h>
 
 namespace caspar { namespace core {