3.0-rc2 (revision 337012f1)
OTF2_IdMap.h
Go to the documentation of this file.
1 /*
2  * This file is part of the Score-P software (http://www.score-p.org)
3  *
4  * Copyright (c) 2009-2011,
5  * RWTH Aachen University, Germany
6  *
7  * Copyright (c) 2009-2011,
8  * Gesellschaft fuer numerische Simulation mbH Braunschweig, Germany
9  *
10  * Copyright (c) 2009-2011, 2013,
11  * Technische Universitaet Dresden, Germany
12  *
13  * Copyright (c) 2009-2011,
14  * University of Oregon, Eugene, USA
15  *
16  * Copyright (c) 2009-2011,
17  * Forschungszentrum Juelich GmbH, Germany
18  *
19  * Copyright (c) 2009-2011,
20  * German Research School for Simulation Sciences GmbH, Juelich/Aachen, Germany
21  *
22  * Copyright (c) 2009-2011,
23  * Technische Universitaet Muenchen, Germany
24  *
25  * This software may be modified and distributed under the terms of
26  * a BSD-style license. See the COPYING file in the package base
27  * directory for details.
28  *
29  */
30 
31 
32 #ifndef OTF2_IDMAP_H
33 #define OTF2_IDMAP_H
34 
35 
56 #include <stddef.h>
57 #include <stdint.h>
58 #ifndef __cplusplus
59 #include <stdbool.h>
60 #endif
61 
62 
63 #include <otf2/OTF2_ErrorCodes.h>
64 
65 
67 typedef struct OTF2_IdMap_struct OTF2_IdMap;
68 
69 
72 typedef uint8_t OTF2_IdMapMode;
73 
79 {
82 };
83 
84 
87 typedef void
88 ( * OTF2_IdMap_TraverseCallback )( uint64_t localId,
89  uint64_t globalId,
90  void* userData );
91 
92 
93 #ifdef __cplusplus
94 extern "C" {
95 #endif
96 
97 
109 OTF2_IdMap*
111  uint64_t capacity );
112 
113 
134 OTF2_IdMap*
135 OTF2_IdMap_CreateFromUint64Array( uint64_t length,
136  const uint64_t* mappings,
137  bool optimizeSize );
138 
139 
154 OTF2_IdMap*
155 OTF2_IdMap_CreateFromUint32Array( uint64_t length,
156  const uint32_t* mappings,
157  bool optimizeSize );
158 
159 
166 void
167 OTF2_IdMap_Free( OTF2_IdMap* instance );
168 
169 
180 OTF2_IdMap_GetSize( const OTF2_IdMap* instance,
181  uint64_t* size );
182 
183 
194 OTF2_IdMap_GetMode( const OTF2_IdMap* instance,
195  OTF2_IdMapMode* mode );
196 
197 
207 OTF2_IdMap_Clear( OTF2_IdMap* instance );
208 
209 
226  uint64_t localId,
227  uint64_t globalId );
228 
229 
243 OTF2_IdMap_GetGlobalId( const OTF2_IdMap* instance,
244  uint64_t localId,
245  uint64_t* globalId );
246 
247 
262 OTF2_IdMap_GetGlobalIdSave( const OTF2_IdMap* instance,
263  uint64_t localId,
264  uint64_t* globalId );
265 
266 
277 OTF2_IdMap_Traverse( const OTF2_IdMap* instance,
279  void* userData );
280 
281 
282 #ifdef __cplusplus
283 }
284 #endif /* __cplusplus */
285 
286 
287 #endif /* OTF2_IDMAP_H */
OTF2_ErrorCode OTF2_IdMap_Traverse(const OTF2_IdMap *instance, OTF2_IdMap_TraverseCallback callback, void *userData)
uint8_t OTF2_IdMapMode
Definition: OTF2_IdMap.h:72
OTF2_ErrorCode OTF2_IdMap_GetSize(const OTF2_IdMap *instance, uint64_t *size)
Definition: OTF2_IdMap.h:80
void(* OTF2_IdMap_TraverseCallback)(uint64_t localId, uint64_t globalId, void *userData)
Function prototype for use in OTF2_IdMap_Traverse.
Definition: OTF2_IdMap.h:88
OTF2_ErrorCode OTF2_IdMap_GetMode(const OTF2_IdMap *instance, OTF2_IdMapMode *mode)
void OTF2_IdMap_Free(OTF2_IdMap *instance)
OTF2_ErrorCode
Definition: OTF2_ErrorCodes.h:54
OTF2_ErrorCode OTF2_IdMap_AddIdPair(OTF2_IdMap *instance, uint64_t localId, uint64_t globalId)
Definition: OTF2_IdMap.h:81
OTF2_ErrorCode OTF2_IdMap_GetGlobalIdSave(const OTF2_IdMap *instance, uint64_t localId, uint64_t *globalId)
struct OTF2_IdMap_struct OTF2_IdMap
Definition: OTF2_IdMap.h:67
OTF2_IdMap * OTF2_IdMap_CreateFromUint64Array(uint64_t length, const uint64_t *mappings, bool optimizeSize)
OTF2_ErrorCode OTF2_IdMap_Clear(OTF2_IdMap *instance)
OTF2_IdMap * OTF2_IdMap_Create(OTF2_IdMapMode mode, uint64_t capacity)
OTF2_IdMapMode_enum
Definition: OTF2_IdMap.h:78
Error codes and error handling.
OTF2_IdMap * OTF2_IdMap_CreateFromUint32Array(uint64_t length, const uint32_t *mappings, bool optimizeSize)
OTF2_ErrorCode OTF2_IdMap_GetGlobalId(const OTF2_IdMap *instance, uint64_t localId, uint64_t *globalId)