bb_cleanup.cpp

00001 
00002 /***************************************************************************
00003  *  bb_cleanup.cpp - cleanup unused Fawkes BlackBoard shared memory segments
00004  *
00005  *  Generated: Thu Oct 19 14:56:13 2006 (Anne's 25th Birthday)
00006  *  Copyright  2005-2006  Tim Niemueller [www.niemueller.de]
00007  *
00008  ****************************************************************************/
00009 
00010 /*  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version.
00014  *
00015  *  This program is distributed in the hope that it will be useful,
00016  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  *  GNU Library General Public License for more details.
00019  *
00020  *  Read the full text in the LICENSE.GPL file in the doc directory.
00021  */
00022 
00023 #include <blackboard/local.h>
00024 #include <config/sqlite.h>
00025 #include <iostream>
00026 
00027 using namespace std;
00028 using namespace fawkes;
00029 
00030 int
00031 main(int argc, char **argv)
00032 {
00033   SQLiteConfiguration config(CONFDIR);
00034   config.load();
00035 
00036   std::string token = "";
00037   try {
00038     token = config.get_string("/fawkes/mainapp/blackboard_magic_token");
00039   } catch (Exception &e) {
00040     cout << "Could not read shared memory token for blackboard." << endl;
00041     cout << "BlackBoard is probably running without shared memory." << endl;
00042     return -1;
00043   }
00044 
00045   LocalBlackBoard::cleanup(token.c_str());
00046   return 0;
00047 }

Generated on Tue Feb 22 13:31:30 2011 for Fawkes API by  doxygen 1.4.7