Setting size of buffer in configureHook()

Is there any way to safely change a buffer's size after it has been connected?

We are using a non-real-time component with a buffer of string to do real-time logging. Other real-time components connect to the buffer and log, while the non-real-time component simply logs the buffer contents to file.

The problem is that the deployer connects ports before it configures components, so having the non-real-time component set its buffer size during configureHook() does nothing as the buffer is already connected.

Any way around this?

Cheers
S

Setting size of buffer in configureHook()

On Thursday 25 September 2008 15:21:25 kiwi [dot] net [..] ... wrote:
> Is there any way to safely change a buffer's size after it has been
> connected?

BufferPort bufport("bufport", old_size);

bufport.buffer() = new BufferLockFree( new_size );

Will 'install' this new implementation into the existing connection. Also you
can choose BufferLocked or any other implementation.
If there's already content in the current buffer, you'll have to copy it over
manually.

Peter

>
> We are using a non-real-time component with a buffer of string to do
> real-time logging. Other real-time components connect to the buffer and
> log, while the non-real-time component simply logs the buffer contents to
> file.
>
> The problem is that the deployer connects ports before it configures
> components, so having the non-real-time component set its buffer size
> during configureHook() does nothing as the buffer is already connected.
>
> Any way around this?
>
> Cheers
> S

Setting size of buffer in configureHook()

On Thursday 25 September 2008 17:15:58 Peter Soetens wrote:
> On Thursday 25 September 2008 15:21:25 kiwi [dot] net [..] ... wrote:
> > Is there any way to safely change a buffer's size after it has been
> > connected?
>
> BufferPort bufport("bufport", old_size);
>
> bufport.buffer() = new BufferLockFree( new_size );

Whoops. That should have been:

bufport = new BufferLockFree( new_size );

Peter