- Aldebaran documentation |
- C++ Libraries |
- index

libalextractor 2.8.7.4

- Main Page
- Related Pages
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | List of all members
AL::ALExtractor Class Referenceabstract

ALExtractor class implements an extractor. More...

`#include "alextractor/alextractor.h"`

## Public Member Functions
| ALExtractor (boost::shared_ptr< ALBroker > pBroker, const std::string &pName)
| Constructor. More...
virtual | ~ALExtractor ()
| Destructor. More...
virtual void | subscribe (const std::string &pSubscribedName, const int &pPeriod, const float &pPrecision)
| Called by the "client" to tell that it is interested in the output values. More...
virtual void | subscribe (const std::string &pSubscribedName)
| Called by the "client" to tell that it is interested in the output values. Period and Precision specified by getDefaultPrecision() and getDefaultPeriod() will be used by default. More...
virtual void | updatePeriod (const std::string &pSubscribedName, const int &pPeriod)
| Called by the "client" to update the periode. More...
virtual void | updatePrecision (const std::string &pSubscribedName, const float &pPrecision)
| Called by the "client" to update the precision. More...
virtual void | unsubscribe (const std::string &pSubscribedName)
| Called by the "client" to tell that it is not interested anymore in the output values. More...
virtual int | getCurrentPeriod ()
| Called by the "client" to get the current period chosen by the Extractor. More...
virtual float | getCurrentPrecision ()
| Called by the "client" to get the current precision chosen by the Extractor. More...
virtual int | getMyPeriod (const std::string &pSubscribedName)
| Called by the "client" to get the period. More...
virtual float | getMyPrecision (const std::string &pSubscribedName)
| Called by the "client" to get the precision. More...
ALValue | getSubscribersInfo ()
| Called by the "client" to get the information of all the current subscribers. More...
Public Member Functions inherited from AL::ALModule
| ALModule (boost::shared_ptr< ALBroker > pBroker, const std::string &pName)
virtual | ~ALModule ()
virtual void | stop (const int &taskId)
bool | isStopRequired (const int &taskId=-1)
bool | wait (const int &taskId, const int &timeout)
qi::FutureSync< void > | wait (const int &taskId)
bool | isRunning (const int &taskId)
int | getMethodID (void)
bool | isPCalled ()
virtual void | exit ()
QI_API_DEPRECATED void | functionStop (int pIDTask)
virtual void | init (void)
| ALModuleCore (boost::shared_ptr< ALBroker > pBroker, const std::string &pName)
virtual | ~ALModuleCore ()
ALMethodInfo & | getCurrentMethodDescription ()
boost::shared_ptr< ALModuleCore > | getThis ()
boost::shared_ptr< const ALModuleCore > | getThis () const
bool | isClosing ()
void | initModule (void)
boost::shared_ptr< AL::ALProxy > | getProxy (const std::string &pModuleName)
std::string | getBrokerName ()
ModuleType | getModuleType (void)
void | setModuleType (ModuleType pType)
virtual ALMethodInfo * | execute (const std::string &pMethod, const AL::ALValue &pParams, AL::ALValue &pResult)
std::vector< std::string > | getMethodList ()
AL::ALValue | getMethodHelp (const std::string &pMethodName)
ALMethodInfo | getMethodHelpObject (const std::string &pMethodName)
AL::ALValue | moduleHelp ()
bool | ping (void)
virtual std::string | version ()
const std::string & | getName () const
boost::shared_ptr< ALModuleInfo > | getModuleInfo ()
ALMethodInfo * | getMethodInfoByNameMember (const std::string &pName, const std::vector< std::string > &paramType, bool softCompare=true)
ALMethodInfo * | getMethodInfo (const std::string &pName)
ALMethodInfo * | getMethodInfo (const std::string &pName, std::vector< std::string > pParamsType)
ALMethodInfo * | getMethodInfo (const std::string &pName, const AL::ALValue &pParams)
ALMethodInfo * | getFunctionDesc (const std::string &pName)
ALMethodInfo * | getFunctionDesc (const std::string &pName, std::vector< std::string > pParamsType)
ALMethodInfo * | getFunctionDesc (const std::string &pName, const AL::ALValue &pParams)
ALMethodInfo * | getFunctionDescByNameMember (const std::string &pName, const std::vector< std::string > &paramType, bool softCompare=true)
boost::shared_ptr< ALBroker > | getParentBroker () const
void | functionStop (int pTaskID)
void | setModuleDescription (const std::string &pDesc)
std::string | getUsage (const std::string &methodName)
bool | isModuleStopped ()
void | setModuleID (int id)
int | getModuleID ()
void | bindMethod (boost::shared_ptr< ALFunctorBase > pFunctor)
void | bindMethod (boost::shared_ptr< ALFunctorBase > pFunctor, const std::string &pName, const std::string &pClass, const std::string &pFunctionDescription, const ALMethodInfo &pMethodDescription)
void | bindMethodOverload (boost::shared_ptr< ALFunctorBase > pFunctor)
void | functionName (const std::string &pName, const std::string &pClass, const std::string &pFunctionDescription, int pMask=0)
void | addParam (const std::string &pName, const std::string &pDesc)
void | addModuleExample (const std::string &pLanguage, const std::string &pExample)
void | addMethodExample (const std::string &pLanguage, const std::string &pExample)
void | setReturn (const std::string &pName, const std::string &pDesc)
virtual qi::Future < qi::AnyReference > | metaCall (qi::AnyObject context, unsigned int method, const qi::GenericFunctionParameters &in, qi::MetaCallType callType, qi::Signature returnSignature)
qi::AnyObject | asObject ()
qi::DynamicObjectBuilder & | getBuilder ()
int | pCall (const qi::AnyArguments &args)
| ALProcessSignals ()
virtual | ~ALProcessSignals ()
ProcessSignalConnection | atPreProcess (ProcessSignalSlot subscriber, ProcessSignalPosition pos=boost::signals2::at_back)
ProcessSignalConnection | atPostProcess (ProcessSignalSlot subscriber, ProcessSignalPosition pos=boost::signals2::at_back)
void | removeAllPreProcess (void)
void | removeAllPostProcess (void)
void | preProcess (void)
void | postProcess (void)

