1
|
1 /* |
|
2 |
2847
|
3 Copyright (C) 1996, 1997 John W. Eaton |
1
|
4 |
|
5 This file is part of Octave. |
|
6 |
|
7 Octave is free software; you can redistribute it and/or modify it |
|
8 under the terms of the GNU General Public License as published by the |
|
9 Free Software Foundation; either version 2, or (at your option) any |
|
10 later version. |
|
11 |
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
15 for more details. |
|
16 |
|
17 You should have received a copy of the GNU General Public License |
|
18 along with Octave; see the file COPYING. If not, write to the Free |
1315
|
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
1
|
20 |
|
21 */ |
|
22 |
383
|
23 #if !defined (octave_dynamic_ld_h) |
|
24 #define octave_dynamic_ld_h 1 |
1
|
25 |
2862
|
26 #include <string> |
|
27 |
3325
|
28 #include "oct-shlib.h" |
2894
|
29 |
|
30 class |
|
31 octave_dynamic_loader |
|
32 { |
|
33 protected: |
|
34 |
2926
|
35 octave_dynamic_loader (void) { } |
2894
|
36 |
|
37 public: |
|
38 |
2926
|
39 virtual ~octave_dynamic_loader (void) { } |
1
|
40 |
3523
|
41 static bool load (const std::string& fcn_name); |
3325
|
42 |
3523
|
43 static bool remove (const std::string& fcn_name, octave_shlib& shl); |
2894
|
44 |
|
45 private: |
|
46 |
|
47 // No copying! |
|
48 |
|
49 octave_dynamic_loader (const octave_dynamic_loader&); |
|
50 |
|
51 octave_dynamic_loader& operator = (const octave_dynamic_loader&); |
2926
|
52 |
|
53 static octave_dynamic_loader *instance; |
|
54 |
|
55 static bool instance_ok (void); |
|
56 |
3523
|
57 bool do_load (const std::string& fcn_name); |
3325
|
58 |
3523
|
59 bool do_remove (const std::string& fcn_name, octave_shlib& shl); |
3325
|
60 |
|
61 static bool doing_load; |
2926
|
62 |
|
63 protected: |
|
64 |
3523
|
65 static std::string mangle_name (const std::string& name); |
2894
|
66 }; |
1
|
67 |
|
68 #endif |
|
69 |
|
70 /* |
|
71 ;;; Local Variables: *** |
|
72 ;;; mode: C++ *** |
|
73 ;;; End: *** |
|
74 */ |