kakoune/src/register_manager.hh
2013-04-09 20:05:40 +02:00

29 lines
591 B
C++

#ifndef register_manager_hh_INCLUDED
#define register_manager_hh_INCLUDED
#include "register.hh"
#include "utils.hh"
#include <unordered_map>
#include <vector>
#include <functional>
namespace Kakoune
{
typedef std::function<std::vector<String> (const Context&)> RegisterRetriever;
class RegisterManager : public Singleton<RegisterManager>
{
public:
Register& operator[](char reg);
void register_dynamic_register(char reg, RegisterRetriever function);
protected:
std::unordered_map<char, std::unique_ptr<Register>> m_registers;
};
}
#endif // register_manager_hh_INCLUDED