Mercurial > octave
comparison liboctave/system/mach-info.h @ 21739:c4ab2e54f100
use namespace for oct_mach_info class
* mach-info.h, mach-info.cc: Put oct_mach_info in octave namespace and
rename to mach_info. Change all uses.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 19 May 2016 01:59:35 -0400 |
parents | 1473547f50f5 |
children | 949cb46e6bdb |
comparison
equal
deleted
inserted
replaced
21738:a99c2407f930 | 21739:c4ab2e54f100 |
---|---|
25 | 25 |
26 #include "octave-config.h" | 26 #include "octave-config.h" |
27 | 27 |
28 #include <string> | 28 #include <string> |
29 | 29 |
30 class | 30 namespace octave |
31 OCTAVE_API | |
32 oct_mach_info | |
33 { | 31 { |
34 protected: | 32 class |
33 OCTAVE_API | |
34 mach_info | |
35 { | |
36 protected: | |
35 | 37 |
36 oct_mach_info (void); | 38 mach_info (void); |
37 | 39 |
38 public: | 40 public: |
39 | 41 |
40 enum float_format | 42 enum float_format |
41 { | 43 { |
42 flt_fmt_unknown, | 44 flt_fmt_unknown, |
43 flt_fmt_ieee_little_endian, | 45 flt_fmt_ieee_little_endian, |
44 flt_fmt_ieee_big_endian, | 46 flt_fmt_ieee_big_endian, |
47 }; | |
48 | |
49 static bool instance_ok (void); | |
50 | |
51 static float_format native_float_format (void); | |
52 | |
53 static bool words_big_endian (void); | |
54 | |
55 static bool words_little_endian (void); | |
56 | |
57 static float_format string_to_float_format (const std::string&); | |
58 | |
59 static std::string float_format_as_string (float_format); | |
60 | |
61 private: | |
62 | |
63 static mach_info *instance; | |
64 | |
65 static void cleanup_instance (void) { delete instance; instance = 0; } | |
66 | |
67 // The floating point format for the current machine. | |
68 mutable float_format native_float_fmt; | |
69 | |
70 // TRUE if the byte order on this system is big endian. | |
71 mutable bool big_chief; | |
72 | |
73 // No copying! | |
74 | |
75 mach_info (const mach_info&); | |
76 | |
77 mach_info& operator = (const mach_info&); | |
45 }; | 78 }; |
79 } | |
46 | 80 |
47 static bool instance_ok (void); | 81 #if defined (OCTAVE_USE_DEPRECATED_FUNCTIONS) |
48 | 82 |
49 static float_format native_float_format (void); | 83 OCTAVE_DEPRECATED ("use octave::mach_info instead") |
50 | 84 typedef octave::mach_info oct_mach_info; |
51 static bool words_big_endian (void); | |
52 | |
53 static bool words_little_endian (void); | |
54 | |
55 static float_format string_to_float_format (const std::string&); | |
56 | |
57 static std::string float_format_as_string (float_format); | |
58 | |
59 private: | |
60 | |
61 static oct_mach_info *instance; | |
62 | |
63 static void cleanup_instance (void) { delete instance; instance = 0; } | |
64 | |
65 // The floating point format for the current machine. | |
66 mutable float_format native_float_fmt; | |
67 | |
68 // TRUE if the byte order on this system is big endian. | |
69 mutable bool big_chief; | |
70 | |
71 // No copying! | |
72 | |
73 oct_mach_info (const oct_mach_info&); | |
74 | |
75 oct_mach_info& operator = (const oct_mach_info&); | |
76 }; | |
77 | 85 |
78 #endif | 86 #endif |
87 | |
88 #endif |