Fawkes API
Fawkes Development Version
bb_list.cpp
1
2
/***************************************************************************
3
* bb_list.cpp - list Fawkes BlackBoard shared memory segments
4
*
5
* Generated: Thu Oct 19 14:56:13 2006 (Anne's 25th Birthday)
6
* Copyright 2005-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.
14
*
15
* This program is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU Library General Public License for more details.
19
*
20
* Read the full text in the LICENSE.GPL file in the doc directory.
21
*/
22
23
#include <blackboard/bbconfig.h>
24
#include <blackboard/blackboard.h>
25
#include <blackboard/shmem/header.h>
26
#include <blackboard/shmem/lister.h>
27
#include <config/sqlite.h>
28
#include <utils/ipc/shm.h>
29
30
#include <iostream>
31
32
using namespace
std;
33
using namespace
fawkes
;
34
35
int
36
main(
int
argc,
char
**argv)
37
{
38
SQLiteConfiguration
config(CONFDIR);
39
config.
load
();
40
41
std::string token =
""
;
42
try
{
43
token = config.
get_string
(
"/fawkes/mainapp/blackboard_magic_token"
);
44
}
catch
(
Exception
&e) {
45
cout <<
"Could not read shared memory token for blackboard."
<< endl;
46
cout <<
"BlackBoard is probably running without shared memory."
<< endl;
47
return
-1;
48
}
49
50
BlackBoardSharedMemoryHeader
*bbsh =
new
BlackBoardSharedMemoryHeader
(BLACKBOARD_VERSION);
51
BlackBoardSharedMemoryLister
*bblister =
new
BlackBoardSharedMemoryLister
();
52
SharedMemory::list(token.c_str(), bbsh, bblister);
53
delete
bblister;
54
delete
bbsh;
55
return
0;
56
}
fawkes::BlackBoardSharedMemoryHeader
Definition:
header.h:38
fawkes::Configuration::load
virtual void load(const char *file_path)=0
fawkes
fawkes::BlackBoardSharedMemoryLister
Definition:
lister.h:37
fawkes::Configuration::get_string
virtual std::string get_string(const char *path)=0
fawkes::SQLiteConfiguration
Definition:
sqlite.h:39
fawkes::Exception
Definition:
exception.h:39
src
tools
blackboard
bb_list.cpp
Generated by
1.8.16