ss_subscribe.h File Reference

Interface for subscribe functions and subscribe container. More...

#include <stdio.h>
#include "utils/list.h"
#include "utils/kp_bool.h"
#include "kpi_low.h"
#include "structures.h"

Go to the source code of this file.

Data Structures

struct  subscription_container_s
 Container contains data for subscribe. More...

Typedefs

typedef struct
subscription_container_s 
subscription_container_t
 Container contains data for subscribe.

Functions

subscription_container_tnew_subscription_container ()
 New subscription container.
void free_subscription_container (subscription_container_t *container)
 Free subscription container.
int add_individual_to_subscription_container (subscription_container_t *container, individual_t *ind, list_t *properties)
 Add individual to subscription.
void set_subscription_container_callback (subscription_container_t *container, void(*func)(subscription_container_t *, list_t *))
 Sets callback function for subscription.
int ss_subscribe_container (subscription_container_t *container, bool is_asynchronous)
 Subscribe container.
int wait_subscribe (subscription_container_t *container)
 Wait data from SS for container and update it.
int ss_unsubscribe_container (subscription_container_t *container)
 Unsubscribe given container.
void stop_all_subscriptions ()
 Stop asynchronous subscribe. Unsubscribe all asynchronous containers and remove all containers from list.


Detailed Description

Interface for subscribe functions and subscribe container.

Lomov A. Alexandr <lomov@cs.karelia.ru>

Date:
05 DEcember, 2009

LICENSE

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

PetrSU KP 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 General Public License for more details.

You should have received a copy of the GNU General Public License along with PetrSU KP Library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

DESCRIPTION

ss_subscribe.h - interface for subscribe functions. This file is part of PetrSU KP Library.

Typedef Documentation

Container contains data for subscribe.


Function Documentation

int add_individual_to_subscription_container ( subscription_container_t container,
individual_t ind,
list_t *  properties 
)

Add individual to subscription.

Parameters:
ind individual.
properties list of properties for subscribe or NULL for all properties.
Returns:
0 on success or not otherwise.

void free_subscription_container ( subscription_container_t container  ) 

Free subscription container.

Free subscription container structure. Also free subscription's data structures, individual and properties not freed, only list structure of properties.

Parameters:
container subscription container for free.

subscription_container_t* new_subscription_container (  ) 

New subscription container.

Returns:
new subscription container on success or NULL otherwise.

void set_subscription_container_callback ( subscription_container_t container,
void(*)(subscription_container_t *, list_t *)  func 
)

Sets callback function for subscription.

This functions call then some properties changed in container.

Parameters:
container subscription container.
reference to callback function.

int ss_subscribe_container ( subscription_container_t container,
bool  is_asynchronous 
)

Subscribe container.

Parameters:
container subscription container for subscribe.
is_asynchronous sibscription mode (true - async, false - sync).
Returns:
0 on seccess or not otherwise.

int ss_unsubscribe_container ( subscription_container_t container  ) 

Unsubscribe given container.

Parameters:
container subscription container for unsubscribe.
Returns:
0 on seccess or not otherwise.

void stop_all_subscriptions (  ) 

Stop asynchronous subscribe. Unsubscribe all asynchronous containers and remove all containers from list.

int wait_subscribe ( subscription_container_t container  ) 

Wait data from SS for container and update it.

Parameters:
container subscription container.
Returns:
0 on seccess or not otherwise.


doxygen