cancel
Showing results for 
Search instead for 
Did you mean: 
SOLVED

C++ datalayer.register.node example with other datatypes

C++ datalayer.register.node example with other datatypes

LunatiX
New Contributor

I'm able to register new FLOAT nodes inside the datalayer with the C++ example (datalayer.register.node) from SDK. But how can I register other datatypes like STRING, INT, DOUBLE?

Could someone provide a detailed example? This would be very usefull to provide a good example for customers presentation.

 

3 REPLIES 3

JohannesA
Established Member

Hi slu2but,

basically you register a provider, in this example the provider contains a float value and you are able to set the value to another float.

The datatype provided by your node ist a variant. All these types are possible:

  //! Types for Variant

typedef enum class VariantType {
UNKNOWN,            //! unknown data type
BOOL8,              //! bool 8 bit
INT8,               //! signed int 8 bit
UINT8,              //! unsigned int 8 bit
INT16,              //! signed int 16 bit
UINT16,             //! unsigned int 16 bit
INT32,              //! signed int 32 bit
UINT32,             //! unsigned int 32 bit
INT64,              //! signed int 64 bit
UINT64,             //! unsigned int 64 bit
FLOAT32,            //! float 32 bit
FLOAT64,            //! float 64 bit
STRING,             //! string (UTF-8)

ARRAY_OF_BOOL8,     //! array of bool 8 bit
ARRAY_OF_INT8,      //! array of signed int 8 bit
ARRAY_OF_UINT8,     //! array of unsigned int 8 bit
ARRAY_OF_INT16,     //! array of signed int 16 bit
ARRAY_OF_UINT16,    //! array of unsigned int 16 bit
ARRAY_OF_INT32,     //! array of signed int 32 bit
ARRAY_OF_UINT32,    //! array of unsigned int 32 bit
ARRAY_OF_INT64,     //! array of signed int 64 bit
ARRAY_OF_UINT64,    //! array of unsigned int 64 bit
ARRAY_OF_FLOAT32,   //! array of float 32 bit
ARRAY_OF_FLOAT64,   //! array of float 64 bit
ARRAY_OF_STRING,    //! array of string (UTF-8)

RAW,                //! raw bytes
FLATBUFFERS,        //! bytes as a complex data type encoded as a flatbuffer
}VariantType;
 
In your example the m_value variable is a float, its also possible to use other variables.
 

Goldfinger
Established Member

Hello,

here is the newest version of the example register.node. This will be included in the next release.

Includes string, float and integer.

Hth

Now I'm using the SDK Version 1.0.0-develop.144 and with that it's possible to write other datatypes to the datalayer. Thanks

Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist