Debian Codegraph @

seatac/statObj.H

raw symbols SCIP
1 #ifndef STATOBJ_H
2 #define STATOBJ_H
3
4 #include <stdio.h>
5 #include <stdlib.h>
6 #include "sharedObj.H"
7
8
9 class statObj {
10 public:
11 statObj(sharedObj *so, char *soOpts);
12 ~statObj();
13
14 void add(filterObj *FO) {
15 if (soadd)
16 (*soadd)(handle, FO->handle);
17 };
18
19 void show(FILE *file) {
20 if (soshow)
21 (*soshow)(handle, file);
22 };
23
24 private:
25 char *soOpts;
26 sharedObj *so;
27
28 void *handle;
29
30 void * (*soconstruct)(char *);
31 void (*sodestruct)(void *);
32 void (*soadd)(void *, void *);
33 void (*soshow)(void *, FILE *);
34 };
35
36
37 inline
38 statObj::statObj(sharedObj *so_, char *op_) {
39 soOpts = 0L;
40 so = so_;
41
42 handle = 0L;
43
44 soconstruct = 0L;
45 soadd = 0L;
46 soshow = 0L;
47 sodestruct = 0L;
48
49 if (op_) {
50 soOpts = new char [strlen(op_) + 1];
51 strcpy(soOpts, op_);
52 }
53
54 if (so) {
55 soconstruct = (void* (*)(char*))so->get("constructStats");
56 sodestruct = (void (*)(void*))so->get("destructStats");
57 soadd = (void (*)(void*, void*))so->get("addStats");
58 soshow = (void (*)(void*, FILE*))so->get("showStats");
59
60 handle = (*soconstruct)(soOpts);
61 }
62 }
63
64
65 inline
66 statObj::~statObj() {
67 if (sodestruct)
68 (*sodestruct)(handle);
69 delete [] soOpts;
70 }
71
72
73 #endif // STATOBJ_H