0
0
mirror of https://github.com/zeromq/libzmq.git synced 2024-12-28 07:58:14 +08:00

Problem: members of mechanmism_t are needlessly protected

Solution: make them private
This commit is contained in:
Simon Giesecke 2018-05-29 11:08:22 +02:00
parent 2dfdcaff26
commit 25461a78dd
2 changed files with 13 additions and 10 deletions

View File

@ -63,7 +63,7 @@ void zmq::mechanism_t::peer_routing_id (msg_t *msg_)
void zmq::mechanism_t::set_user_id (const void *data_, size_t size_)
{
_user_id.set (static_cast<const unsigned char *> (data_), size_);
zap_properties.ZMQ_MAP_INSERT_OR_EMPLACE (
_zap_properties.ZMQ_MAP_INSERT_OR_EMPLACE (
std::string (ZMQ_MSG_PROPERTY_USER_ID),
std::string (reinterpret_cast<const char *> (data_), size_));
}
@ -268,7 +268,7 @@ int zmq::mechanism_t::parse_metadata (const unsigned char *ptr_,
if (rc == -1)
return -1;
}
(zap_flag_ ? zap_properties : zmtp_properties)
(zap_flag_ ? _zap_properties : _zmtp_properties)
.ZMQ_MAP_INSERT_OR_EMPLACE (
name,
std::string (reinterpret_cast<const char *> (value), value_length));

View File

@ -81,9 +81,12 @@ class mechanism_t
const blob_t &get_user_id () const;
const metadata_t::dict_t &get_zmtp_properties () { return zmtp_properties; }
const metadata_t::dict_t &get_zmtp_properties ()
{
return _zmtp_properties;
}
const metadata_t::dict_t &get_zap_properties () { return zap_properties; }
const metadata_t::dict_t &get_zap_properties () { return _zap_properties; }
protected:
// Only used to identify the socket for the Socket-Type
@ -123,15 +126,15 @@ class mechanism_t
virtual int
property (const std::string &name_, const void *value_, size_t length_);
// Properties received from ZMTP peer.
metadata_t::dict_t zmtp_properties;
// Properties received from ZAP server.
metadata_t::dict_t zap_properties;
const options_t options;
private:
// Properties received from ZMTP peer.
metadata_t::dict_t _zmtp_properties;
// Properties received from ZAP server.
metadata_t::dict_t _zap_properties;
blob_t _routing_id;
blob_t _user_id;