/src/libzmq/src/metadata.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | /* SPDX-License-Identifier: MPL-2.0 */ |
2 | | |
3 | | #include "precompiled.hpp" |
4 | | #include "metadata.hpp" |
5 | | |
6 | 0 | zmq::metadata_t::metadata_t (const dict_t &dict_) : _ref_cnt (1), _dict (dict_) |
7 | 0 | { |
8 | 0 | } |
9 | | |
10 | | const char *zmq::metadata_t::get (const std::string &property_) const |
11 | 0 | { |
12 | 0 | const dict_t::const_iterator it = _dict.find (property_); |
13 | 0 | if (it == _dict.end ()) { |
14 | | /** \todo remove this when support for the deprecated name "Identity" is dropped */ |
15 | 0 | if (property_ == "Identity") |
16 | 0 | return get (ZMQ_MSG_PROPERTY_ROUTING_ID); |
17 | | |
18 | 0 | return NULL; |
19 | 0 | } |
20 | 0 | return it->second.c_str (); |
21 | 0 | } |
22 | | |
23 | | void zmq::metadata_t::add_ref () |
24 | 0 | { |
25 | 0 | _ref_cnt.add (1); |
26 | 0 | } |
27 | | |
28 | | bool zmq::metadata_t::drop_ref () |
29 | 0 | { |
30 | 0 | return !_ref_cnt.sub (1); |
31 | 0 | } |