1 | struct stats{unsigned int records;unsigned int ready;unsigned int committed;unsigned int commax;}; |
---|
2 | class disparm{ |
---|
3 | private: |
---|
4 | static const std::string keyname; |
---|
5 | static const std::string committedname; |
---|
6 | static const std::string valuename; |
---|
7 | static const std::string rcname; |
---|
8 | static const std::string linename; |
---|
9 | |
---|
10 | bool debug; |
---|
11 | |
---|
12 | std::streampos key; |
---|
13 | int committed; |
---|
14 | std::string rc; |
---|
15 | std::string value; |
---|
16 | char status; |
---|
17 | unsigned int linenr; |
---|
18 | |
---|
19 | std::string path_pool; |
---|
20 | std::string path_link; |
---|
21 | std::string baselinkfilename; |
---|
22 | std::string inputfilename; |
---|
23 | std::string path_lockdir; |
---|
24 | std::string path_lock; |
---|
25 | unsigned int maxiter; |
---|
26 | const static int pointerlen = 16; |
---|
27 | std::string lockname; |
---|
28 | std::string pmarker; |
---|
29 | int pmarkerlen; |
---|
30 | int shelltype; |
---|
31 | void setpath_link(std::string filename); |
---|
32 | int getlock(void); |
---|
33 | void removelock(); |
---|
34 | void setpath_lock(std::string p); |
---|
35 | void setbaselinkfilename(std::string filename); |
---|
36 | void createlinkfilename(void); |
---|
37 | void removedanglinglinks(void); |
---|
38 | int remove_lock_and_links(const std::string path, const std::string dirl, |
---|
39 | const std::string path_lock, int timer); |
---|
40 | void remove_lock_and_links(void); |
---|
41 | int realnext(void); |
---|
42 | void debugger(const std::string s); |
---|
43 | std::string createrc(void); |
---|
44 | |
---|
45 | public: |
---|
46 | void setdebug(); |
---|
47 | static const std::string defpath_pool; |
---|
48 | std::string defpath_lockdir; |
---|
49 | static const std::string definputfilename; |
---|
50 | disparm(void); |
---|
51 | void setinputfilename(std::string inputfilename); |
---|
52 | void setmaxiter(int maxiter); |
---|
53 | std::streampos getkey(void); |
---|
54 | int create(std::string &s); |
---|
55 | int next(std::string& s); |
---|
56 | int ready(void); |
---|
57 | int REMOVE(void); |
---|
58 | int getstat(int& records, int& committed, int& ready); |
---|
59 | int echounhandled(void); |
---|
60 | void setpath_pool(std::string pool); |
---|
61 | int setpath_lockdir(std::string lockdir); |
---|
62 | void setkey(std::streampos key); |
---|
63 | friend std::ostream& operator <<(std::ostream &os,disparm &obj); |
---|
64 | stats getstats(); |
---|
65 | }; |
---|