Skip to content

Creating a new profile API

vplachkov edited this page Aug 9, 2012 · 3 revisions

Profile API declares interface of profiles that inherit it. To create Profile API, do the next steps:

  1. Create C++ class that inherits CProfileApiBase class
  2. Pass UID of this Profile api into IVILINK_PROFILE_API_UID() macros
  3. Add pure virtual functions and interface of callbacks class
  4. Create Profile API manifest
  5. Add manifest to Profile API database

Example of Profile API Example of Profile API manifest


Every Profile API has special Profile Proxy class. Object of this class is used to provide access to profile that inherits profile API. To create Profile Proxy, do the next steps:

  1. Create header file
  2. Include there profile API header and CProfileProxy.hpp
  3. Define CURRENT_PROFILE_API, CURRENT_PROFILE_PROXY, CURRENT_PROFILE_PROXY_API_UID by passing name of profile api class, name of profile proxy class and profile API UID.
  4. Add IVILINK_PROFILE_PROXY_BEGIN(CURRENT_PROFILE_PROXY, CURRENT_PROFILE_API, CURRENT_PROFILE_PROXY_API_UID) after previous declarations and IVILINK_PROFILE_PROXY_END in the end of file.
  5. Add virtual functions of Profile API and put there macros that call functions in loaded profiles. There are set of macros for different functions:
  • IVILINK_PROXY_VOID_FUNCTION(CURRENT_PROFILE_API, function_name [, function_parameters]) for void functions

  • IVILINK_PROXY_FUNCTION(CURRENT_PROFILE_API,function_name,return_datatype[, function_parameters]) for functions that return value

  • IVILINK_PROXY_FUNCTION_CONST(CURRENT_PROFILE_API,function_name,return_datatype[, function_parameters]) for const functions that return value`

Example of Profile Proxy

Clone this wiki locally