Fawkes API Fawkes Development Version
|
00001 00002 /*************************************************************************** 00003 * shm_lister.h - shared memory buffer lister 00004 * 00005 * Generated: Sun Sep 17 14:23:34 2006 (split from shm.h) 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. A runtime exception applies to 00014 * this software (see LICENSE.GPL_WRE file mentioned below for details). 00015 * 00016 * This program is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 * GNU Library General Public License for more details. 00020 * 00021 * Read the full text in the LICENSE.GPL_WRE file in the doc directory. 00022 */ 00023 00024 #ifndef __UTILS_IPC_SHM_LISTER_H_ 00025 #define __UTILS_IPC_SHM_LISTER_H_ 00026 00027 namespace fawkes { 00028 00029 00030 class SharedMemoryHeader; 00031 00032 /** Format list output for shared memory segments. 00033 * Implement this function specific to your SharedMemoryHeader to printout 00034 * data about the shared memory segments. 00035 * @ingroup IPC 00036 * @author Tim Niemueller 00037 */ 00038 class SharedMemoryLister { 00039 public: 00040 00041 /** virtual destructor */ 00042 virtual ~SharedMemoryLister() {} 00043 00044 /** Print header of the table. 00045 * This should fit on the terminal and thus have a width of at most 00046 * 79 columns. 00047 */ 00048 virtual void print_header() = 0; 00049 00050 /** Print footer of the table. 00051 * This should fit on the terminal and thus have a width of at most 00052 * 79 columns. 00053 */ 00054 virtual void print_footer() = 0; 00055 00056 /** Print this if no matching segment was found. 00057 * Called by SharedMemory if no matching segment could be found. 00058 */ 00059 virtual void print_no_segments() = 0; 00060 00061 /** Print this if no matching orphaned segment was found. 00062 * Called by SharedMemory::erase_orphaned() if no matching segment 00063 * could be found. 00064 */ 00065 virtual void print_no_orphaned_segments() = 0; 00066 00067 /** Print info about segment. 00068 * This method is called for every matching shared memory segment. 00069 * You should print a line of information (maybe more than one line 00070 * if needed) about the segment. 00071 * @param header The data-specific header 00072 * @param shm_id The id of the shared memory segment 00073 * @param semaphore Semaphore key of the given shared memory segment 00074 * @param mem_size the total memory size 00075 * @param memptr pointer to the data segment. 00076 */ 00077 virtual void print_info(const SharedMemoryHeader *header, 00078 int shm_id, int semaphore, 00079 unsigned int mem_size, const void *memptr) = 0; 00080 }; 00081 00082 00083 } // end namespace fawkes 00084 00085 #endif