Teamcenter C++ API Reference  2312
SmAllocHelper.hxx
Go to the documentation of this file.
1 // // Copyright 2022 Siemens Digital Industries Software
2 // ==================================================
3 // Copyright 2021.
4 // Siemens Product Lifecycle Management Software Inc.
5 // All Rights Reserved.
6 // ==================================================
7 // Copyright 2022 Siemens Digital Industries Software
8 
15 #ifndef TEAMCENTER_BASE_UTILS_SM_ALLOC_HELPER_HXX
16 #define TEAMCENTER_BASE_UTILS_SM_ALLOC_HELPER_HXX
17 
18 #include <cstdio>
19 
20 #include <base_utils/libbase_utils_exports.h>
21 
22 
23 #define SM_ALLOC_PERSISTENT_ARRAY_S( type, count ) ( ( type* )Teamcenter::SmAllocHelper::SM_ALLOC_PERSISTENT_S( count * sizeof( type ) ) )
24 #define SM_CALLOC_PERSISTENT_ARRAY_S( type, count ) ( ( type* )Teamcenter::SmAllocHelper::SM_CALLOC_PERSISTENT_S( count, sizeof( type ) ) )
25 
26 
27 namespace Teamcenter
28 {
29 
30 class BASE_UTILS_API SmAllocHelper
31 {
32 
33 public:
42  static void* SM_ALLOC_PERSISTENT_S( size_t nBytes );
43 
52  static void* SM_REALLOC_PERSISTENT_S( void* ptr, size_t nBytes );
53 
62  static void* SM_CALLOC_PERSISTENT_S( size_t nElements, size_t elementSize );
63 };
64 
65 }
66 
67 
68 #include <base_utils/libbase_utils_undef.h>
69 #endif