Snapdragon® Telematics Application Framework (TelAF) Interface Specification
le_cdata.h
Go to the documentation of this file.
1 
43 #ifndef LEGATO_CDATA_INCLUDE_GUARD
44 #define LEGATO_CDATA_INCLUDE_GUARD
45 
46 #ifndef LE_CDATA_COMPONENT_COUNT
47  // If legato.h is used in a program built outside of the mktools framework there's only one
48  // instance of each component.
49 # define LE_CDATA_COMPONENT_COUNT 1
50 #endif
51 
52 //--------------------------------------------------------------------------------------------------
56 //--------------------------------------------------------------------------------------------------
57 typedef struct
58 {
59  short key;
60  short instance;
63 
67 #define LE_CDATA_DECLARE(x) static struct x _le_cdata_Instance[LE_CDATA_COMPONENT_COUNT]
68 
69 #if LE_CDATA_COMPONENT_COUNT == 1
70 /* Only one instance of this component; macros refer to a simple structure.
71  * This is optimized to avoid TLS lookup if there's only one instance of the component,
72  * which is the most common case. */
76 # define LE_CDATA_THIS (&_le_cdata_Instance[0])
77 #else
78 
81 # define LE_CDATA_THIS (&_le_cdata_Instance[le_cdata_GetInstance(LE_CDATA_KEY)])
82 #endif
83 
89 unsigned int le_cdata_GetInstance(unsigned int componentKey);
90 
91 #endif /* LEGATO_CDATA_INCLUDE_GUARD */
const _le_cdata_MapEntry_t _le_cdata_ThreadRec_t
Definition: le_cdata.h:62
short key
Definition: le_cdata.h:59
unsigned int le_cdata_GetInstance(unsigned int componentKey)
Definition: le_cdata.h:57
short instance
Definition: le_cdata.h:60