API

Macros for INDI. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SET_INDI_NEWCALLBACK(class, prop)
 Declare and define the static callback for a new property request. More...
 
#define SET_INDI_SETCALLBACK(class, prop)
 Declare and define the static callback for a set property request. More...
 
#define INDI_NEWCALLBACK_DECL(class, prop)
 Declare the callback for a new property request, and declare and define the static wrapper. More...
 
#define INDI_SETCALLBACK_DECL(class, prop)
 Declare the callback for a set property request, and declare and define the static wrapper. More...
 
#define INDI_NEWCALLBACK_DEFN(class, prop)   int class::newCallBack_ ## prop
 Define the callback for a new property request. More...
 
#define INDI_SETCALLBACK_DEFN(class, prop)   int class::setCallBack_ ## prop
 Define the callback for a set property request. More...
 
#define INDI_VALIDATE_LOG_ERROR(prop1, prop2)
 
#define INDI_VALIDATE_LOG_ERROR_DERIVED(prop1, prop2)
 
#define INDI_VALIDATE_CALLBACK_PROPS_IMPL(prop1, prop2)
 Implementation of new callback INDI property validator for main class. More...
 
#define INDI_VALIDATE_CALLBACK_PROPS(prop1, prop2)   INDI_VALIDATE_CALLBACK_PROPS_IMPL( prop1, prop2 )
 Standard check for matching INDI properties in a callback. More...
 
#define INDI_VALIDATE_CALLBACK_PROPS_DERIVED_IMPL(prop1, prop2)
 Implementation of new callback INDI property validator for derived class. More...
 
#define INDI_VALIDATE_CALLBACK_PROPS_DERIVED(prop1, prop2)   INDI_VALIDATE_CALLBACK_PROPS_DERIVED_IMPL( prop1, prop2)
 Standard check for matching INDI properties in a callback in a CRTP base class. More...
 
#define INDI_NEWCALLBACK(prop)   st_newCallBack_ ## prop
 Get the name of the static callback wrapper for a new property. More...
 
#define INDI_SETCALLBACK(prop)   st_setCallBack_ ## prop
 Get the name of the static callback wrapper for a set property. More...
 
#define REG_INDI_NEWPROP(prop, propName, type)
 Register a NEW INDI property with the class, using the standard callback name. More...
 
#define REG_INDI_NEWPROP_NOCB(prop, propName, type)
 Register a NEW INDI property with the class, with no callback. More...
 
#define REG_INDI_NEWPROP_NOCB_DERIVED(prop, propName, type)
 Register a NEW INDI property with the class, with no callback, using the derived class. More...
 
#define REG_INDI_SETPROP(prop, devName, propName)
 Register a SET INDI property with the class, using the standard callback name. More...
 
#define REG_INDI_SETPROP_DERIVED(prop, devName, propName)
 
#define CREATE_REG_INDI_NEW_NUMBERF(prop, name, min, max, step, format, label, group)
 Create and register a NEW INDI property as a standard number as float, using the standard callback name. More...
 
#define CREATE_REG_INDI_NEW_NUMBERI(prop, name, min, max, step, format, label, group)
 Create and register a NEW INDI property as a standard number as int, using the standard callback name. More...
 
#define CREATE_REG_INDI_NEW_NUMBERU(prop, name, min, max, step, format, label, group)
 Create and register a NEW INDI property as a standard number as unsigned int, using the standard callback name. More...
 
#define CREATE_REG_INDI_RO_NUMBER(prop, name, label, group)
 Create and register a RO INDI property as a number, using the standard callback name. More...
 
#define CREATE_REG_INDI_NEW_TOGGLESWITCH(prop, name)
 Create and register a NEW INDI property as a standard toggle switch, using the standard callback name. More...
 
#define CREATE_REG_INDI_NEW_TOGGLESWITCH_NOCB(prop, name)
 Create and register a read-only INDI property as a standard toggle switch, with no callback. More...
 
#define CREATE_REG_INDI_NEW_REQUESTSWITCH(prop, name)
 Create and register a NEW INDI property as a standard request switch, using the standard callback name. More...
 
#define CREATE_REG_INDI_NEW_NUMBERF_DERIVED(prop, name, min, max, step, format, label, group)
 Create and register a NEW INDI property as a standard number as float, using the standard callback name, using the derived class. More...
 
#define CREATE_REG_INDI_NEW_NUMBERI_DERIVED(prop, name, min, max, step, format, label, group)
 Create and register a NEW INDI property as a standard number as int, using the standard callback name, using the derived class. More...
 
