Initial commit
[SXSI/xpathcomp.git] / OCamlStorageInterface.h
1 /*****************************************
2  * OCamlStorageInterface.h
3  * ------------------------
4  * Header file for an OCaml Storage Interface
5  * 
6  * Author: Kim Nguyen
7  * Date: 04/11/08
8  */
9
10 #ifndef OCAMLSTORAGEINTERFACE_H_
11 #define OCAMLSTORAGEINTERFACE_H_
12
13 #include "StorageInterface.h"
14 extern "C" {
15 /* OCaml memory managment */
16
17 #include <caml/mlvalues.h>
18 #include <caml/alloc.h>
19 #include <caml/memory.h>
20 #include <caml/callback.h>
21
22 }// extern C
23
24 #include <list>
25
26 using namespace std;
27
28 class OCamlStorageInterface: public StorageInterface
29 {
30  public:
31         OCamlStorageInterface();
32         virtual ~OCamlStorageInterface();
33         virtual void newChild(string name);
34         virtual void newText(string text); 
35         virtual void nodeFinished();
36         virtual void parsingFinished();
37         virtual void* returnDocument();
38         
39  private:
40         value getDocument();
41         list<value> stack;
42         value document;
43         int nodeid;
44 };
45
46
47 #endif /*OCAMLSTORAGEINTERFACE_H_*/
48