kakoune/src/register_manager.hh

29 lines
591 B
C++
Raw Normal View History

2011-09-23 16:31:57 +02:00
#ifndef register_manager_hh_INCLUDED
#define register_manager_hh_INCLUDED
#include "register.hh"
2011-09-23 16:31:57 +02:00
#include "utils.hh"
#include <unordered_map>
#include <vector>
#include <functional>
2011-09-23 16:31:57 +02:00
namespace Kakoune
{
using RegisterRetriever = std::function<std::vector<String> (const Context&)>;
2011-09-23 16:31:57 +02:00
class RegisterManager : public Singleton<RegisterManager>
{
public:
Register& operator[](char reg);
void register_dynamic_register(char reg, RegisterRetriever function);
2011-09-23 16:31:57 +02:00
protected:
std::unordered_map<char, std::unique_ptr<Register>> m_registers;
2011-09-23 16:31:57 +02:00
};
}
#endif // register_manager_hh_INCLUDED