Mercurial > hg > octave-nkf
annotate liboctave/mach-info.h @ 14026:3781981be535 ss-3-5-90
snapshot 3.5.90
* configure.ac (AC_INIT): Version is now 3.5.90.
(OCTAVE_API_VERSION_NUMBER): Now 46.
(OCTAVE_RELEASE_DATE): Now 2011-12-11.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sun, 11 Dec 2011 23:18:31 -0500 |
parents | 7dd7cccf0757 |
children | 72c96de7a403 |
rev | line source |
---|---|
1960 | 1 /* |
2 | |
11523 | 3 Copyright (C) 1996-2011 John W. Eaton |
1960 | 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 | |
7016 | 9 Free Software Foundation; either version 3 of the License, or (at your |
10 option) any later version. | |
1960 | 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 | |
7016 | 18 along with Octave; see the file COPYING. If not, see |
19 <http://www.gnu.org/licenses/>. | |
1960 | 20 |
21 */ | |
22 | |
2317 | 23 #if !defined (octave_mach_info_h) |
24 #define octave_mach_info_h 1 | |
25 | |
26 #include <string> | |
27 | |
28 class | |
6108 | 29 OCTAVE_API |
2317 | 30 oct_mach_info |
31 { | |
2926 | 32 protected: |
33 | |
34 oct_mach_info (void); | |
35 | |
2317 | 36 public: |
37 | |
38 enum float_format | |
39 { | |
4574 | 40 flt_fmt_unknown, |
41 flt_fmt_ieee_little_endian, | |
42 flt_fmt_ieee_big_endian, | |
43 flt_fmt_vax_d, | |
44 flt_fmt_vax_g, | |
45 flt_fmt_cray | |
2317 | 46 }; |
47 | |
2926 | 48 static bool instance_ok (void); |
2317 | 49 |
50 static float_format native_float_format (void); | |
51 | |
52 static bool words_big_endian (void); | |
1960 | 53 |
2317 | 54 static bool words_little_endian (void); |
55 | |
3504 | 56 static float_format string_to_float_format (const std::string&); |
2317 | 57 |
3504 | 58 static std::string float_format_as_string (float_format); |
2317 | 59 |
60 private: | |
61 | |
62 static oct_mach_info *instance; | |
63 | |
13983
7dd7cccf0757
clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
64 static void cleanup_instance (void) { delete instance; instance = 0; } |
7dd7cccf0757
clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
65 |
2317 | 66 // The floating point format for the current machine. |
2926 | 67 mutable float_format native_float_fmt; |
1960 | 68 |
2317 | 69 // TRUE if the byte order on this system is big endian. |
2926 | 70 mutable bool big_chief; |
2317 | 71 |
72 // No copying! | |
73 | |
74 oct_mach_info (const oct_mach_info&); | |
75 | |
76 oct_mach_info& operator = (const oct_mach_info&); | |
77 }; | |
1960 | 78 |
79 #endif |