mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2024-12-14 20:20:35 +00:00
Add missing include, reordering
This commit is contained in:
parent
e7dc926dad
commit
76222945bd
@ -34,12 +34,12 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "concurrent_queue.h"
|
#include "concurrent_queue.h"
|
||||||
|
#include "galileo_ephemeris.h"
|
||||||
|
#include "glonass_gnav_ephemeris.h"
|
||||||
|
#include "glonass_gnav_utc_model.h"
|
||||||
#include "gnss_synchro.h"
|
#include "gnss_synchro.h"
|
||||||
#include <galileo_ephemeris.h>
|
#include "gps_cnav_ephemeris.h"
|
||||||
#include <gps_ephemeris.h>
|
#include "gps_ephemeris.h"
|
||||||
#include <gps_cnav_ephemeris.h>
|
|
||||||
#include <glonass_gnav_ephemeris.h>
|
|
||||||
#include <glonass_gnav_utc_model.h>
|
|
||||||
#include <boost/asio.hpp>
|
#include <boost/asio.hpp>
|
||||||
#include <boost/date_time/posix_time/posix_time.hpp>
|
#include <boost/date_time/posix_time/posix_time.hpp>
|
||||||
#include <glog/logging.h>
|
#include <glog/logging.h>
|
||||||
@ -48,6 +48,7 @@
|
|||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <cstring> // for memcpy
|
#include <cstring> // for memcpy
|
||||||
#include <deque>
|
#include <deque>
|
||||||
|
#include <list>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <set>
|
#include <set>
|
||||||
@ -55,7 +56,6 @@
|
|||||||
#include <thread>
|
#include <thread>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <list>
|
|
||||||
|
|
||||||
#if BOOST_GREATER_1_65
|
#if BOOST_GREATER_1_65
|
||||||
using b_io_context = boost::asio::io_context;
|
using b_io_context = boost::asio::io_context;
|
||||||
|
@ -39,6 +39,7 @@
|
|||||||
#include "gps_cnav_ephemeris.h"
|
#include "gps_cnav_ephemeris.h"
|
||||||
#include "gps_ephemeris.h"
|
#include "gps_ephemeris.h"
|
||||||
#include "rtcm.h"
|
#include "rtcm.h"
|
||||||
|
#include <boost/exception/diagnostic_information.hpp>
|
||||||
#include <glog/logging.h>
|
#include <glog/logging.h>
|
||||||
#include <ctime> // for tm
|
#include <ctime> // for tm
|
||||||
#include <exception> // for exception
|
#include <exception> // for exception
|
||||||
@ -46,7 +47,6 @@
|
|||||||
#include <iostream> // for cout, cerr
|
#include <iostream> // for cout, cerr
|
||||||
#include <termios.h> // for tcgetattr
|
#include <termios.h> // for tcgetattr
|
||||||
#include <unistd.h> // for close, write
|
#include <unistd.h> // for close, write
|
||||||
#include <boost/exception/diagnostic_information.hpp>
|
|
||||||
|
|
||||||
#if HAS_STD_FILESYSTEM
|
#if HAS_STD_FILESYSTEM
|
||||||
#include <system_error>
|
#include <system_error>
|
||||||
|
@ -31,10 +31,11 @@
|
|||||||
#ifndef GNSS_SDR_CONCURRENT_QUEUE_H
|
#ifndef GNSS_SDR_CONCURRENT_QUEUE_H
|
||||||
#define GNSS_SDR_CONCURRENT_QUEUE_H
|
#define GNSS_SDR_CONCURRENT_QUEUE_H
|
||||||
|
|
||||||
#include <mutex>
|
|
||||||
#include <thread>
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
#include <condition_variable>
|
||||||
|
#include <mutex>
|
||||||
#include <queue>
|
#include <queue>
|
||||||
|
#include <thread>
|
||||||
|
|
||||||
template <typename Data>
|
template <typename Data>
|
||||||
|
|
||||||
@ -50,7 +51,7 @@ class Concurrent_Queue
|
|||||||
public:
|
public:
|
||||||
void push(Data const& data)
|
void push(Data const& data)
|
||||||
{
|
{
|
||||||
std::unique_lock<std::mutex> lock(the_mutex);
|
std::unique_lock<std::mutex> lock(the_mutex);
|
||||||
the_queue.push(data);
|
the_queue.push(data);
|
||||||
lock.unlock();
|
lock.unlock();
|
||||||
the_condition_variable.notify_one();
|
the_condition_variable.notify_one();
|
||||||
@ -58,13 +59,13 @@ public:
|
|||||||
|
|
||||||
bool empty() const
|
bool empty() const
|
||||||
{
|
{
|
||||||
std::unique_lock<std::mutex> lock(the_mutex);
|
std::unique_lock<std::mutex> lock(the_mutex);
|
||||||
return the_queue.empty();
|
return the_queue.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool try_pop(Data& popped_value)
|
bool try_pop(Data& popped_value)
|
||||||
{
|
{
|
||||||
std::unique_lock<std::mutex> lock(the_mutex);
|
std::unique_lock<std::mutex> lock(the_mutex);
|
||||||
if (the_queue.empty())
|
if (the_queue.empty())
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
@ -76,7 +77,7 @@ public:
|
|||||||
|
|
||||||
void wait_and_pop(Data& popped_value)
|
void wait_and_pop(Data& popped_value)
|
||||||
{
|
{
|
||||||
std::unique_lock<std::mutex> lock(the_mutex);
|
std::unique_lock<std::mutex> lock(the_mutex);
|
||||||
while (the_queue.empty())
|
while (the_queue.empty())
|
||||||
{
|
{
|
||||||
the_condition_variable.wait(lock);
|
the_condition_variable.wait(lock);
|
||||||
@ -84,16 +85,16 @@ public:
|
|||||||
popped_value = the_queue.front();
|
popped_value = the_queue.front();
|
||||||
the_queue.pop();
|
the_queue.pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool timed_wait_and_pop(Data& popped_value, int wait_ms)
|
bool timed_wait_and_pop(Data& popped_value, int wait_ms)
|
||||||
{
|
{
|
||||||
std::unique_lock<std::mutex> lock(the_mutex);
|
std::unique_lock<std::mutex> lock(the_mutex);
|
||||||
if (the_queue.empty())
|
if (the_queue.empty())
|
||||||
{
|
{
|
||||||
the_condition_variable.wait_for(lock,std::chrono::milliseconds(wait_ms));
|
the_condition_variable.wait_for(lock, std::chrono::milliseconds(wait_ms));
|
||||||
if (the_queue.empty())
|
if (the_queue.empty())
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
popped_value = the_queue.front();
|
popped_value = the_queue.front();
|
||||||
|
Loading…
Reference in New Issue
Block a user