<commit_before>/*

$Header: /home/def/zae/tsp/tsp/src/util/libbb/bb_core.h,v 1.20 2006-04-25 21:08:17 erk Exp $

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

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

Copyright (c) 2002 <NAME>, <NAME>, <NAME> and <NAME> 

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 : <EMAIL>
Component : BlackBoard

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

Purpose   : BlackBoard Idiom implementation

-----------------------------------------------------------------------
 */
#ifndef _BB_H_
#define _BB_H_

#include <stdio.h>
#include <sys/sem.h>
#include <tsp_abs_types.h>
#if defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)
/* union semun is defined by including <sys/sem.h> */
#else
#ifdef _SEM_SEMUN_UNDEFINED
#undef _SEM_SEMUN_UNDEFINED
#endif
/*
 * Union a definir et utiliser
 * pour les appels 'semop' SysV.
 */
union semun {
  int val;                           /* value for SETVAL */
  struct semid_ds *buf;              /* buffer for IPC_STAT & IPC_SET */
  unsigned short int *array;         /* array for GETALL & SETALL */
  struct seminfo *__buf;             /* buffer for IPC_INFO */
};
#endif


/**
 * @defgroup BlackBoard The BlackBoard (BB)
 * BlackBoard idiom definition and functions.
 * A BlackBoard is an inter-process communication mean based
 * on the publish/subscribe principle. It is implemented using
 * classical IPC objects:
 *    <ul>
 *       <li> 1 shared memory ojbect </li>
 *       <li> 1 message queue (may be more in the future) </li>
 *       <li> 1 semaphore set containing 1 semaphore (may be more in the future) </li>
 *    </ul>
 * The current implementation use SystemV IPC (shmget, semget, msgget) but
 * the BlackBoard may be easily translated to any other similar IPC tools,
 * such as POSIX IPC.
 * Every process/thread attached to the BlackBoard may
 * publish (@ref bb_publish) or subscribe (@ref bb_subscribe) to a piece of data using a key
 * (string based in this implementation).
 * You may have as many BlackBoard as the local memory authorize it.
 * A BlackBoard is identified by a name, the BlackBoard Name and
 * an identifier.
 *
 * The BlackBoard is mainly composed of its shared memory object which is<commit_msg>Remove "The" in doxygen<commit_after>/*

$Header: /home/def/zae/tsp/tsp/src/util/libbb/bb_core.h,v 1.21 2006-05-26 14:12:33 erk Exp $

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

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

Copyright (c) 2002 <NAME>, <NAME>, <NAME> and <NAME> 

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 : <EMAIL>
Component : BlackBoard

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

Purpose   : BlackBoard Idiom implementation

-----------------------------------------------------------------------
 */
#ifndef _BB_H_
#define _BB_H_

#include <stdio.h>
#include <sys/sem.h>
#include <tsp_abs_types.h>
#if defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)
/* union semun is defined by including <sys/sem.h> */
#else
#ifdef _SEM_SEMUN_UNDEFINED
#undef _SEM_SEMUN_UNDEFINED
#endif
/*
 * Union a definir et utiliser
 * pour les appels 'semop' SysV.
 */
union semun {
  int val;                           /* value for SETVAL */
  struct semid_ds *buf;              /* buffer for IPC_STAT & IPC_SET */
  unsigned short int *array;         /* array for GETALL & SETALL */
  struct seminfo *__buf;             /* buffer for IPC_INFO */
};
#endif


/**
 * @defgroup BlackBoard BlackBoard (BB)
 * BlackBoard idiom definition and functions.
 * A BlackBoard is an inter-process communication mean based
 * on the publish/subscribe principle. It is implemented using
 * classical IPC objects:
 *    <ul>
 *       <li> 1 shared memory ojbect </li>
 *       <li> 1 message queue (may be more in the future) </li>
 *       <li> 1 semaphore set containing 1 semaphore (may be more in the future) </li>
 *    </ul>
 * The current implementation use SystemV IPC (shmget, semget, msgget) but
 * the BlackBoard may be easily translated to any other similar IPC tools,
 * such as POSIX IPC.
 * Every process/thread attached to the BlackBoard may
 * publish (@ref bb_publish) or subscribe (@ref bb_subscribe) to a piece of data using a key
 * (string based in this implementation).
 * You may have as many BlackBoard as the local memory authorize it.
 * A BlackBoard is identified by a name, the BlackBoard Name and
 * an identifier.
 *
 * The BlackBoard is mainly composed of its shared memory object which is
{'fraction_non_alphanumeric': 0.16366612111292964, 'fraction_numerical': 0.01342062193126023, 'mean_word_length': 2.389351081530782, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4977873', 'n_tokens_mistral': 1734, 'n_tokens_neox': 1625, 'n_words': 739}