]> git.sesse.net Git - casparcg/blobdiff - protocol/amcp/AMCPCommandQueue.h
Implemented INFO QUEUES command for debugging AMCP command queues. Useful for debuggi...
[casparcg] / protocol / amcp / AMCPCommandQueue.h
index 9bccd8b3328cff04004c2ecc90f6ea5009fe1666..fa605af02dc684a3aef07c83367194d2e4c1a2bf 100644 (file)
 \r
 #include <common/concurrency/executor.h>\r
 \r
-#include <tbb\mutex.h>\r
+#include <boost/property_tree/ptree_fwd.hpp>\r
+#include <boost/timer.hpp>\r
+\r
+#include <tbb/spin_mutex.h>\r
 \r
 namespace caspar { namespace protocol { namespace amcp {\r
 \r
@@ -36,13 +39,21 @@ class AMCPCommandQueue
        AMCPCommandQueue(const AMCPCommandQueue&);\r
        AMCPCommandQueue& operator=(const AMCPCommandQueue&);\r
 public:\r
-       AMCPCommandQueue();\r
+       AMCPCommandQueue(const std::wstring& name);\r
        ~AMCPCommandQueue();\r
 \r
        void AddCommand(AMCPCommandPtr pCommand);\r
 \r
+       boost::property_tree::wptree info() const;\r
+\r
+       static boost::property_tree::wptree info_all_queues();\r
 private:\r
-       executor                        executor_;\r
+       executor                                executor_;\r
+       mutable tbb::spin_mutex running_command_mutex_;\r
+       bool                                    running_command_;\r
+       std::wstring                    running_command_name_;\r
+       std::wstring                    running_command_params_;\r
+       boost::timer                    running_command_since_;\r
 };\r
 typedef std::tr1::shared_ptr<AMCPCommandQueue> AMCPCommandQueuePtr;\r
 \r