dragon.native.array

The Dragon native array is an ctypes object allocated from shared memory. The return value is a synchronized wrapper for the object, and the object itself can be accessed via the array attribute of a Array.

array = dragon.native.array.Array(typecode_or_type = ctypes.c_char, size_or_initializer = [b"0", b"1"], lock=True)

Classes

Array

This class implements Dragon array resides in the Dragon channel.

class Array

This class implements Dragon array resides in the Dragon channel.

__init__(typecode_or_type: str, size_or_initializer: int, lock: Lock = True, m_uid: int = 4611686018427387904)

Initialize a array object. :param typecode_or_type: the typecode or type is returned from the dictionary, _TYPECODE_TO_TYPE :type typecode_or_type: str or ctypes, required :param size_or_initializer: the array for the object :type size_or_initializer: range, int, list, required :param lock: dragon.native.lock.Lock, optional :type lock: creates lock for synchronization for array :param m_uid: memory pool to create the channel in and message to write value and typecode_or_type in managed memory, defaults to _DEF_MUID :type m_uid: int, optional

acquire()

Acquire the internal lock object

release()

Release the internal lock object