Fawkes API
Fawkes Development Version
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
All
Classes
Namespaces
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
header.h
1
2
/***************************************************************************
3
* bb_shmem_header.h - BlackBoard shared memory header
4
*
5
* Created: Thu Oct 19 14:19:06 2006 (Anne's 25th Birthday)
6
* Copyright 2006 Tim Niemueller [www.niemueller.de]
7
*
8
****************************************************************************/
9
10
/* This program is free software; you can redistribute it and/or modify
11
* it under the terms of the GNU General Public License as published by
12
* the Free Software Foundation; either version 2 of the License, or
13
* (at your option) any later version. A runtime exception applies to
14
* this software (see LICENSE.GPL_WRE file mentioned below for details).
15
*
16
* This program is distributed in the hope that it will be useful,
17
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
* GNU Library General Public License for more details.
20
*
21
* Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22
*/
23
24
#ifndef __BLACKBOARD_SHMEM_HEADER_H_
25
#define __BLACKBOARD_SHMEM_HEADER_H_
26
27
#include <utils/ipc/shm.h>
28
#include <blackboard/internal/memory_manager.h>
29
30
namespace
fawkes {
31
32
class
SharedMemory;
33
34
class
BlackBoardSharedMemoryHeader
:
public
SharedMemoryHeader
35
{
36
private
:
37
/** This struct determines the header in the shared memory segment
38
*/
39
typedef
struct
{
40
unsigned
int
version
;
/**< version of the BB */
41
void
*shm_addr;
/**< base addr of shared memory */
42
chunk_list_t
*
free_list_head
;
/**< offset of the free chunks list head */
43
chunk_list_t
*
alloc_list_head
;
/**< offset of the allocated chunks list head */
44
} BlackBoardSharedMemoryHeaderData;
45
46
public
:
47
BlackBoardSharedMemoryHeader
(
unsigned
int
version
);
48
BlackBoardSharedMemoryHeader
(
size_t
data_size
,
unsigned
int
version);
49
BlackBoardSharedMemoryHeader
(
const
BlackBoardSharedMemoryHeader
*h);
50
virtual
~BlackBoardSharedMemoryHeader
();
51
void
set_shared_memory
(
SharedMemory
*shmem);
52
virtual
bool
matches
(
void
*memptr);
53
virtual
size_t
size
();
54
virtual
void
initialize
(
void
*memptr);
55
virtual
void
set
(
void
*memptr);
56
virtual
void
reset
();
57
virtual
size_t
data_size
();
58
virtual
SharedMemoryHeader
*
clone
()
const
;
59
virtual
bool
operator==
(
const
fawkes::SharedMemoryHeader
&s)
const
;
60
chunk_list_t
*
free_list_head
();
61
chunk_list_t
*
alloc_list_head
();
62
void
set_free_list_head
(
chunk_list_t
*flh);
63
void
set_alloc_list_head
(
chunk_list_t
*alh);
64
65
unsigned
int
version
()
const
;
66
67
private
:
68
size_t
_data_size;
69
unsigned
int
_version;
70
BlackBoardSharedMemoryHeaderData *data;
71
SharedMemory
*shmem;
72
};
73
74
}
// end namespace fawkes
75
76
#endif
src
libs
blackboard
shmem
header.h
Generated by
1.8.1.2