C++ Server-Side SDK
LaunchDarkly SDK
Public Attributes | List of all members
LDServerSDKHook Struct Reference

Hook structure containing callback function pointers. More...

#include <hook.h>

Public Attributes

char const * Name
 
LDServerSDKHook_BeforeEvaluation BeforeEvaluation
 
LDServerSDKHook_AfterEvaluation AfterEvaluation
 
LDServerSDKHook_AfterTrack AfterTrack
 
void * UserData
 

Detailed Description

Hook structure containing callback function pointers.

USAGE:

  1. Allocate an LDServerSDKHook struct (stack or heap)
  2. Call LDServerSDKHook_Init() to initialize it
  3. Set the Name field (required, UTF-8 encoded, null-terminated)
  4. Set any callback function pointers you need (NULL if not used)
  5. Set UserData to application-specific context (NULL if not needed)
  6. Register with LDServerConfigBuilder_Hooks()

EXAMPLE:

struct LDServerSDKHook my_hook;
my_hook.Name = "MyTracingHook";
my_hook.BeforeEvaluation = my_before_callback;
my_hook.AfterEvaluation = my_after_callback;
my_hook.UserData = my_context;
LDServerConfigBuilder_Hooks(builder, my_hook);
LDServerSDKHook_Init(struct LDServerSDKHook *hook)
Initialize a hook structure to safe defaults.
Definition: hook.cpp:8
LDServerConfigBuilder_Hooks(LDServerConfigBuilder builder, struct LDServerSDKHook hook)
Definition: builder.cpp:441
Hook structure containing callback function pointers.
Definition: hook.h:139

LIFETIME:

Member Data Documentation

◆ AfterEvaluation

LDServerSDKHook_AfterEvaluation LDServerSDKHook::AfterEvaluation

Optional callback invoked after evaluations. Set to NULL if not needed.

◆ AfterTrack

LDServerSDKHook_AfterTrack LDServerSDKHook::AfterTrack

Optional callback invoked after track calls. Set to NULL if not needed.

◆ BeforeEvaluation

LDServerSDKHook_BeforeEvaluation LDServerSDKHook::BeforeEvaluation

Optional callback invoked before evaluations. Set to NULL if not needed.

◆ Name

char const* LDServerSDKHook::Name

Name of the hook. Required. Must be a null-terminated UTF-8 string. Must remain valid until LDServerConfigBuilder_Build() is called.

◆ UserData

void* LDServerSDKHook::UserData

Application-specific context pointer passed to all callbacks. Must remain valid for the entire SDK client lifetime. May be NULL if not needed.


The documentation for this struct was generated from the following file: