Program Listing for File AgentFunctionCondition_shim.cuh

Return to documentation for file (include/flamegpu/runtime/AgentFunctionCondition_shim.cuh)

#ifndef INCLUDE_FLAMEGPU_RUNTIME_AGENTFUNCTIONCONDITION_SHIM_CUH_
#define INCLUDE_FLAMEGPU_RUNTIME_AGENTFUNCTIONCONDITION_SHIM_CUH_


class ReadOnlyDeviceAPI;

namespace flamegpu {

#define FLAMEGPU_AGENT_FUNCTION_CONDITION(funcName)\
struct funcName ## _cdn_impl {\
    __device__ __forceinline__ bool operator()(flamegpu::ReadOnlyDeviceAPI *FLAMEGPU) const;\
    static constexpr flamegpu::AgentFunctionConditionWrapper *fnPtr() { return &flamegpu::agent_function_condition_wrapper<funcName ## _cdn_impl>; }\
};\
funcName ## _cdn_impl funcName;\
__device__ __forceinline__ bool funcName ## _cdn_impl::operator()(flamegpu::ReadOnlyDeviceAPI *FLAMEGPU) const

#define FLAMEGPU_AGENT_FUNCTION_CONDITION_DECL(funcName)\
struct funcName ## _cdn_impl {\
    __device__ bool operator()(flamegpu::ReadOnlyDeviceAPI *FLAMEGPU) const;\
    static constexpr flamegpu::AgentFunctionConditionWrapper *fnPtr() { return &flamegpu::agent_function_condition_wrapper<funcName ## _cdn_impl>; }\
};\
extern funcName ## _cdn_impl funcName;

#define FLAMEGPU_AGENT_FUNCTION_CONDITION_DEF(funcName)\
funcName ## _cdn_impl funcName;\
__device__ bool funcName ## _cdn_impl::operator()(flamegpu::ReadOnlyDeviceAPI *FLAMEGPU) const

}  // namespace flamegpu

#endif  // INCLUDE_FLAMEGPU_RUNTIME_AGENTFUNCTIONCONDITION_SHIM_CUH_