Skip to content

Commit 7960d10

Browse files
author
deepikabhavnani
committed
Add using namespace::class for classes newly added to mbed namespace
`using namespac:class` is need to maintian backwards compatibility, It is used under MBED_NO_NAMESPACE macro, to avoid polluting users namespace.
1 parent 2135026 commit 7960d10

13 files changed

+67
-3
lines changed

features/filesystem/bd/BlockDevice.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,4 +226,11 @@ class BlockDevice
226226
/** @}*/
227227
} // namespace mbed
228228

229+
// Added "using" for backwards compatibility
230+
#ifndef MBED_NO_NAMESPACE
231+
using mbed::BlockDevice;
232+
using mbed::bd_addr_t;
233+
using mbed::bd_size_t;
234+
#endif
235+
229236
#endif

features/filesystem/bd/BufferedBlockDevice.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,4 +169,9 @@ class BufferedBlockDevice : public BlockDevice {
169169
/** @}*/
170170
} // namespace mbed
171171

172+
// Added "using" for backwards compatibility
173+
#ifndef MBED_NO_NAMESPACE
174+
using mbed::BufferedBlockDevice;
175+
#endif
176+
172177
#endif

features/filesystem/bd/ChainingBlockDevice.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,4 +183,9 @@ class ChainingBlockDevice : public BlockDevice
183183
/** @}*/
184184
} // namespace mbed
185185

186+
// Added "using" for backwards compatibility
187+
#ifndef MBED_NO_NAMESPACE
188+
using mbed::ChainingBlockDevice;
189+
#endif
190+
186191
#endif

features/filesystem/bd/ExhaustibleBlockDevice.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,4 +163,9 @@ class ExhaustibleBlockDevice : public BlockDevice
163163
/** @}*/
164164
} // namespace mbed
165165

166+
// Added "using" for backwards compatibility
167+
#ifndef MBED_NO_NAMESPACE
168+
using mbed::ExhaustibleBlockDevice;
169+
#endif
170+
166171
#endif

features/filesystem/bd/FlashSimBlockDevice.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,4 +145,9 @@ class FlashSimBlockDevice : public BlockDevice {
145145
/** @}*/
146146
} // namespace mbed
147147

148+
// Added "using" for backwards compatibility
149+
#ifndef MBED_NO_NAMESPACE
150+
using mbed::FlashSimBlockDevice;
151+
#endif
152+
148153
#endif

features/filesystem/bd/HeapBlockDevice.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ namespace mbed {
2828
/** \addtogroup filesystem */
2929
/** @{*/
3030

31-
32-
3331
/** Lazily allocated heap-backed block device
3432
*
3533
* Useful for simulating a block device and tests
@@ -160,4 +158,9 @@ class HeapBlockDevice : public BlockDevice
160158
/** @}*/
161159
} // namespace mbed
162160

161+
// Added "using" for backwards compatibility
162+
#ifndef MBED_NO_NAMESPACE
163+
using mbed::HeapBlockDevice;
164+
#endif
165+
163166
#endif

features/filesystem/bd/MBRBlockDevice.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,4 +260,9 @@ class MBRBlockDevice : public BlockDevice
260260
/** @}*/
261261
} // namespace mbed
262262

263+
// Added "using" for backwards compatibility
264+
#ifndef MBED_NO_NAMESPACE
265+
using mbed::MBRBlockDevice;
266+
#endif
267+
263268
#endif

features/filesystem/bd/ObservingBlockDevice.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,4 +147,9 @@ class ObservingBlockDevice : public BlockDevice
147147
/** @}*/
148148
} // namespace mbed
149149

150+
// Added "using" for backwards compatibility
151+
#ifndef MBED_NO_NAMESPACE
152+
using mbed::ObservingBlockDevice;
153+
#endif
154+
150155
#endif

features/filesystem/bd/ProfilingBlockDevice.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,11 @@ class ProfilingBlockDevice : public BlockDevice
184184
bd_size_t _erase_count;
185185
};
186186

187+
// Added "using" for backwards compatibility
188+
#ifndef MBED_NO_NAMESPACE
189+
using mbed::ProfilingBlockDevice;
190+
#endif
191+
187192
/** @}*/
188193
} // namespace mbed
189194

features/filesystem/bd/ReadOnlyBlockDevice.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,11 @@ class ReadOnlyBlockDevice : public BlockDevice
136136
BlockDevice *_bd;
137137
};
138138

139+
// Added "using" for backwards compatibility
140+
#ifndef MBED_NO_NAMESPACE
141+
using mbed::ReadOnlyBlockDevice;
142+
#endif
143+
139144
/** @}*/
140145
} // namespace mbed
141146

features/filesystem/bd/SlicingBlockDevice.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ namespace mbed {
2828
/** \addtogroup filesystem */
2929
/** @{*/
3030

31-
3231
/** Block device for mapping to a slice of another block device
3332
*
3433
* @code
@@ -170,6 +169,11 @@ class SlicingBlockDevice : public BlockDevice
170169
bd_size_t _stop;
171170
};
172171

172+
// Added "using" for backwards compatibility
173+
#ifndef MBED_NO_NAMESPACE
174+
using mbed::SlicingBlockDevice;
175+
#endif
176+
173177
/** @}*/
174178
} // namespace mbed
175179

features/filesystem/fat/FATFileSystem.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,4 +273,9 @@ class FATFileSystem : public FileSystem {
273273

274274
} // namespace mbed
275275

276+
// Added "using" for backwards compatibility
277+
#ifndef MBED_NO_NAMESPACE
278+
using mbed::FATFileSystem;
279+
#endif
280+
276281
#endif

features/filesystem/littlefs/LittleFileSystem.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,4 +282,9 @@ class LittleFileSystem : public mbed::FileSystem {
282282

283283
} // namespace mbed
284284

285+
// Added "using" for backwards compatibility
286+
#ifndef MBED_NO_NAMESPACE
287+
using mbed::LittleFileSystem;
288+
#endif
289+
285290
#endif

0 commit comments

Comments
 (0)