mirror of
https://github.com/saymrwulf/uhd.git
synced 2026-05-16 21:10:10 +00:00
This is a single atomic allocator in the global uhd::rfnoc namespace, so that devices can allocate themselves device IDs without having to confer with the rest of the RFNoC infrastructure.
17 lines
324 B
C++
17 lines
324 B
C++
//
|
|
// Copyright 2019 Ettus Research, a National Instruments Brand
|
|
//
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
//
|
|
|
|
#include <uhdlib/rfnoc/device_id.hpp>
|
|
#include <atomic>
|
|
|
|
using namespace uhd::rfnoc;
|
|
|
|
device_id_t uhd::rfnoc::allocate_device_id()
|
|
{
|
|
static std::atomic<device_id_t> counter{1};
|
|
return counter++;
|
|
}
|
|
|