File: lua-base4.hh

package info (click to toggle)
pdns-recursor 4.4.2-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 7,756 kB
  • sloc: cpp: 68,610; javascript: 26,596; sh: 4,673; makefile: 591; xml: 37
file content (28 lines) | stat: -rw-r--r-- 903 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#pragma once
#include "namespaces.hh"
#include <boost/variant/variant.hpp>
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ext/luawrapper/include/LuaContext.hpp"

class BaseLua4 : public boost::noncopyable
{
protected:
  std::unique_ptr<LuaContext> d_lw; // this is way on top because it must get destroyed _last_

public:
  BaseLua4();
  void loadFile(const std::string &fname);
  void loadString(const std::string &script);
  void loadStream(std::istream &is);
  virtual ~BaseLua4(); // this is so unique_ptr works with an incomplete type
protected:
  void prepareContext();
  virtual void postPrepareContext() = 0;
  virtual void postLoad() = 0;
  typedef vector<pair<string, int> > in_t;
  vector<pair<string, boost::variant<int, in_t, struct timeval* > > > d_pd;
  typedef vector<pair<string, boost::variant<string,bool,int,double> > > Features;
  virtual void getFeatures(Features&);
};