FieldParameterAccess Struct Reference

FieldParameterAccess Struct Reference

#include <fg_struct.h>

Data Fields

union { 
 
   double *   p_double 
 
   int32_t *   p_int32_t 
 
   int64_t *   p_int64_t 
 
   uint32_t *   p_uint32_t 
 
   uint64_t *   p_uint64_t 
 
   void *   ptr 
 
};  
 
unsigned int count
 
unsigned int index
 
enum FgParamTypes vtype
 

Detailed Description

accessor struct for array parameters

This struct allows access to array parameters of any type in a flexible way. Both range accesses as well as single value accesses are possible.

struct FieldParameterAccess singleaccess;
struct FieldParameterAccess rangeaccess;
uint64_t primes[7] = { 1, 2, 3, 5, 7, 11, 13 };
uint32_t answer = 42;
// set up single value access
singleaccess.index = 17;
singleaccess.count = 1;
singleaccess.p_uint32_t = &answer;
// set up range access
rangeaccess.vtype = FG_PARAM_TYPE_UINT64_T; // every data value is an uint64_t
rangeaccess.index = 0;
rangeaccess.count = 7;
rangeaccess.p_uint64_t = primes;
@ FG_PARAM_TYPE_UINT32_T
Definition fg_define.h:220
@ FG_PARAM_TYPE_UINT64_T
Definition fg_define.h:222
Definition fg_struct.h:114
enum FgParamTypes vtype
Definition fg_struct.h:115

Field Documentation

◆ [union]

union { ... } FieldParameterAccess

◆ count

unsigned int FieldParameterAccess::count

gives the value count of the range

◆ index

unsigned int FieldParameterAccess::index

gives the first index in the range

◆ p_double

double* FieldParameterAccess::p_double

a range of double values

◆ p_int32_t

int32_t* FieldParameterAccess::p_int32_t

a range of signed 32 bit integer values

◆ p_int64_t

int64_t* FieldParameterAccess::p_int64_t

a range of signed 64 bit integer values

◆ p_uint32_t

uint32_t* FieldParameterAccess::p_uint32_t

a range of unsigned 32 bit integer values

◆ p_uint64_t

uint64_t* FieldParameterAccess::p_uint64_t

a range of unsigned 64 bit integer values

◆ ptr

void* FieldParameterAccess::ptr

for internal access of generalized type

◆ vtype

enum FgParamTypes FieldParameterAccess::vtype

gives the type of the included data