LEFT | RIGHT |
(no file at all) | |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2010 NICTA | 3 * Copyright (c) 2010 NICTA |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU General Public License | 14 * You should have received a copy of the GNU General Public License |
15 * along with this program; if not, write to the Free Software | 15 * along with this program; if not, write to the Free Software |
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
17 * | 17 * |
18 * Author: Quincy Tse <quincy.tse@nicta.com.au> | 18 * Author: Quincy Tse <quincy.tse@nicta.com.au> |
19 */ | 19 */ |
20 | 20 |
21 #ifndef FATAL_IMPL_H | 21 #ifndef FATAL_IMPL_H |
22 #define FATAL_IMPL_H | 22 #define FATAL_IMPL_H |
23 | 23 |
24 #include <ostream> | 24 #include <ostream> |
| 25 |
| 26 #include "ns3/ns3-module.h" |
| 27 #define NS3_MODULE NS3_CORE_MODULE |
| 28 #include "ns3/ns3-export.h" |
25 | 29 |
26 /** | 30 /** |
27 * \file | 31 * \file |
28 * \ingroup fatalimpl | 32 * \ingroup fatalimpl |
29 * ns3::FatalImpl::RegisterStream(), ns3::FatalImpl::UnregisterStream(), | 33 * ns3::FatalImpl::RegisterStream(), ns3::FatalImpl::UnregisterStream(), |
30 * and ns3::FatalImpl::FlushStreams() declarations. | 34 * and ns3::FatalImpl::FlushStreams() declarations. |
31 */ | 35 */ |
32 | 36 |
33 /** | 37 /** |
34 * \ingroup fatal | 38 * \ingroup fatal |
(...skipping 14 matching lines...) Expand all Loading... |
49 * \brief Register a stream to be flushed on abnormal exit. | 53 * \brief Register a stream to be flushed on abnormal exit. |
50 * | 54 * |
51 * If a \c std::terminate() call is encountered after the | 55 * If a \c std::terminate() call is encountered after the |
52 * stream had been registered and before it has been | 56 * stream had been registered and before it has been |
53 * unregistered, \c stream->flush() will be called. Users of | 57 * unregistered, \c stream->flush() will be called. Users of |
54 * this function should ensure the stream remains valid until | 58 * this function should ensure the stream remains valid until |
55 * it had been unregistered. | 59 * it had been unregistered. |
56 * | 60 * |
57 * \param [in] stream The stream to be flushed on abnormal exit. | 61 * \param [in] stream The stream to be flushed on abnormal exit. |
58 */ | 62 */ |
59 void RegisterStream (std::ostream* stream); | 63 void NS3_EXPORT RegisterStream (std::ostream* stream); |
60 | 64 |
61 /** | 65 /** |
62 * \ingroup fatalimpl | 66 * \ingroup fatalimpl |
63 * | 67 * |
64 * \brief Unregister a stream for flushing on abnormal exit. | 68 * \brief Unregister a stream for flushing on abnormal exit. |
65 * | 69 * |
66 * After a stream had been unregistered, \c stream->flush() | 70 * After a stream had been unregistered, \c stream->flush() |
67 * will no longer be called should abnormal termination be | 71 * will no longer be called should abnormal termination be |
68 * encountered. | 72 * encountered. |
69 * | 73 * |
70 * If the stream is not registered, nothing will happen. | 74 * If the stream is not registered, nothing will happen. |
71 * | 75 * |
72 * \param [in] stream The stream to be unregistered. | 76 * \param [in] stream The stream to be unregistered. |
73 */ | 77 */ |
74 void UnregisterStream (std::ostream* stream); | 78 void NS3_EXPORT UnregisterStream (std::ostream* stream); |
75 | 79 |
76 /** | 80 /** |
77 * \ingroup fatalimpl | 81 * \ingroup fatalimpl |
78 * | 82 * |
79 * \brief Flush all currently registered streams. | 83 * \brief Flush all currently registered streams. |
80 * | 84 * |
81 * This function iterates through each registered stream and | 85 * This function iterates through each registered stream and |
82 * unregisters them. The default \c SIGSEGV handler is overridden | 86 * unregisters them. The default \c SIGSEGV handler is overridden |
83 * when this function is being executed, and will be restored | 87 * when this function is being executed, and will be restored |
84 * when this function returns. | 88 * when this function returns. |
85 * | 89 * |
86 * If a \c SIGSEGV is encountered (most likely due to a bad \c ostream* | 90 * If a \c SIGSEGV is encountered (most likely due to a bad \c ostream* |
87 * being registered, or a registered \c osteam* pointing to an | 91 * being registered, or a registered \c osteam* pointing to an |
88 * \c ostream that had already been destroyed), this function will | 92 * \c ostream that had already been destroyed), this function will |
89 * skip the bad \c ostream* and continue to flush the next stream. | 93 * skip the bad \c ostream* and continue to flush the next stream. |
90 * The function will then terminate raising \c SIGIOT (aka \c SIGABRT) | 94 * The function will then terminate raising \c SIGIOT (aka \c SIGABRT) |
91 * | 95 * |
92 * DO NOT call this function until the program is ready to crash. | 96 * DO NOT call this function until the program is ready to crash. |
93 */ | 97 */ |
94 void FlushStreams (void); | 98 void NS3_EXPORT FlushStreams (void); |
95 | 99 |
96 } //FatalImpl | 100 } //FatalImpl |
97 } //ns3 | 101 } //ns3 |
98 | 102 |
99 #endif | 103 #endif |
LEFT | RIGHT |