Fawkes API  Fawkes Development Version
protoboard::pb_convert Class Reference

Default ProtoBuf to blackboard converter. More...

#include <protobuf_to_bb.h>

Inheritance diagram for protoboard::pb_convert:

Public Member Functions

 pb_convert ()
 Empty-init constructor. More...
 
 pb_convert (const pb_convert &)=default
 Default copy constructor. More...
 
virtual ~pb_convert ()
 Destructor. Does nothing since members aren't owned by this class. More...
 
pb_convertoperator= (const pb_convert &)=default
 Default copy assignment. More...
 
virtual void init (fawkes::BlackBoard *blackboard, fawkes::Logger *logger, const std::string &="")
 Deferred initialization. More...
 
virtual void handle (std::shared_ptr< google::protobuf::Message > msg)
 Dereference msg and pass it on to handle it by reference. More...
 
virtual void handle (const google::protobuf::Message &msg)
 Handle a ProtoBuf message by reference. More...
 

Protected Attributes

fawkes::BlackBoardblackboard_
 Blackboard used by the main thread. More...
 
fawkes::Loggerlogger_
 Logger from the main thread. More...
 

Detailed Description

Default ProtoBuf to blackboard converter.

This class just defines the necessary operations but does nothing in itself. Thus it can be used to silently ignore certain incoming ProtoBuf message types.

Definition at line 53 of file protobuf_to_bb.h.

Constructor & Destructor Documentation

◆ pb_convert() [1/2]

protoboard::pb_convert::pb_convert ( )

Empty-init constructor.

Definition at line 28 of file protobuf_to_bb.cpp.

◆ pb_convert() [2/2]

protoboard::pb_convert::pb_convert ( const pb_convert )
default

Default copy constructor.

◆ ~pb_convert()

protoboard::pb_convert::~pb_convert ( )
virtual

Destructor. Does nothing since members aren't owned by this class.

Definition at line 32 of file protobuf_to_bb.cpp.

Member Function Documentation

◆ handle() [1/2]

void protoboard::pb_convert::handle ( const google::protobuf::Message &  msg)
virtual

Handle a ProtoBuf message by reference.

Overridden in pb_converter

Parameters
msgReference to a generic ProtoBuf message

Reimplemented in protoboard::pb_sequence_converter< ProtoT, OutputT >, and protoboard::pb_converter< ProtoT, IfaceT >.

Definition at line 50 of file protobuf_to_bb.cpp.

◆ handle() [2/2]

void protoboard::pb_convert::handle ( std::shared_ptr< google::protobuf::Message >  msg)
virtual

Dereference msg and pass it on to handle it by reference.

Parameters
msgshared_ptr to a ProtoBuf message

Definition at line 44 of file protobuf_to_bb.cpp.

◆ init()

void protoboard::pb_convert::init ( fawkes::BlackBoard blackboard,
fawkes::Logger logger,
const std::string &  = "" 
)
virtual

Deferred initialization.

Parameters
blackboardA pointer to a ready-to-use blackboard
loggerA pointer to a ready-to-use logger

Reimplemented in protoboard::pb_converter< ProtoT, IfaceT >.

Definition at line 37 of file protobuf_to_bb.cpp.

References blackboard_, and logger_.

Referenced by protoboard::pb_converter< ProtoT, IfaceT >::init().

◆ operator=()

pb_convert& protoboard::pb_convert::operator= ( const pb_convert )
default

Default copy assignment.

Returns
The left-hand side

Referenced by protoboard::pb_converter< ProtoT, IfaceT >::operator=().

Member Data Documentation

◆ blackboard_

fawkes::BlackBoard* protoboard::pb_convert::blackboard_
protected

◆ logger_

fawkes::Logger* protoboard::pb_convert::logger_
protected

Logger from the main thread.

Definition at line 90 of file protobuf_to_bb.h.

Referenced by protoboard::pb_sequence_converter< ProtoT, OutputT >::handle(), and init().


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