Choreonoid  1.5
Public Types | Public Member Functions | Friends | List of all members
cnoid::LazyCaller Class Reference

#include <LazyCaller.h>

Inheritance diagram for cnoid::LazyCaller:
cnoid::LazySignalBase cnoid::LazySignal< SignalType > cnoid::LazySignal< cnoid::Signal< void()> >

Public Types

enum  { PRIORITY_HIGH = 0, PRIORITY_NORMAL, PRIORITY_LOW }
 
typedef void result_type
 

Public Member Functions

 LazyCaller ()
 
 LazyCaller (const boost::function< void(void)> &function, int priority=PRIORITY_HIGH)
 
 LazyCaller (const LazyCaller &org)
 
virtual ~LazyCaller ()
 
void setFunction (const boost::function< void(void)> &function)
 
void setPriority (int priority)
 
void setConservative (bool on)
 
bool isPending () const
 
void flush ()
 
void operator() ()
 
void cancel ()
 

Friends

class LazyCallerImpl
 

Detailed Description

Note
This is not thread safe
Todo:
Make this thread safe so that the function can be called non-main threads

Member Typedef Documentation

◆ result_type

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
PRIORITY_HIGH 
PRIORITY_NORMAL 
PRIORITY_LOW 

Constructor & Destructor Documentation

◆ LazyCaller() [1/3]

LazyCaller::LazyCaller ( )

◆ LazyCaller() [2/3]

LazyCaller::LazyCaller ( const boost::function< void(void)> &  function,
int  priority = PRIORITY_HIGH 
)

◆ LazyCaller() [3/3]

LazyCaller::LazyCaller ( const LazyCaller org)

◆ ~LazyCaller()

LazyCaller::~LazyCaller ( )
virtual

Member Function Documentation

◆ cancel()

void LazyCaller::cancel ( )

◆ flush()

void LazyCaller::flush ( )

◆ isPending()

bool cnoid::LazyCaller::isPending ( ) const
inline

◆ operator()()

void cnoid::LazyCaller::operator() ( )
inline

Multiple requests before the actual function call is summarized into a single call

◆ setConservative()

void LazyCaller::setConservative ( bool  on)

The function is called once even if the lazy call is requested many times before the function is actually called. If the conservative mode is on, the function is called one before the function is called and finished.

◆ setFunction()

void LazyCaller::setFunction ( const boost::function< void(void)> &  function)

◆ setPriority()

void LazyCaller::setPriority ( int  priority)

Friends And Related Function Documentation

◆ LazyCallerImpl

friend class LazyCallerImpl
friend

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