## Protected Member Functions
virtual void | xStartDetection (const int pPeriod, const float pPrecision)=0
| What the extractor shall do to start detection. More...
virtual void | xUpdateParameters (const int pPeriod, const float pPrecision)
| Enables to do some custom updates when the period and/or the precision have been updated. More...
virtual void | xStopDetection ()=0
| What the extractor shall do to stop detection. More...
virtual int | getDefaultPeriod ()
| Specifies the advertised period that should be chosen by default when subscribe(std::string name) is used. More...
virtual float | getDefaultPrecision ()
| Specifies the advertised precision that should be chosen by default when subscribe(std::string name) is used. More...
virtual int | getMinimumPeriod ()
| Specifies the minimum period (in ms) that can be set for the extractor. More...
virtual int | getMaximumPeriod ()
| Specifies the maximum period (in ms) that can be set for the extractor. More...
virtual std::vector< std::string > | getOutputNames (void)
| Which values this extractor updates in ALMemory. More...
std::vector< std::string > | getEventList (void)
| Retrieves the list of events updated by the extractor. More...
std::vector< std::string > | getMemoryKeyList (void)
| Retrieves the list of memory keys updated by the extractor. More...
void | declareEvent (const std::string &event)
| Declares an event in ALMemory. More...
void | declareMemoryKey (const std::string &key)
| Initializes a memory key in ALMemory (with an empty ALValue). More...

## Additional Inherited Members
Public Types inherited from AL::ALModule
enum | ModuleType
typedef boost::shared_ptr < ALModuleCore > | Ptr
typedef boost::weak_ptr < ALModuleCore > | WeakPtr
typedef boost::signals2::signal< void()> | ProcessSignal
typedef boost::signals2::signal< void()> ::slot_function_type | ProcessSignalSlot
typedef boost::signals2::connect_position | ProcessSignalPosition
typedef boost::signals2::connection | ProcessSignalConnection
Static Public Member Functions inherited from AL::ALModule
static boost::shared_ptr< T > | createModule (boost::shared_ptr< ALBroker > pBroker)
static boost::shared_ptr< T > | createModule (boost::shared_ptr< ALBroker > pBroker, P1 p1)
static boost::shared_ptr< T > | createModuleCore (boost::shared_ptr< ALBroker > pBroker)
static boost::shared_ptr< T > | createModuleCoreNoRegister (boost::shared_ptr< ALBroker > pBroker, const std::string &name)
static boost::shared_ptr< T > | createModuleCore (boost::shared_ptr< ALBroker > pBroker, const std::string &name)
static boost::shared_ptr< T > | createUrbiModule (boost::shared_ptr< ALBroker > pBroker, const std::string &name)
Public Attributes inherited from AL::ALModule
qi::GenericObject | _go
ALModuleCorePrivate * | _p
qi::MetaMethodBuilder | _mBuilder
Protected Attributes inherited from AL::ALModule
qi::DynamicObjectBuilder | _builder
ProcessSignal | fPreProcess
ProcessSignal | fPostProcess

## Detailed Description

ALExtractor class implements an extractor.

An extractor is a module which extracts some information about the world. It can be activated to produce information.

Definition at line 35 of file alextractor.h.

## Constructor & Destructor Documentation

AL::ALExtractor::ALExtractor | ( | boost::shared_ptr< ALBroker > | pBroker,
|  | const std::string & | pName
| ) |  |

Constructor.

Create a extractor link to a broker.

Parameters

  pBroker | pointer to the broker
  pName | name of the extractor

virtual AL::ALExtractor::~ALExtractor | ( |  | ) |
| virtual

Destructor.

## Member Function Documentation

void AL::ALExtractor::declareEvent | ( | const std::string & | event | ) |
| protected

Declares an event in ALMemory.

void AL::ALExtractor::declareMemoryKey | ( | const std::string & | key | ) |
| protected

Initializes a memory key in ALMemory (with an empty ALValue).

