24 #include <blackboard/shmem/lister.h> 25 #include <utils/system/console_colors.h> 26 #include <utils/ipc/shm.h> 42 BlackBoardSharedMemoryLister::BlackBoardSharedMemoryLister()
49 BlackBoardSharedMemoryLister::~BlackBoardSharedMemoryLister()
59 BlackBoardSharedMemoryLister::print_header()
61 cout << endl << cblue <<
"Fawkes BlackBoard Shared Memory Segments" << cnormal << endl
62 <<
"========================================================================" << endl
64 printf (
"%-3s %-10s %-11s %-16s %-12s %s\n",
65 "#",
"ShmID",
"Semaphore",
"Bytes",
"# attached",
"State");
67 <<
"------------------------------------------------------------------------" << endl;
77 BlackBoardSharedMemoryLister::print_footer()
79 cout <<
"========================================================================" << endl;
87 BlackBoardSharedMemoryLister::print_no_segments()
89 cout <<
"No Fawkes BlackBoard shared memory segments found" << endl;
98 BlackBoardSharedMemoryLister::print_no_orphaned_segments()
100 cout <<
"No " << cdarkgray <<
"orphaned" << cnormal
101 <<
" Fawkes BlackBoard shared memory segments found" << endl;
117 int shm_id,
int semaphore,
118 unsigned int mem_size,
121 unsigned int nattch = SharedMemory::num_attached(shm_id);
122 bool swapable = SharedMemory::is_swapable(shm_id);
123 bool destroyed = SharedMemory::is_destroyed(shm_id);
125 printf (
"%-3u %-10d 0x%08x %-16u %-12u %s%s%s%s%s\n",
126 ++num, shm_id, semaphore, mem_size, nattch,
127 ((nattch > 1) ?
"active" :
"orphaned"),
128 ((swapable || destroyed) ?
" (" :
""),
129 (swapable ?
"S" :
""),
130 (destroyed ?
"D" :
""),
131 ((swapable || destroyed) ?
")" :
"")
Fawkes library namespace.