TSP: The Transport Sample Protocol



Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

tsp_datapool.c File Reference

#include "tsp_sys_headers.h"
#include "tsp_datapool.h"
#include "tsp_datastruct.h"
#include "tsp_session.h"
#include "tsp_time.h"

Go to the source code of this file.

Functions

void TSP_datapool_get_reverse_list (int *nb, int **list)
 Get the reverse list of global_index wanted by some consumers.

int TSP_datapool_push_next_item (glu_item_t *item)
 Insted of thread created, we push directly the data.

int TSP_datapool_push_commit (time_stamp_t time_stamp, GLU_get_state_t state)
 End of push, we commit the whole.

void TSP_local_datapool_destroy (TSP_datapool_t datapool)
 Destroy a local datapool.

TSP_datapool_t TSP_local_datapool_allocate (int symbols_number, GLU_handle_t h_glu)
 Allocation of a local datapool.

void * TSP_datapool_get_symbol_value (TSP_datapool_t datapool, int provider_global_index, xdr_and_sync_type_t type)
 Get the address of a value in the datapool.

TSP_datapool_t TSP_global_datapool_get_instance (void)
 Get the global datapool instance.


Detailed Description

Header
/cvsroot/tsp/tsp/src/core/ctrl/tsp_datapool.c,v 1.20 2004/09/16 09:38:42 tractobob Exp

-----------------------------------------------------------------------

TSP Library - core components for a generic Transport Sampling Protocol.

Copyright (c) 2002 Yves DUFRENNE, Stephane GALLES, Eric NOULARD and Robert PAGNOT

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

-----------------------------------------------------------------------

Project : TSP Maintainer: tsp@astrium.eads.net Component : Provider

-----------------------------------------------------------------------

Purpose : Datapool implementation FIXME : the global/local datapool cases could have been avoided. Somehow plenty of code may be unified in this source .

-----------------------------------------------------------------------

Definition in file tsp_datapool.c.


Function Documentation

void TSP_datapool_get_reverse_list int *  nb,
int **  list
 

Get the reverse list of global_index wanted by some consumers.

Parameters:
nb : pointer on where to store the number of items
list : pointer on list of global_index

Definition at line 118 of file tsp_datapool.c.

void* TSP_datapool_get_symbol_value TSP_datapool_t  datapool,
int  provider_global_index,
xdr_and_sync_type_t  type
 

Get the address of a value in the datapool.

Parameters:
datapool The datapool handle
provider_global_index The index of the symbol that is searched
type FIXME : this parameter was used to ask for a given type of symbol. As the datapool items should be RAW (and converted when needed), this parameter will be useless.
Returns:
The data address

Definition at line 390 of file tsp_datapool.c.

Referenced by TSP_group_algo_create_symbols_table().

int TSP_datapool_push_commit time_stamp_t  time_stamp,
GLU_get_state_t  state
 

End of push, we commit the whole.

Parameters:
time : date of datapool items
state: ok or error (reconf,eof, ...)

Definition at line 142 of file tsp_datapool.c.

References GLU_GET_DATA_LOST, GLU_GET_EOF, GLU_GET_NEW_ITEM, GLU_GET_NO_ITEM, GLU_GET_RECONF, TSP_MSG_CTRL_EOF, TSP_MSG_CTRL_GLU_DATA_LOST, TSP_MSG_CTRL_RECONF, TSP_session_all_session_send_data(), and TSP_session_all_session_send_msg_ctrl().

int TSP_datapool_push_next_item glu_item_t item  )  [inline]
 

Insted of thread created, we push directly the data.

Parameters:
item : what to push

Definition at line 131 of file tsp_datapool.c.

References glu_item_t::provider_global_index, and glu_item_t::value.

TSP_datapool_t TSP_global_datapool_get_instance void   ) 
 

Get the global datapool instance.

Only used when the sample server is an active one. This function work as a singleton. If the global datapool does not exist or was destroyed, a new datapool is created.

Returns:
The datapool handle

Definition at line 422 of file tsp_datapool.c.

Referenced by TSP_session_create_symbols_table_by_channel().

TSP_datapool_t TSP_local_datapool_allocate int  symbols_number,
GLU_handle_t  h_glu
 

Allocation of a local datapool.

Only used when the sample server is a passive one.

Parameters:
symbols_number Total number of symbols for this datapool
h_glu Handle for the GLU that mus be linked to this datapool
Returns:
The datapool handle

Definition at line 370 of file tsp_datapool.c.

References GLU_handle_t.

void TSP_local_datapool_destroy TSP_datapool_t  datapool  ) 
 

Destroy a local datapool.

Only used when the sample server is a passive one.

Parameters:
datapool The datapool handle

Definition at line 361 of file tsp_datapool.c.

Framework Home Page.


Beware !! TSP wave is coming...