#include <memory>
#include <utility>
#include <wpi/Compiler.h>
#include <wpi/UidVector.h>
#include <wpi/spinlock.h>
#include "hal/simulation/NotifyListener.h"
Go to the source code of this file.
|
namespace | hal |
| WPILib Hardware Abstraction Layer (HAL) namespace.
|
|
namespace | hal::impl |
|
|
#define | HAL_SIMCALLBACKREGISTRY_DEFINE_NAME(NAME) |
| Define a name functor for use with SimCallbackRegistry. More...
|
|
#define | HAL_SIMCALLBACKREGISTRY_DEFINE_CAPI(TYPE, NS, CAPINAME, DATA, LOWERNAME) |
| Define a standard C API for SimCallbackRegistry. More...
|
|
#define | HAL_SIMCALLBACKREGISTRY_DEFINE_CAPI_NOINDEX(TYPE, NS, CAPINAME, DATA, LOWERNAME) |
| Define a standard C API for SimCallbackRegistry (no index variant). More...
|
|
#define | HAL_SIMCALLBACKREGISTRY_STUB_CAPI(TYPE, NS, CAPINAME) |
| Define a stub standard C API for SimCallbackRegistry. More...
|
|
#define | HAL_SIMCALLBACKREGISTRY_STUB_CAPI_NOINDEX(TYPE, NS, CAPINAME) |
| Define a stub standard C API for SimCallbackRegistry (no index variant). More...
|
|
◆ HAL_SIMCALLBACKREGISTRY_DEFINE_CAPI
#define HAL_SIMCALLBACKREGISTRY_DEFINE_CAPI |
( |
|
TYPE, |
|
|
|
NS, |
|
|
|
CAPINAME, |
|
|
|
DATA, |
|
|
|
LOWERNAME |
|
) |
| |
Value: int32_t NS##_Register##CAPINAME##Callback(
int32_t index, TYPE callback, \
void* param) { \
return DATA[
index].LOWERNAME.Register(callback, param); \
} \
\
DATA[
index].LOWERNAME.Cancel(uid); \
}
::int32_t int32_t
Definition: Meta.h:57
Define a standard C API for SimCallbackRegistry.
Functions defined:
- int32 NS_RegisterCAPINAMECallback(
int32_t index, TYPE callback, void* param)
- void NS_CancelCAPINAMECallback(int32_t index, int32_t uid)
- Parameters
-
TYPE | the underlying callback type (e.g. HAL_BufferCallback) |
NS | the "namespace" (e.g. HALSIM) |
CAPINAME | the C API name (usually first letter capitalized) |
DATA | the backing data array |
LOWERNAME | the lowercase name of the backing data registry |
◆ HAL_SIMCALLBACKREGISTRY_DEFINE_CAPI_NOINDEX
#define HAL_SIMCALLBACKREGISTRY_DEFINE_CAPI_NOINDEX |
( |
|
TYPE, |
|
|
|
NS, |
|
|
|
CAPINAME, |
|
|
|
DATA, |
|
|
|
LOWERNAME |
|
) |
| |
Value: int32_t NS##_Register##CAPINAME##Callback(TYPE callback,
void* param) { \
return DATA->LOWERNAME.Register(callback, param); \
} \
\
void NS##_Cancel##CAPINAME##Callback(
int32_t uid) { \
DATA->LOWERNAME.Cancel(uid); \
}
Define a standard C API for SimCallbackRegistry (no index variant).
Functions defined:
- int32 NS_RegisterCAPINAMECallback(TYPE callback, void* param)
- void NS_CancelCAPINAMECallback(int32_t uid)
- Parameters
-
TYPE | the underlying callback type (e.g. HAL_BufferCallback) |
NS | the "namespace" (e.g. HALSIM) |
CAPINAME | the C API name (usually first letter capitalized) |
DATA | the backing data pointer |
LOWERNAME | the lowercase name of the backing data registry |
◆ HAL_SIMCALLBACKREGISTRY_DEFINE_NAME
#define HAL_SIMCALLBACKREGISTRY_DEFINE_NAME |
( |
|
NAME | ) |
|
Value:
Get##NAME##Name() { \
return #NAME; \
}
#define LLVM_ATTRIBUTE_ALWAYS_INLINE
LLVM_ATTRIBUTE_ALWAYS_INLINE - On compilers where we have a directive to do so, mark a method "always...
Definition: Compiler.h:274
Define a name functor for use with SimCallbackRegistry.
This creates a function named GetNAMEName() that returns "NAME".
- Parameters
-
◆ HAL_SIMCALLBACKREGISTRY_STUB_CAPI
#define HAL_SIMCALLBACKREGISTRY_STUB_CAPI |
( |
|
TYPE, |
|
|
|
NS, |
|
|
|
CAPINAME |
|
) |
| |
Value: int32_t NS##_Register##CAPINAME##Callback(
int32_t index, TYPE callback, \
void* param) { \
return 0; \
} \
\
Define a stub standard C API for SimCallbackRegistry.
Functions defined:
- int32 NS_RegisterCAPINAMECallback(
int32_t index, TYPE callback, void* param)
- void NS_CancelCAPINAMECallback(int32_t index, int32_t uid)
- Parameters
-
TYPE | the underlying callback type (e.g. HAL_BufferCallback) |
NS | the "namespace" (e.g. HALSIM) |
CAPINAME | the C API name (usually first letter capitalized) |
◆ HAL_SIMCALLBACKREGISTRY_STUB_CAPI_NOINDEX
#define HAL_SIMCALLBACKREGISTRY_STUB_CAPI_NOINDEX |
( |
|
TYPE, |
|
|
|
NS, |
|
|
|
CAPINAME |
|
) |
| |
Value: int32_t NS##_Register##CAPINAME##Callback(TYPE callback,
void* param) { \
return 0; \
} \
\
void NS##_Cancel##CAPINAME##Callback(
int32_t uid) {}
Define a stub standard C API for SimCallbackRegistry (no index variant).
Functions defined:
- int32 NS_RegisterCAPINAMECallback(TYPE callback, void* param)
- void NS_CancelCAPINAMECallback(int32_t uid)
- Parameters
-
TYPE | the underlying callback type (e.g. HAL_BufferCallback) |
NS | the "namespace" (e.g. HALSIM) |
CAPINAME | the C API name (usually first letter capitalized) |