133
91
switch (ops) {
92
case PUSH: {
93
int value;
94
std::cin >> value;
95
96
q->push(pool, value);
97
98
break;
99
}
100
case POP: {
101
std::cout << q->pop(pool) << std::endl;
102
break;
103
}
104
case SHOW: {
105
q->show();
106
break;
107
}
108
case EXIT: {
109
exit(0);
110
}
111
default: {
112
std::cerr << "unknown ops" << std::endl;
113
exit(0);
114
}
115
}
116
}
117
}
The Ecosystem
The overall goal for the libpmemobj C++ bindings was to create a friendly and less
error-prone API for persistent memory programming. Even with persistent memory
pool allocators, a convenient interface for creating and managing transactions,
auto- snapshotting class templates and smart persistent pointers, and designing
Chapter 8 libpmemobj-Cpp: the adaptable language - C++ and persistent memory
Précédent

- 159/457

Suivant