pipert.core.shared_memory_generator

Module Contents

Classes

MemoryIdIterator

Iterates over a set amount of id’s. The id’s are in the following format:

SharedMemoryGenerator

Generates a set ‘max_count’ amount of shared memories to be used.

Functions

get_shared_memory_object(name)

Get a SharedMemory object that correlates to the name given.

class pipert.core.shared_memory_generator.MemoryIdIterator(component_name, max_count)[source]

Iterates over a set amount of id’s. The id’s are in the following format: “{component_name}_{serial_memory_number}”.

get_next(self)[source]

Get the next shared memory name.

Returns: Next available shared memory name.

pipert.core.shared_memory_generator.get_shared_memory_object(name)[source]

Get a SharedMemory object that correlates to the name given. Args:

name: The name of a shared memory.

Returns: A SharedMemory object.

class pipert.core.shared_memory_generator.SharedMemoryGenerator(component_name, max_count=50, size=5000000)[source]

Generates a set ‘max_count’ amount of shared memories to be used.

create_memories(self)[source]
get_next_shared_memory_name(self)[source]
cleanup(self)[source]

Cleans all of the allocated shared memories to free up the ram.

_destroy_memory(self, memory_to_destroy)[source]

Destroys a specified shared memory.

Args:

memory_to_destroy: The name of the existing shared memory.