#define CREATE_REG_INDI_NEW_TOGGLESWITCH_DERIVED(prop, name)
 Create and register a NEW INDI property as a standard toggle switch, using the standard callback name, using the derived class. More...
 
#define CREATE_REG_INDI_NEW_REQUESTSWITCH_DERIVED(prop, name)
 Create and register a NEW INDI property as a standard request switch, using the standard callback name, using the derived class. More...
 

Detailed Description

Macros for INDI.

Author
Jared R. Males (jared.nosp@m.male.nosp@m.s@gma.nosp@m.il.c.nosp@m.om)

History:

  • 2018-05-27 created by JRM

Definition in file indiMacros.hpp.

Macro Definition Documentation

◆ INDI_VALIDATE_CALLBACK_PROPS

#define INDI_VALIDATE_CALLBACK_PROPS (   prop1,
  prop2 
)    INDI_VALIDATE_CALLBACK_PROPS_IMPL( prop1, prop2 )

Standard check for matching INDI properties in a callback.

Uses makeUniqueKey() to check.

Causes a return -1 on a mismatch.

Does nothing on a match.

If the test macro XWCTEST_INDI_CALLBACK_VALIDATION is defined this will cause return 0 on a match.

Parameters
prop1[in] the first property to compare
prop2[in] the second property to compare

Definition at line 162 of file indiMacros.hpp.

◆ INDI_VALIDATE_CALLBACK_PROPS_DERIVED

#define INDI_VALIDATE_CALLBACK_PROPS_DERIVED (   prop1,
  prop2 
)    INDI_VALIDATE_CALLBACK_PROPS_DERIVED_IMPL( prop1, prop2)

Standard check for matching INDI properties in a callback in a CRTP base class.

Uses makeUniqueKey() to check.

Causes a return -1 on a mismatch.

Does nothing on a match.

If the test macro XWCTEST_INDI_CALLBACK_VALIDATION is defined this will cause return 0 on a match.

Parameters
prop1[in] the first property to compare
prop2[in] the second property to compare

Definition at line 197 of file indiMacros.hpp.

◆ INDI_VALIDATE_CALLBACK_PROPS_DERIVED_IMPL

#define INDI_VALIDATE_CALLBACK_PROPS_DERIVED_IMPL (   prop1,
  prop2 
)
Value:
if(prop1.createUniqueKey() != prop2.createUniqueKey()) \
{ \
INDI_VALIDATE_LOG_ERROR_DERIVED(prop1, prop2) \
return -1; \
} \

Implementation of new callback INDI property validator for derived class.

Parameters
prop1[in] the first property to compare
prop2[in] the second property to compare

Definition at line 171 of file indiMacros.hpp.

◆ INDI_VALIDATE_CALLBACK_PROPS_IMPL

#define INDI_VALIDATE_CALLBACK_PROPS_IMPL (   prop1,
  prop2 
)
Value:
if(prop1.createUniqueKey() != prop2.createUniqueKey()) \
{ \
INDI_VALIDATE_LOG_ERROR(prop1, prop2) \
return -1; \
}

Implementation of new callback INDI property validator for main class.

Parameters
prop1[in] the first property to compare
prop2[in] the second property to compare

Definition at line 135 of file indiMacros.hpp.

◆ INDI_VALIDATE_LOG_ERROR

#define INDI_VALIDATE_LOG_ERROR (   prop1,
  prop2 
)
Value:
log<software_error>({__FILE__,__LINE__, "INDI properties do not match in callback: " \
+ prop1.createUniqueKey() + " != " + prop2.createUniqueKey()});

Definition at line 121 of file indiMacros.hpp.

◆ INDI_VALIDATE_LOG_ERROR_DERIVED

#define INDI_VALIDATE_LOG_ERROR_DERIVED (   prop1,
  prop2 
)
Value:
derivedT::template log<software_error>({__FILE__,__LINE__, "INDI properties do not match in callback: " \
+ prop1.createUniqueKey() + " != " + prop2.createUniqueKey()});

Definition at line 124 of file indiMacros.hpp.

◆ REG_INDI_SETPROP_DERIVED

#define REG_INDI_SETPROP_DERIVED (   prop,
  devName,
  propName 
)
Value:
if( derived().template registerIndiPropertySet( prop,devName, propName, INDI_SETCALLBACK(prop)) < 0) \
{ \
return derivedT::template log<software_error,-1>({__FILE__,__LINE__, "failed to register set property"}); \
}
#define INDI_SETCALLBACK(prop)
Get the name of the static callback wrapper for a set property.
Definition: indiMacros.hpp:217

Definition at line 288 of file indiMacros.hpp.