]> git.ipfire.org Git - thirdparty/pdns.git/blame - pdns/lua-base4.hh
dnsdist: Fix DNS over plain HTTP broken by `reloadAllCertificates()`
[thirdparty/pdns.git] / pdns / lua-base4.hh
CommitLineData
f03de9dc
AT
1#pragma once
2#include "namespaces.hh"
3#include <boost/variant/variant.hpp>
4#ifdef HAVE_CONFIG_H
5#include "config.h"
6#endif
f03de9dc 7#include "ext/luawrapper/include/LuaContext.hpp"
f03de9dc
AT
8
9class BaseLua4 : public boost::noncopyable
10{
11protected:
f03de9dc 12 std::unique_ptr<LuaContext> d_lw; // this is way on top because it must get destroyed _last_
f03de9dc
AT
13
14public:
9694e14f 15 BaseLua4();
61c42950
FM
16 void loadFile(const std::string& fname);
17 void loadString(const std::string& script);
18 void loadStream(std::istream& is);
f03de9dc
AT
19 virtual ~BaseLua4(); // this is so unique_ptr works with an incomplete type
20protected:
21 void prepareContext();
22 virtual void postPrepareContext() = 0;
23 virtual void postLoad() = 0;
61c42950
FM
24 typedef vector<pair<string, int>> in_t;
25 vector<pair<string, boost::variant<int, in_t, struct timeval*>>> d_pd;
26 typedef vector<pair<string, boost::variant<string, bool, int, double>>> Features;
c4e71b7c 27 virtual void getFeatures(Features&);
f03de9dc 28};