Internalfunctions - SmartSlog KP Library
Data Structures | Functions
subscription_changes_internal.h File Reference

Interface for changes of the property. More...

#include "subscription_changes.h"

Go to the source code of this file.

Data Structures

struct  subscription_changes_data_s
 Struct contains information about subscription changes. More...

Functions

subscription_changes_data_tnew_subscription_changes ()
 Creates new subscription chnages data structure (.
void free_subscription_changes (subscription_changes_data_t *changes)
 Free subscription changes data structure (.
void set_sequence_number (subscription_changes_data_t *changes, int sequence_number)
void inc_sequence_number (subscription_changes_data_t *changes)
bool add_individual_to_changes (subscription_changes_data_t *changes, individual_t *individual, action_type action)
 Adds individual to the changes by action.
bool add_individual_uuid_to_changes (subscription_changes_data_t *changes, const char *uuid, action_type action)
bool add_property_to_changes (subscription_changes_data_t *changes, individual_t *owner, property_t *property, const void *new_data, const void *old_data, action_type action)
 Adds property to the changes by action.
void clean_changes_data (subscription_changes_data_t *changes)

Detailed Description

Interface for changes of the property.

Author:
Aleksandr A. Lomov lomov.nosp@m.@cs..nosp@m.karel.nosp@m.ia.r.nosp@m.u
Date:
Created on April 28, 2012, 5:07 PM

LICENSE

SmartSlog 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.

SmartSlog 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 SmartSlog KP Library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

DESCRIPTION

subscription_changes_internal.h - internal interface for changes of the subscription.
Subscription changes contains iformation about chnages that were perfomed under subscribed data.
This file is part of SmartSlog KP Library.

Copyright (C) SmartSlog Team (Aleksandr A. Lomov). All rights reserved.
Mail-list: smart.nosp@m.slog.nosp@m.@cs.k.nosp@m.arel.nosp@m.ia.ru


Function Documentation

bool add_individual_to_changes ( subscription_changes_data_t changes,
individual_t individual,
action_type  action 
)

Adds individual to the changes by action.

This function adds an individual only once, if you pass an individual twice, then it does nothing.

Parameters:
[in]changessubscription changes to add (
See also:
subscription_changes_data_s).
Parameters:
[in]individualindividual that will be added to the changes (
See also:
individual_s)
Parameters:
[in]actionaction that was perfomed under individual: insert, remove, update.
Returns:
true on success(individual has been added or was already in the changes) or false otherwise.
bool add_individual_uuid_to_changes ( subscription_changes_data_t changes,
const char *  uuid,
action_type  action 
)
bool add_property_to_changes ( subscription_changes_data_t changes,
individual_t owner,
property_t property,
const void *  new_data,
const void *  old_data,
action_type  action 
)

Adds property to the changes by action.

Also the function adds owner(individual) to changes as updated individual. You do not need to add individual by youself. Owner will be add to the changes only once.

Parameters:
[in]changessubscription changes to add (
See also:
subscription_changes_data_s).
Parameters:
[in]ownerindividual who has changed property (
See also:
individual_s).
Parameters:
[in]propertyproperty that was changed (
See also:
property_s).
Parameters:
[in]new_datacurrent data(string or individual) of the property.
[in]old_dataprevious data(string or individual) of the property.
[in]actionaction that was perfomed under property: insert, update, remove.
Returns:
true on success or false otherwise.
void clean_changes_data ( subscription_changes_data_t changes)
void free_subscription_changes ( subscription_changes_data_t changes)

Free subscription changes data structure (.

See also:
subscription_changes_data_s).
Parameters:
[in]changesstructure for free, if parameter is NULL then it does nothing.
void inc_sequence_number ( subscription_changes_data_t changes)
subscription_changes_data_t* new_subscription_changes ( )

Creates new subscription chnages data structure (.

See also:
subscription_changes_data_s).
Returns:
new struct on success or NULL otherwise.
void set_sequence_number ( subscription_changes_data_t changes,
int  sequence_number 
)