Shared memory type example
#include <iostream>
#include <string>
int main(int argc, char** argv)
{
std::cout << "SharedType<int> created!" << std::endl;
else
std::cout << "SharedType<int> opened! Value = " << *shared << std::endl;
std::cout << "Please enter any integer number to put into shared memory type (several processes support). Enter '0' to exit..." << std::endl;
std::string line;
while (getline(std::cin, line))
{
int item = std::stoi(line);
if (item == 0)
break;
std::cout << "Old shared memory type value = " << *shared << std::endl;
*shared = item;
std::cout << "New shared memory type value = " << *shared << std::endl;
}
return 0;
}
bool owner() const
Get the shared memory type owner flag (true if the new one was created, false if the existing one was...
Shared memory type definition.