diff options
author | Ashish Chaudhari <ashish@ettus.com> | 2016-02-19 17:42:44 -0800 |
---|---|---|
committer | Ashish Chaudhari <ashish@ettus.com> | 2016-02-26 14:23:40 -0800 |
commit | 6db9ac785ca5f62e58cf792f0525b37b16a87bdf (patch) | |
tree | b64f0fb76253531b3dc88c22a795e0f79b556df0 /host/include | |
parent | c03506fedd75a7fbad242d2be06123a187e66277 (diff) | |
download | uhd-6db9ac785ca5f62e58cf792f0525b37b16a87bdf.tar.gz uhd-6db9ac785ca5f62e58cf792f0525b37b16a87bdf.tar.bz2 uhd-6db9ac785ca5f62e58cf792f0525b37b16a87bdf.zip |
dboards: Added ability to register a per-dboard container class
- The typical dboard classes are actually "subdev" classes i.e.
there is one instance per dboard subdev (front-end). This makes
it hard to implement shared functionality between multiple
front-ends.
- This changes adds the ability to create a container class which
is created per group of subdevs and each subdev gets a pointer
to the container class for cross linkage.
Diffstat (limited to 'host/include')
-rw-r--r-- | host/include/uhd/usrp/dboard_base.hpp | 3 | ||||
-rw-r--r-- | host/include/uhd/usrp/dboard_manager.hpp | 34 |
2 files changed, 25 insertions, 12 deletions
diff --git a/host/include/uhd/usrp/dboard_base.hpp b/host/include/uhd/usrp/dboard_base.hpp index 5a7cdd6d2..b106a1ac6 100644 --- a/host/include/uhd/usrp/dboard_base.hpp +++ b/host/include/uhd/usrp/dboard_base.hpp @@ -46,6 +46,9 @@ public: dboard_base(ctor_args_t); virtual ~dboard_base() {} + //post-construction initializer + virtual void initialize() {} + protected: std::string get_subdev_name(void); dboard_iface::sptr get_iface(void); diff --git a/host/include/uhd/usrp/dboard_manager.hpp b/host/include/uhd/usrp/dboard_manager.hpp index aa8599aa4..4a5074e50 100644 --- a/host/include/uhd/usrp/dboard_manager.hpp +++ b/host/include/uhd/usrp/dboard_manager.hpp @@ -45,15 +45,17 @@ public: * Register a rx or tx dboard into the system. * For single subdevice boards, omit subdev_names. * \param dboard_id the dboard id (rx or tx) - * \param dboard_ctor the dboard constructor function pointer + * \param db_subdev_ctor the dboard sub-device constructor function pointer (one instance per subdev name) * \param name the canonical name for the dboard represented * \param subdev_names the names of the subdevs on this dboard + * \param db_container_ctor the dboard container constructor function pointer (one instance per dboard) */ static void register_dboard( const dboard_id_t &dboard_id, - dboard_ctor_t dboard_ctor, + dboard_ctor_t db_subdev_ctor, const std::string &name, - const std::vector<std::string> &subdev_names = std::vector<std::string>(1, "0") + const std::vector<std::string> &subdev_names = std::vector<std::string>(1, "0"), + dboard_ctor_t db_container_ctor = NULL ); /*! @@ -61,50 +63,58 @@ public: * For single subdevice boards, omit subdev_names. * \param rx_dboard_id the rx unit dboard id * \param tx_dboard_id the tx unit dboard id - * \param dboard_ctor the dboard constructor function pointer + * \param db_subdev_ctor the dboard sub-device constructor function pointer (one instance per subdev name) * \param name the canonical name for the dboard represented * \param subdev_names the names of the subdevs on this dboard + * \param db_container_ctor the dboard container constructor function pointer (one instance per dboard) */ static void register_dboard( const dboard_id_t &rx_dboard_id, const dboard_id_t &tx_dboard_id, - dboard_ctor_t dboard_ctor, + dboard_ctor_t db_subdev_ctor, const std::string &name, - const std::vector<std::string> &subdev_names = std::vector<std::string>(1, "0") + const std::vector<std::string> &subdev_names = std::vector<std::string>(1, "0"), + dboard_ctor_t db_container_ctor = NULL ); /*! * Register a restricted rx or tx dboard into the system. + * A restricted dboard does not add its dboard_iface object into the property tree. * For single subdevice boards, omit subdev_names. * The iface for a restricted board is not registered into the property tree. * \param dboard_id the dboard id (rx or tx) - * \param dboard_ctor the dboard constructor function pointer + * \param db_subdev_ctor the dboard sub-device constructor function pointer (one instance per subdev name) * \param name the canonical name for the dboard represented * \param subdev_names the names of the subdevs on this dboard + * \param db_container_ctor the dboard container constructor function pointer (one instance per dboard) */ static void register_dboard_restricted( const dboard_id_t &dboard_id, - dboard_ctor_t dboard_ctor, + dboard_ctor_t db_subdev_ctor, const std::string &name, - const std::vector<std::string> &subdev_names = std::vector<std::string>(1, "0") + const std::vector<std::string> &subdev_names = std::vector<std::string>(1, "0"), + dboard_ctor_t db_container_ctor = NULL ); /*! * Register a restricted xcvr dboard into the system. + * A restricted dboard does not add its dboard_iface object into the property tree. * For single subdevice boards, omit subdev_names. * The iface for a restricted board is not registered into the property tree. * \param rx_dboard_id the rx unit dboard id * \param tx_dboard_id the tx unit dboard id - * \param dboard_ctor the dboard constructor function pointer + * \param db_subdev_ctor the dboard sub-device constructor function pointer (one instance per subdev name) * \param name the canonical name for the dboard represented * \param subdev_names the names of the subdevs on this dboard + * \param db_container_ctor the dboard container constructor function pointer (one instance per dboard) */ static void register_dboard_restricted( const dboard_id_t &rx_dboard_id, const dboard_id_t &tx_dboard_id, - dboard_ctor_t dboard_ctor, + dboard_ctor_t db_subdev_ctor, const std::string &name, - const std::vector<std::string> &subdev_names = std::vector<std::string>(1, "0") + const std::vector<std::string> &subdev_names = std::vector<std::string>(1, "0"), + dboard_ctor_t db_container_ctor = NULL ); /*! |