SMACC
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Attributes | List of all members
smacc::client_bases::SmaccServiceClient< ServiceType > Class Template Reference

#include <smacc_service_client.h>

Inheritance diagram for smacc::client_bases::SmaccServiceClient< ServiceType >:
Inheritance graph
Collaboration diagram for smacc::client_bases::SmaccServiceClient< ServiceType >:
Collaboration graph

Public Member Functions

 SmaccServiceClient ()
 
 SmaccServiceClient (std::string service_name)
 
virtual void initialize () override
 
bool call (ServiceType &srvreq)
 
- Public Member Functions inherited from smacc::ISmaccClient
 ISmaccClient ()
 
virtual ~ISmaccClient ()
 
virtual void initialize ()
 
virtual std::string getName () const
 
template<typename EventType >
void postEvent (const EventType &ev)
 
template<typename EventType >
void postEvent ()
 
template<typename TComponent >
TComponent * getComponent ()
 
template<typename TComponent >
TComponent * getComponent (std::string name)
 
virtual smacc::introspection::TypeInfo::Ptr getType ()
 
ISmaccStateMachinegetStateMachine ()
 
template<typename TSmaccSignal , typename T >
void connectSignal (TSmaccSignal &signal, void(T::*callback)(), T *object)
 
template<typename SmaccClientType >
void requiresClient (SmaccClientType *&storage)
 
void getComponents (std::vector< std::shared_ptr< ISmaccComponent > > &components)
 

Public Attributes

boost::optional< std::string > serviceName_
 

Protected Attributes

ros::NodeHandle nh_
 
ros::ServiceClient client_
 
bool initialized_
 
- Protected Attributes inherited from smacc::ISmaccClient
std::map< ComponentKey, std::shared_ptr< smacc::ISmaccComponent > > components_
 

Additional Inherited Members

- Protected Member Functions inherited from smacc::ISmaccClient
template<typename TOrthogonal , typename TSourceObject >
void onOrthogonalAllocation ()
 
template<typename SmaccComponentType , typename TOrthogonal , typename TClient , typename... TArgs>
SmaccComponentType * createComponent (TArgs... targs)
 
template<typename SmaccComponentType , typename TOrthogonal , typename TClient , typename... TArgs>
SmaccComponentType * createNamedComponent (std::string name, TArgs... targs)
 
void setStateMachine (ISmaccStateMachine *stateMachine)
 
void setOrthogonal (ISmaccOrthogonal *orthogonal)
 

Detailed Description

template<typename ServiceType>
class smacc::client_bases::SmaccServiceClient< ServiceType >

Definition at line 17 of file smacc_service_client.h.

Constructor & Destructor Documentation

◆ SmaccServiceClient() [1/2]

template<typename ServiceType >
smacc::client_bases::SmaccServiceClient< ServiceType >::SmaccServiceClient ( )
inline

◆ SmaccServiceClient() [2/2]

template<typename ServiceType >
smacc::client_bases::SmaccServiceClient< ServiceType >::SmaccServiceClient ( std::string  service_name)
inline

Member Function Documentation

◆ call()

template<typename ServiceType >
bool smacc::client_bases::SmaccServiceClient< ServiceType >::call ( ServiceType &  srvreq)
inline

Definition at line 50 of file smacc_service_client.h.

51 {
52 return client_.call(srvreq);
53 }

References smacc::client_bases::SmaccServiceClient< ServiceType >::client_.

◆ initialize()

template<typename ServiceType >
virtual void smacc::client_bases::SmaccServiceClient< ServiceType >::initialize ( )
inlineoverridevirtual

Reimplemented from smacc::ISmaccClient.

Definition at line 32 of file smacc_service_client.h.

33 {
34 if (!initialized_)
35 {
36 if (!serviceName_)
37 {
38 ROS_ERROR("service client with no service name set. Skipping.");
39 }
40 else
41 {
42 ROS_INFO_STREAM("[" << this->getName() << "] Client Service: " << *serviceName_);
43 this->initialized_ = true;
44
45 client_ = nh_.serviceClient<ServiceType>(*serviceName_);
46 }
47 }
48 }
virtual std::string getName() const
Definition: client.cpp:34

References smacc::client_bases::SmaccServiceClient< ServiceType >::client_, smacc::ISmaccClient::getName(), smacc::client_bases::SmaccServiceClient< ServiceType >::initialized_, smacc::client_bases::SmaccServiceClient< ServiceType >::nh_, and smacc::client_bases::SmaccServiceClient< ServiceType >::serviceName_.

Here is the call graph for this function:

Member Data Documentation

◆ client_

template<typename ServiceType >
ros::ServiceClient smacc::client_bases::SmaccServiceClient< ServiceType >::client_
protected

◆ initialized_

template<typename ServiceType >
bool smacc::client_bases::SmaccServiceClient< ServiceType >::initialized_
protected

◆ nh_

template<typename ServiceType >
ros::NodeHandle smacc::client_bases::SmaccServiceClient< ServiceType >::nh_
protected

◆ serviceName_

template<typename ServiceType >
boost::optional<std::string> smacc::client_bases::SmaccServiceClient< ServiceType >::serviceName_

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