screpl.bridge_server.block module

BridgeBlock class and its metaclass

class screpl.bridge_server.block. BridgeBlock ( region ) [source]

Bases: eudplib.core.allocator.constexpr.ConstExpr

Basic buffer management class used for shared memory

BridgeBlock is abstract class to manage memory block that is shared with bridge client. It has following c structure:

typedef struct _block {
    int32_t signature;
    int32_t block_size;
    char contents[]; // its size is equals to 'block_size'
} block;
Evaluate ( ) [source]

Magic method to address self

It makes the block as a pointer to its contents. Override from Evaluate() .

collect_dependency ( emitbuffer ) [source]

Collects dependent objects

get_buffer_size ( ) [source]

Returns size of its contents.

Required to be overridden.

signature = b'brbl'
update_content ( ) [source]

Updates contents of the block.

Use self as a pointer to contents of the block. Required to be overridden.

write_payload ( emitbuffer ) [source]

Fills payload buffer