Apollo  6.0
Open source self driving car software
Public Member Functions | List of all members
apollo::drivers::canbus::CanClientFactory Class Reference

CanClientFactory inherites apollo::common::util::Factory. More...

#include <can_client_factory.h>

Inheritance diagram for apollo::drivers::canbus::CanClientFactory:
Inheritance graph
Collaboration diagram for apollo::drivers::canbus::CanClientFactory:
Collaboration graph

Public Member Functions

void RegisterCanClients ()
 Register the CAN clients of all brands. This function call the Function apollo::common::util::Factory::Register() for all of the CAN clients. More...
 
std::unique_ptr< CanClientCreateCANClient (const CANCardParameter &parameter)
 Create a pointer to a specified brand of CAN client. The brand is set in the parameter. More...
 
- Public Member Functions inherited from apollo::common::util::Factory< CANCardParameter::CANCardBrand, CanClient >
bool Register (const CANCardParameter::CANCardBrand &id, CanClient *(*)() creator)
 Registers the class given by the creator function, linking it to id. Registration must happen prior to calling CreateObject. More...
 
bool Contains (const CANCardParameter::CANCardBrand &id)
 
bool Unregister (const CANCardParameter::CANCardBrand &id)
 Unregisters the class with the given identifier. More...
 
void Clear ()
 
bool Empty () const
 
std::unique_ptr< CanClient > CreateObjectOrNull (const CANCardParameter::CANCardBrand &id, Args &&... args)
 Creates and transfers membership of an object of type matching id. Need to register id before CreateObject is called. May return nullptr silently. More...
 
std::unique_ptr< CanClient > CreateObject (const CANCardParameter::CANCardBrand &id, Args &&... args)
 Creates and transfers membership of an object of type matching id. Need to register id before CreateObject is called. More...
 

Detailed Description

CanClientFactory inherites apollo::common::util::Factory.

Member Function Documentation

◆ CreateCANClient()

std::unique_ptr<CanClient> apollo::drivers::canbus::CanClientFactory::CreateCANClient ( const CANCardParameter &  parameter)

Create a pointer to a specified brand of CAN client. The brand is set in the parameter.

Parameters
parameterThe parameter to create the CAN client.
Returns
A pointer to the created CAN client.

◆ RegisterCanClients()

void apollo::drivers::canbus::CanClientFactory::RegisterCanClients ( )

Register the CAN clients of all brands. This function call the Function apollo::common::util::Factory::Register() for all of the CAN clients.


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