Public Member Functions

WorldModelMultiCopyFuser Class Reference

Multi interface copy fuser. More...

#include "multi_copy.h"

Inheritance diagram for WorldModelMultiCopyFuser:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 WorldModelMultiCopyFuser (fawkes::BlackBoard *blackboard, const char *type, const char *from_id_pattern, const char *to_id_format)
 Constructor.
 ~WorldModelMultiCopyFuser ()
 Destructor.
virtual void fuse ()
 The single function that makes fusers work.
virtual void bb_interface_created (const char *type, const char *id) throw ()
 BlackBoard interface created notification.

Detailed Description

Multi interface copy fuser.

This fuser simply copies the data of a number of interfaces to another set (of the same size) of interfaces. The source interfaces are given as pattern with shell wildcards like * and ?. The destination IDs is a pattern that contains exactly one "%u". This is replaced with a running number for the destination interfaces. The fuser registers as an observer and opens any newly created interfaces that match the given pattern and creates a write with the ID like the given format for it. It accounts for the case where pattern and format are similar and avoids opening it's own interfaces causing an infinite loop. Interfaces are never closed.

Author:
Tim Niemueller

Definition at line 38 of file multi_copy.h.


Constructor & Destructor Documentation

WorldModelMultiCopyFuser::WorldModelMultiCopyFuser ( fawkes::BlackBoard blackboard,
const char *  type,
const char *  from_id_pattern,
const char *  to_id_format 
)

Constructor.

Parameters:
blackboard BlackBoard
type interface type of both interfaces
from_id_pattern pattern for ID of the interfaces to copy from
to_id_format format for ID of the interfaces to copy to

Definition at line 56 of file multi_copy.cpp.

References fawkes::BlackBoardInterfaceObserver::bbio_add_observed_create(), fawkes::BlackBoard::close(), fawkes::BlackBoard::open_for_writing(), fawkes::BlackBoard::open_multiple_for_reading(), and fawkes::BlackBoard::register_observer().

WorldModelMultiCopyFuser::~WorldModelMultiCopyFuser (  ) 

Member Function Documentation

void WorldModelMultiCopyFuser::bb_interface_created ( const char *  type,
const char *  id 
) throw () [virtual]

BlackBoard interface created notification.

This is called whenever an interface is created for a type that you registered for.

Parameters:
type type of the interface. If you want to store this make a copy as it is not guaranteed that the supplied string exists for longer than the duration of the method call
id ID of the newly created interface. If you want to store this make a copy as it is not guaranteed that the supplied string exists for longer than the duration of the method call

Reimplemented from fawkes::BlackBoardInterfaceObserver.

Definition at line 119 of file multi_copy.cpp.

References fawkes::Exception::print_trace().

void WorldModelMultiCopyFuser::fuse (  )  [virtual]

The single function that makes fusers work.

In this method fusers shall read from their source interfaces, process the data and write to their output interfaces.

Implements WorldModelFuser.

Definition at line 155 of file multi_copy.cpp.

References fawkes::LockMap< KeyType, ValueType, LessKey >::mutex().


The documentation for this class was generated from the following files: