TSP: The Transport Sample Protocol



The BB Alias System
[The BB Core Library]

Collaboration diagram for The BB Alias System:The BB alias system is a part of the BlackBoard library which enable a special publish interface called bb_alias_publish. More...

Defines

#define ALIAS_SEPARATOR   "."
 The character used for alias separator when generating alias names.
#define MAX_ALIAS_LEVEL   10
 The maximum level of alias-of-alias .

Functions

int32_t bb_alias_increment_idxstack (S_BB_DATADESC_T *aliasstack, int32_t aliasstack_size, int32_t *idxstack, int32_t idxstack_len)
 Increment indexstack from the left most element (alias) to the right most element (target).
void * bb_alias_publish (volatile S_BB_T *bb, S_BB_DATADESC_T *data_desc, const S_BB_DATADESC_T *data_desc_target)
 Publish an aliased data in a BlackBoard.
void * bb_alias_subscribe (volatile S_BB_T *bb, S_BB_DATADESC_T *data_desc, const int32_t *indexstack, const int32_t indexstack_len)
 Subscribe to an aliased data in a BlackBoard.
unsigned long bb_aliasstack_offset (S_BB_DATADESC_T *data_desc_stack, int32_t *index_stack, int32_t stack_size)
 Compute the offset of the data described by the alias stack.
int32_t bb_find_aliastack (volatile S_BB_T *bb, S_BB_DATADESC_T *data_desc_stack, int32_t *stack_max_size)
 Build up an alias stack.
int32_t bb_isalias (const S_BB_DATADESC_T *data_desc)
 True if the described data is an alias.


Detailed Description

The BB alias system is a part of the BlackBoard library which enable a special publish interface called bb_alias_publish.

When publishing alias, one does not allocate new data in the BlackBoard but only define aliases on already published data. Using alias publish one may publish user define type/structure (see E_BB_USER) and then describe the elements of the published structure. A normal publish is called a genuine publish which is opposed to an alias publish . Since an alias published data is refering another published data the refered data is called the target of the alias. A target may itself be an alias or a genuine published data.


Define Documentation

#define ALIAS_SEPARATOR   "."

The character used for alias separator when generating alias names.

#define MAX_ALIAS_LEVEL   10

The maximum level of alias-of-alias .


Function Documentation

int32_t bb_alias_increment_idxstack ( S_BB_DATADESC_T aliasstack,
int32_t  aliasstack_size,
int32_t *  idxstack,
int32_t  idxstack_len 
)

Increment indexstack from the left most element (alias) to the right most element (target).

Parameters:
[in] aliasstack 
[in] aliasstack_size 
[in,out] idxstack 
[in] idxstack_len 
Returns:
E_OK on success, E_NOK otherwise

void* bb_alias_publish ( volatile S_BB_T bb,
S_BB_DATADESC_T data_desc,
const S_BB_DATADESC_T data_desc_target 
)

Publish an aliased data in a BlackBoard.

Parameters:
[in,out] bb BB pointer (should not be NULL).
[in,out] data_desc Data descriptor of the data to be published.
[in] data_desc_target Data descriptor of the data to be aliased.
Returns:
address of the (first) aliased data, NULL if alias failed.

void* bb_alias_subscribe ( volatile S_BB_T bb,
S_BB_DATADESC_T data_desc,
const int32_t *  indexstack,
const int32_t  indexstack_len 
)

Subscribe to an aliased data in a BlackBoard.

Parameters:
[in] bb BB pointer (should not be NULL).
[in,out] data_desc Data descriptor of the data to subscribe to.
  • IN, the name of the data is used
  • OUT, if data has been properly found the data_offset is updated and alias_target too.
[in] indexstack The index stack to be used to find the aliased data
[in] indexstack_len the length of the indexstack.
Returns:
address of the (first) aliased data, NULL if subscribe failed.

unsigned long bb_aliasstack_offset ( S_BB_DATADESC_T data_desc_stack,
int32_t *  index_stack,
int32_t  stack_size 
)

Compute the offset of the data described by the alias stack.

Parameters:
[in] data_desc_stack 
[in] index_stack 
[in] stack_size 
Returns:
the computed offset

int32_t bb_find_aliastack ( volatile S_BB_T bb,
S_BB_DATADESC_T data_desc_stack,
int32_t *  stack_max_size 
)

Build up an alias stack.

An alias stack is a sequence of S_BB_DATADESC_T describing the way to go from an alias to a genuine published symbol.

Parameters:
[in] bb the BlackBoard
[in,out] data_desc_stack the array containing the alias stack.
  • IN, the first index must contain the data descriptor for which we are seeking the alias stack
  • OUT, the first index is not touched and other indexes are updated with intermediate to final target of the alias
[in,out] stack_max_size Stack maximum size
  • IN, the maximum size of the alias stack array
  • OUT, the size of the found alias stack
Returns:
E_OK on sucess E_NOK if we failed to build the alias stack.

int32_t bb_isalias ( const S_BB_DATADESC_T data_desc  ) 

True if the described data is an alias.

Parameters:
[in] data_desc the data descriptor.
Returns:
1 if the specified data is an alias 0 otherwise.

Framework Home Page.


Beware !! TSP wave is coming...