8 #include "DriverDAT_R_SMESHDS_Document.h"
16 double (*cosine)(double);
19 handle = dlopen ("/usr/lib/libm.so", RTLD_LAZY);
21 fputs (dlerror(), stderr);
25 cosine = dlsym(handle, "cos");
26 if ((error = dlerror()) != NULL) {
27 fprintf (stderr, "%s\n", error);
31 printf ("%f\n", (*cosine)(2.0));
35 string Extension=string("DAT");
36 string Class=string("SMESHDS_Document");
37 string myLibrary = string("/home/barberou/barberou/SALOME_3105/build/lib/libMeshDriver")+Extension+string(".so");
39 //Document_Reader* myDriver;//a caster ???
40 DriverDAT_R_SMESHDS_Document* myDriver;
42 string myClass = string("Driver")+Extension+string("_R_")+Class;
45 void* handle = dlopen (myLibrary.c_str(), RTLD_LAZY);
47 fputs (dlerror(), stderr);
52 //int* res = (int*)dlsym(handle, "getOne");
54 SCRUTE(dlsym(handle, "getOne"));
56 myDriver = (DriverDAT_R_SMESHDS_Document*) dlsym(handle, myClass.c_str());
59 if ((error = dlerror()) != NULL) {
60 fprintf (stderr, "%s\n", error);
66 MESSAGE("after close");
71 Document_Reader* Driver::GetDocumentReader(string Extension, string Class) {
76 string myLibrary = string("/home/barberou/barberou/SALOME_3105/build/lib/libMeshDriver")+Extension+string(".so");
78 //Document_Reader* myDriver;//a caster ???
79 DriverDAT_R_SMESHDS_Document* myDriver;
81 string myClass = string("Driver")+Extension+string("_R_")+Class;
84 void* handle = dlopen (myLibrary.c_str(), RTLD_LAZY);
86 fputs (dlerror(), stderr);
90 //myDriver = (Document_Reader*) dlsym(handle, myClass.c_str());
91 int* res = (int*) dlsym(handle, "getOne");
93 myDriver = (DriverDAT_R_SMESHDS_Document*) dlsym(handle, myClass.c_str());
96 if ((error = dlerror()) != NULL) {
97 fprintf (stderr, "%s\n", error);
100 MESSAGE("Reading 2");
103 MESSAGE("after close");
109 Document_Writer* Driver::GetDocumentWriter(string Extension, string Class) {
112 string myLibrary = string("libMeshDriver")+Extension+string(".so");
113 Document_Writer* myDriver;//a caster ???
114 string myClass = string("Driver")+Extension+string("_W_")+Class;
116 void* handle = dlopen (myLibrary.c_str(), RTLD_LAZY);
118 fputs (dlerror(), stderr);
122 myDriver = (Document_Writer*) dlsym(handle, myClass.c_str());
123 if ((error = dlerror()) != NULL) {
124 fprintf (stderr, "%s\n", error);
134 Mesh_Reader* Driver::GetMeshReader(string Extension, string Class) {
137 string myLibrary = string("libMeshDriver")+Extension+string(".so");
138 Mesh_Reader* myDriver;//a caster ???
139 string myClass = string("Driver")+Extension+string("_R_")+Class;
141 void* handle = dlopen (myLibrary.c_str(), RTLD_LAZY);
143 fputs (dlerror(), stderr);
147 myDriver = (Mesh_Reader*) dlsym(handle, myClass.c_str());
148 if ((error = dlerror()) != NULL) {
149 fprintf (stderr, "%s\n", error);
159 Mesh_Writer* Driver::GetMeshWriter(string Extension, string Class) {
162 string myLibrary = string("libMeshDriver")+Extension+string(".so");
163 Mesh_Writer* myDriver;//a caster ???
164 string myClass = string("Driver")+Extension+string("_W_")+Class;
166 void* handle = dlopen (myLibrary.c_str(), RTLD_LAZY);
168 fputs (dlerror(), stderr);
172 myDriver = (Mesh_Writer*) dlsym(handle, myClass.c_str());
173 if ((error = dlerror()) != NULL) {
174 fprintf (stderr, "%s\n", error);