/usr/include/SoapySDR/Registry.hpp is in libsoapysdr-dev 0.6.1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | ///
/// \file SoapySDR/Registry.hpp
///
/// Device factory registration API.
///
/// \copyright
/// Copyright (c) 2014-2015 Josh Blum
/// SPDX-License-Identifier: BSL-1.0
///
#pragma once
#include <SoapySDR/Config.hpp>
#include <SoapySDR/Version.hpp>
#include <SoapySDR/Types.hpp>
#include <vector>
#include <string>
#include <map>
namespace SoapySDR
{
//! forward declaration of device
class Device;
//! typedef for a device enumeration function
typedef KwargsList (*FindFunction)(const Kwargs &);
//! typedef for a device factory function
typedef Device* (*MakeFunction)(const Kwargs &);
//! typedef for a dictionary of find functions
typedef std::map<std::string, FindFunction> FindFunctions;
//! typedef for a dictionary of make functions
typedef std::map<std::string, MakeFunction> MakeFunctions;
/*!
* A registry object loads device functions into the global registry.
*/
class SOAPY_SDR_API Registry
{
public:
/*!
* Register a SDR device find and make function.
* \param name a unique name to identify the entry
* \param find the find function returns an arg list
* \param make the make function returns a device sptr
* \param abi this value must be SOAPY_SDR_ABI_VERSION
*/
Registry(const std::string &name, const FindFunction &find, const MakeFunction &make, const std::string &abi);
//! Cleanup this registry entry
~Registry(void);
/*!
* List all loaded find functions.
* \return a dictionary of registry entry names to find functions
*/
static FindFunctions listFindFunctions(void);
/*!
* List all loaded make functions.
* \return a dictionary of registry entry names to make functions
*/
static MakeFunctions listMakeFunctions(void);
private:
std::string _name;
};
}
|