JobScheduler  1.1.0
CMJob::RosPublisher< T > Class Template Referencefinal

Ros_Publisher provides a job based interfoce for ros publisher. More...

#include <CMJob_RosPublisher.h>

Inheritance diagram for CMJob::RosPublisher< T >:
Inheritance graph
Collaboration diagram for CMJob::RosPublisher< T >:
Collaboration graph

Public Member Functions

 RosPublisher (const ros::NodeHandlePtr &node, const std::string &topic, const size_t &queue_size=1)
 
void execute (void)
 Execution of the job.
 
void registerCallback (std::function< void(T &)> fp)
 register_callback More...
 
template<typename M >
void registerCallback (void(M::*fp)(T &), M *obj)
 register_callback More...
 
- Public Member Functions inherited from CMJob::AbstractJob
 AbstractJob (const std::string &name, JobType type, bool sync)
 AbstractJob. More...
 
void setCycleTime (unsigned long cycle)
 setCycleTime More...
 
void setCycleOffset (unsigned long cycle)
 setCycleOffset More...
 
void setTimeoutTime (double time_s)
 setTimeoutTime More...
 
void setExecutionCounter (int count)
 setExecutionCounter More...
 
void skipFirstCycles (unsigned count)
 skipFirstNCycles More...
 
void setCallbackHook (CallbackHook hook)
 setCallbackHook More...
 
virtual void init ()
 Initialization of the job. More...
 
virtual void activate ()
 Activation of the job. More...
 
virtual void prepare ()
 Preperation of the job. More...
 
virtual void suspend ()
 Suspension of the job. More...
 
virtual void timeout ()
 Putting job into timeout. More...
 
virtual void disable ()
 Disable the job. More...
 
virtual void reset ()
 Reset the job. More...
 
void info () const
 Prints job details. More...
 
bool isJobScheduled (unsigned long cycle) const
 function, which returns if the job is scheduled at cycle More...
 
bool isCallbackScheduled (unsigned long cycle) const
 function to check if current callback is scheduled at cycle More...
 
bool isJobTimeout (void) const
 isJobTimeout More...
 
std::string getJobName () const
 
unsigned long getCycleTime () const
 
unsigned long getCycleOffset () const
 
bool isSynchronized () const
 
unsigned long getCycle () const
 
JobType getJobType () const
 
std::string getJobTypeName () const
 
CallbackHook getCallbackHook () const
 
std::string getCallbackHookName () const
 
JobState getJobState () const
 
std::string getJobStateName () const
 
void setCycle (unsigned long cycle)
 
void setJobName (const std::string &name)
 set a job name instead of the argument in constructor More...
 

Additional Inherited Members

- Protected Member Functions inherited from CMJob::AbstractJob
void setReady ()
 
void setIdle ()
 
void setActive ()
 
void setSuspended ()
 
void setTimeout ()
 
void setDisabled ()
 

Detailed Description

template<typename T>
class CMJob::RosPublisher< T >

Ros_Publisher provides a job based interfoce for ros publisher.

Member Function Documentation

◆ registerCallback() [1/2]

template<typename T>
void CMJob::RosPublisher< T >::registerCallback ( std::function< void(T &)>  fp)
inline

register_callback

Parameters
fpfunction pointer to callback function

◆ registerCallback() [2/2]

template<typename T>
template<typename M >
void CMJob::RosPublisher< T >::registerCallback ( void(M::*)(T &)  fp,
M *  obj 
)
inline

register_callback

Parameters
fpfunction pointer to callback function
objpointer to the object (e.g. this)