virtual int AL::ALExtractor::getCurrentPeriod | ( |  | ) |
| virtual

Called by the "client" to get the current period chosen by the Extractor.

Returns
  current period

virtual float AL::ALExtractor::getCurrentPrecision | ( |  | ) |
| virtual

Called by the "client" to get the current precision chosen by the Extractor.

Returns
  current precision

virtual int AL::ALExtractor::getDefaultPeriod | ( |  | ) |
| protected virtual

Specifies the advertised period that should be chosen by default when subscribe(std::string name) is used.

Implementing this method is optional. If not implemented, 30 ms will be chosen.

virtual float AL::ALExtractor::getDefaultPrecision | ( |  | ) |
| protected virtual

Specifies the advertised precision that should be chosen by default when subscribe(std::string name) is used.

Implementing this method is optional. If not implemented, 0 will be chosen.

std::vector<std::string> AL::ALExtractor::getEventList | ( | void |  | ) |
| protected

Retrieves the list of events updated by the extractor.

Returns
  vector of events

virtual int AL::ALExtractor::getMaximumPeriod | ( |  | ) |
| protected virtual

Specifies the maximum period (in ms) that can be set for the extractor.

Implementing this method is optional. If not implemented, no maximum period will be set and the function will return -1.

std::vector<std::string> AL::ALExtractor::getMemoryKeyList | ( | void |  | ) |
| protected

Retrieves the list of memory keys updated by the extractor.

Returns
  vector of memory keys

virtual int AL::ALExtractor::getMinimumPeriod | ( |  | ) |
| protected virtual

Specifies the minimum period (in ms) that can be set for the extractor.

Implementing this method is optional. If not implemented, 1 ms will be chosen.

virtual int AL::ALExtractor::getMyPeriod | ( | const std::string & | pSubscribedName | ) |
| virtual

Called by the "client" to get the period.

Parameters

  pSubscribedName | Name of the client module

Returns
  period I required

virtual float AL::ALExtractor::getMyPrecision | ( | const std::string & | pSubscribedName | ) |
| virtual

Called by the "client" to get the precision.

Parameters

  pSubscribedName | Name of the client module

Returns
  precision I required

virtual std::vector<std::string> AL::ALExtractor::getOutputNames | ( | void |  | ) |
| protected virtual

Which values this extractor updates in ALMemory.

Returns
  vector of modified value

ALValue AL::ALExtractor::getSubscribersInfo | ( |  | ) |

Called by the "client" to get the information of all the current subscribers.

Returns
  info, names and parameters of all subscribers

virtual void AL::ALExtractor::subscribe | ( | const std::string & | pSubscribedName,
|  | const int & | pPeriod,
|  | const float & | pPrecision
| ) |  |
| virtual

Called by the "client" to tell that it is interested in the output values.

Parameters

  pSubscribedName | Name of the client module
  pPeriod | period of the extractor
  pPrecision | precision of the extractor

virtual void AL::ALExtractor::subscribe | ( | const std::string & | pSubscribedName | ) |
| virtual

Called by the "client" to tell that it is interested in the output values. Period and Precision specified by getDefaultPrecision() and getDefaultPeriod() will be used by default.

Parameters

  pSubscribedName | Name of the client module

virtual void AL::ALExtractor::unsubscribe | ( | const std::string & | pSubscribedName | ) |
| virtual

Called by the "client" to tell that it is not interested anymore in the output values.

Parameters

  pSubscribedName | Name of the client module

virtual void AL::ALExtractor::updatePeriod | ( | const std::string & | pSubscribedName,
|  | const int & | pPeriod
| ) |  |
| virtual

Called by the "client" to update the periode.

Parameters

  pSubscribedName | Name of the client module
  pPeriod | period of the extractor

virtual void AL::ALExtractor::updatePrecision | ( | const std::string & | pSubscribedName,
|  | const float & | pPrecision
| ) |  |
| virtual

Called by the "client" to update the precision.

Parameters

  pSubscribedName | Name of the client module
  pPrecision | precision of the extractor

virtual void AL::ALExtractor::xStartDetection | ( | const int | pPeriod,
|  | const float | pPrecision
| ) |  |
| protected pure virtual

What the extractor shall do to start detection.

This method is called only once: when the first module subscribes.

Parameters

  pPeriod | period of the extractor
  pPrecision | precision of the extractor

virtual void AL::ALExtractor::xStopDetection | ( |  | ) |
| protected pure virtual

What the extractor shall do to stop detection.

this method is called only once: when the last module unsubscribes.

virtual void AL::ALExtractor::xUpdateParameters | ( | const int | pPeriod,
|  | const float | pPrecision
| ) |  |
| inline protected virtual

Enables to do some custom updates when the period and/or the precision have been updated.

This empty method can be overrided to do some custom updates when the period and/or the precision have been updated.

Parameters

  pPeriod | period of the extractor
  pPrecision | precision of the extractor

Definition at line 152 of file alextractor.h.

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

- /home/opennao/work/release-2.8/sdk/libnaoqi/libalextractor/alextractor/alextractor.h