fujuntang
2021-11-30 490948a0d52a3ad7b3f94525a982fc7012d06011
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/**
 * 查看与移出key的工具
 */
#include <assert.h>
#include "net_mod_server_socket_wrapper.h"
//#include "net_mod_socket_wrapper.h"
//#include "bus_server_socket_wrapper.h"
 
#include "shm_mm_wrapper.h"
#include "usg_common.h"
#include <getopt.h>
//#include "logger_factory.h"
 
 
static void usage(const char *name) {
    printf("Usage: %s { list }\n", name);
 
}
 
 
void list () {
    ShmQueueStMap * shmQueueStMap =  shm_mm_attach<ShmQueueStMap>(SHM_QUEUE_ST_KEY);
 
  for(auto it = shmQueueStMap->begin(); it != shmQueueStMap->end(); ++it ) {
      printf("%10d \t %10d\n", it->first, it->second.status);
    
  }
}
 
 
 
int main(int argc, char *argv[]) {
    shm_mm_wrapper_init(512);
 
    int key;
    int i;
    if(argc < 2) {
        usage(argv[0]);
        return 1;
    }
 
    if(strcmp(argv[1], "list") == 0) {
        list();
    } else {
        usage(argv[0]);
    }
     
 
    shm_mm_wrapper_destroy();
    
 
 
}