#ifndef BROKER_H_
#define BROKER_H_

#include <map>
#include <string>
#include <zmq.hpp>
#include "client.h"
#include "topic.h"
#include "message.h"

class Broker {
  public:
    Broker(std::string bind, std::string private_key) :
        bind_(bind), private_key_(private_key) {}

    void main_loop();

  private:
    void handleMessage(const Message& message);
    void sendMessage(Client &client, std::vector<std::string> frames);
    std::string readPrivateKey(std::string path);
    std::map<std::string,Client> clients_;
    std::map<std::string,Topic> topics_;
    zmq::socket_t* socket_;
    size_t recv_ = 0;
    size_t sent_ = 0;
    std::string bind_;
    std::string private_key_;
};

#endif

#ifndef BROKER_H_
#define BROKER_H_

#include <unordered_map>
#include <string>
#include <zmq.hpp>
#include "client.h"
#include "topic.h"
#include "message.h"

class Broker {
  public:
    Broker(std::string bind, std::string private_key) :
        bind_(bind), private_key_(private_key) {}

    void main_loop();

  private:
    void handleMessage(const Message& message);
    void sendMessage(Client &client, std::vector<std::string> frames);
    std::string readPrivateKey(std::string path);
    std::unordered_map<std::string,Client> clients_;
    std::unordered_map<std::string,Topic> topics_;
    zmq::socket_t* socket_;
    size_t recv_ = 0;
    size_t sent_ = 0;
    std::string bind_;
    std::string private_key_;
};

#endif

Use unordered_map rather than map
Use unordered_map rather than map

    `unordered_map` containers are faster than map containers to
    access individual elements by their key, although they are
    generally less efficient for range iteration through a subset
    of their elements.

    http://www.cplusplus.com/reference/unordered_map/unordered_map/

Which is fine, because we never do range iteration on these maps,
so use the tiny bit faster one.
