OpenHiva::TopicOptions::BuildShmOptions

Description

Sets the size and number of memory blocks allocated for SHM or DSF communication.

Prototype

OpenHiva::TopicOptions &OpenHiva::TopicOptions::BuildShmOptions(const uint32_t blockSize, const uint32_t blockNum)

Parameters

Parameter

Input/Output

Description

blockSize

Input

Size of the allocated memory block. The value of blockSize must be greater than or equal to the maximum message length. During the SHM and DSF communication, memory blocks are allocated based on blockSize.

blockNum

Input

Number of allocated memory blocks. The size of a memory block is specified by blockSize.

Returns

The TopicOptions object with blockSize and blockNum set is returned.

Usage

None

Precautions

  • Non-reentrant, synchronous interface.
  • The values of blockSize and blockNum for publishing and subscribing to a Topic must be the same.
  • When a Publisher or Subscriber is created, if you do not invoke this interface, the system searches for Topic-related configurations in the configuration file. If no configuration is found in the configuration file, the default values are used.
  • In SHM communication mode, the value of blockSize cannot exceed 30000000 bytes.