24#include <blackboard/shmem/lister.h>
25#include <utils/ipc/shm.h>
26#include <utils/system/console_colors.h>
60 <<
cblue <<
"Fawkes BlackBoard Shared Memory Segments" <<
cnormal << endl
61 <<
"========================================================================" << endl
64 "%-3s %-10s %-11s %-16s %-12s %s\n",
"#",
"ShmID",
"Semaphore",
"Bytes",
"# attached",
"State");
65 cout <<
cnormal <<
"------------------------------------------------------------------------"
77 cout <<
"========================================================================" << endl;
86 cout <<
"No Fawkes BlackBoard shared memory segments found" << endl;
97 <<
" Fawkes BlackBoard shared memory segments found" << endl;
114 unsigned int mem_size,
121 printf(
"%-3u %-10d 0x%08x %-16u %-12u %s%s%s%s%s\n",
127 ((nattch > 1) ?
"active" :
"orphaned"),
128 ((swapable || destroyed) ?
" (" :
""),
129 (swapable ?
"S" :
""),
130 (destroyed ?
"D" :
""),
131 ((swapable || destroyed) ?
")" :
""));
virtual void print_no_segments()
Print this if no matching segment was found.
virtual void print_header()
Print header of the table.
virtual void print_footer()
Print footer of the table.
virtual void print_no_orphaned_segments()
Print this if no matching orphaned segment was found.
virtual void print_info(const SharedMemoryHeader *header, int shm_id, int semaphore, unsigned int mem_size, const void *memptr)
Print info about segment.
virtual ~BlackBoardSharedMemoryLister()
Destructor.
BlackBoardSharedMemoryLister()
Constructor.
bool is_destroyed() const
Check if segment has been destroyed This can be used if the segment has been destroyed.
bool is_swapable() const
Check if memory can be swapped out.
unsigned int num_attached() const
Get number of attached processes.
Fawkes library namespace.
static std::string cdarkgray
Print dark gray on console.
static std::string cnormal
Print normal on console, without colors, depends on console settings.
static std::string cblue
Print blue on console.