Fawkes API  Fawkes Development Version
protoboard::pb_sequence_converter< ProtoT, OutputT > Class Template Reference

A special handler for repeated ProtoBuf fields. More...

#include <protobuf_to_bb.h>

Inheritance diagram for protoboard::pb_sequence_converter< ProtoT, OutputT >:

Public Member Functions

 pb_sequence_converter ()
 Default constructor. More...
 
virtual void handle (const google::protobuf::Message &msg) override
 Handle a repeated field inside a ProtoBuf message, where the individual repeated sub-messages should be mapped to a blackboard interface each. More...
 
virtual const sequence_type & extract_sequence (const ProtoT &msg)
 Must be implemented by the user. More...
 
- Public Member Functions inherited from protoboard::pb_convert
 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...
 

Additional Inherited Members

- Protected Attributes inherited from protoboard::pb_convert
fawkes::BlackBoardblackboard_
 Blackboard used by the main thread. More...
 
fawkes::Loggerlogger_
 Logger from the main thread. More...
 

Detailed Description

template<class ProtoT, class OutputT>
class protoboard::pb_sequence_converter< ProtoT, OutputT >

A special handler for repeated ProtoBuf fields.

Template Parameters
ProtoTthe ProtoBuf message type that contains a repeated field we want to unwrap
Thepb_converter type that should be used (repeatedly) on the repeated field

Definition at line 240 of file protobuf_to_bb.h.

Constructor & Destructor Documentation

◆ pb_sequence_converter()

template<class ProtoT , class OutputT >
protoboard::pb_sequence_converter< ProtoT, OutputT >::pb_sequence_converter ( )
inline

Default constructor.

Definition at line 247 of file protobuf_to_bb.h.

Member Function Documentation

◆ extract_sequence()

template<class ProtoT , class OutputT >
virtual const sequence_type& protoboard::pb_sequence_converter< ProtoT, OutputT >::extract_sequence ( const ProtoT &  msg)
virtual

Must be implemented by the user.

Parameters
msgThe message containing the repeated field
Returns
The repeated field

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

◆ handle()

template<class ProtoT , class OutputT >
virtual void protoboard::pb_sequence_converter< ProtoT, OutputT >::handle ( const google::protobuf::Message &  msg)
inlineoverridevirtual

Handle a repeated field inside a ProtoBuf message, where the individual repeated sub-messages should be mapped to a blackboard interface each.

Parameters
msgThe message containing the repeated field that should be extracted

Reimplemented from protoboard::pb_convert.

Definition at line 255 of file protobuf_to_bb.h.

References protoboard::pb_convert::blackboard_, protoboard::pb_sequence_converter< ProtoT, OutputT >::extract_sequence(), and protoboard::pb_convert::logger_.


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