Project: engagement_recognition

License: BSD

Dependencies:

Used by: None

All Packages

Recognizer Class Reference

#include <recognizer.h>

Inheritance diagram for Recognizer:

List of all members.

Public Member Functions

void block ()
void callService (boost::barrier *barrier)
void castEvent (Event event)
virtual bool compareAdditional (std::vector< std::string > additional, std::string compare)
void complete (bool success)
Action getAction ()
ActorgetActor ()
double getMaxDelayParam (ros::NodeHandle *handle, double def)
virtual std::string getObject ()
const char * getStateName ()
ServiceResponse getStatus ()
void initialize (initiator::Initiator initiator)
void received (std::string topic, ros::Message *message)
 Recognizer (State *state, std::string type, std::string actor, EventSink *sink)
 Recognizer (std::string type, EventSink *sink)
 Recognizer ()
void setAction (Action action)
void setActor (std::string actor)
void setStartState ()
void setState (factory::StateType type)
void succeed (Action action)
virtual void transition (Event event)=0
void unblock (ServiceResponse status, Action action)
virtual ~Recognizer ()

Protected Attributes

Action action_
std::string actor_
unsigned long end_delay_
unsigned long end_time_
initiator::Initiator initiator_
double max_delay_
Semaphoresemaphore_
unsigned long start_delay_
unsigned long start_time_
Statestate_
Semaphorestate_semaphore_
ServiceResponse status_
bool succeeded_
std::string type_

Detailed Description

This class encapsulates the concept of a single connection event recognizer. It provides the common functionality and methods that are necessary for any concrete connection event recognizer.

Author:
Brett Ponsler (bponsler (at) wpi (dot) edu)

Definition at line 80 of file recognizer.h.


Constructor & Destructor Documentation

Recognizer::~Recognizer (  )  [virtual]

Deconstructor for the Recognizer class.

Definition at line 43 of file recognizer.cpp.

Recognizer::Recognizer (  ) 

Default constructor for the Recognizer class.

Definition at line 54 of file recognizer.cpp.

Recognizer::Recognizer ( std::string  type,
EventSink sink 
)

Constructor for the Recognizer class that takes a type.

Parameters:
type The type of Recognizer
sink The parent EventSink object

Definition at line 88 of file recognizer.cpp.

Recognizer::Recognizer ( State state,
std::string  type,
std::string  actor,
EventSink sink 
)

Constructor for the Recognizer class that initializes it to an Actor, and an EventSink.

Parameters:
state The State to start in
type The connection event type identifier
actor The Actor for this Recognizer
sink The parent EventSink object

Definition at line 122 of file recognizer.cpp.


Member Function Documentation

void Recognizer::block (  ) 

Block the semaphore corresponding with this Recognizer.

Definition at line 464 of file recognizer.cpp.

void Recognizer::callService ( boost::barrier *  barrier  ) 

The service was called.

Parameters:
barrier The thread barrier

Definition at line 170 of file recognizer.cpp.

void Recognizer::castEvent ( Event  event  )  [virtual]

Concrete implementation of the castEvent method.

This function provides the concrete implementation of the castEvent method which will be called when an event has been issued.

Parameters:
event The event that has been cast.

Implements EventSink.

Definition at line 183 of file recognizer.cpp.

bool Recognizer::compareAdditional ( std::vector< std::string >  additional,
std::string  compare 
) [virtual]

Compare the additional data as specified.

Parameters:
additional The additional data
compare How to compare the data
Returns:
Success of the comparison

Implements EventSink.

Definition at line 260 of file recognizer.cpp.

void Recognizer::complete ( bool  success  ) 

Complete the connection event.

Parameters:
success True if successful, false if failure.

Definition at line 325 of file recognizer.cpp.

Action Recognizer::getAction (  ) 

Return the action used to complete this event--if there is one.

Returns:
The action

Definition at line 459 of file recognizer.cpp.

Actor * Recognizer::getActor (  ) 

Return the actor for this Recognizer.

Returns:
The actor for this recognizer

Definition at line 421 of file recognizer.cpp.

double Recognizer::getMaxDelayParam ( ros::NodeHandle *  handle,
double  def 
)

Get the maximum delay parameter.

Parameters:
handle The node handle to use
def The default value to use
Returns:
The max delay parameter

Definition at line 436 of file recognizer.cpp.

std::string Recognizer::getObject (  )  [virtual]

Return the object associated with this Recognizer. If there is an object, otherwise return an empty string.

Returns:
The object associated with this Recognizer

Reimplemented in DirectedGazeRecognizer.

Definition at line 426 of file recognizer.cpp.

const char * Recognizer::getStateName (  ) 

Return the name of the State we are currently in.

Returns:
The name of the current state

Definition at line 251 of file recognizer.cpp.

ServiceResponse Recognizer::getStatus (  ) 

Return the status of this Recognizer.

Returns:
The status

Definition at line 431 of file recognizer.cpp.

void Recognizer::initialize ( initiator::Initiator  initiator  ) 

Initialize this Recognizer.

Parameters:
initiator The initiator of the recognizer

Reimplemented in AdjacencyPairRecognizer, BackchannelRecognizer, DirectedGazeRecognizer, and MutualFacialGazeRecognizer.

Definition at line 311 of file recognizer.cpp.

void Recognizer::received ( std::string  topic,
ros::Message *  message 
)

A message was received.

Parameters:
topic The topic
message The message was received

Definition at line 157 of file recognizer.cpp.

void Recognizer::setAction ( Action  action  ) 

Set the action used to complete this event--if there is one.

Parameters:
action The action used

Definition at line 454 of file recognizer.cpp.

void Recognizer::setActor ( std::string  actor  ) 

Set the actor's ID property for this Recognizer.

Parameters:
actor The actor's ID

Definition at line 413 of file recognizer.cpp.

void Recognizer::setStartState (  ) 

Set the State to the start State of this Recognizer.

Definition at line 241 of file recognizer.cpp.

void Recognizer::setState ( factory::StateType  type  ) 

Set the State of this Recognizer.

Parameters:
type The type of state

Definition at line 190 of file recognizer.cpp.

void Recognizer::succeed ( Action  action  ) 

The Recognizer succeeded.

Parameters:
action The action that succeeded the recognizer

Definition at line 292 of file recognizer.cpp.

virtual void Recognizer::transition ( Event  event  )  [pure virtual]

Transition into a new State based on an Event.

Parameters:
event The event

Implemented in AdjacencyPairRecognizer, BackchannelRecognizer, DirectedGazeRecognizer, and MutualFacialGazeRecognizer.

void Recognizer::unblock ( ServiceResponse  status,
Action  action 
)

Unblock the semaphore corresponding with this Recognizer using the status of the service and the action used to complete the service.

Parameters:
status The status
action The action

Definition at line 511 of file recognizer.cpp.


Member Data Documentation

The action that completed the event.

Reimplemented in DirectedGazeRecognizer.

Definition at line 108 of file recognizer.h.

std::string Recognizer::actor_ [protected]

The actor associated with this connection event.

Definition at line 96 of file recognizer.h.

unsigned long Recognizer::end_delay_ [protected]

Keep track of the end of delay.

Definition at line 120 of file recognizer.h.

unsigned long Recognizer::end_time_ [protected]

Keep track of when the initiator was ended.

Definition at line 114 of file recognizer.h.

Keeps track of who initiated this connection event.

Definition at line 93 of file recognizer.h.

double Recognizer::max_delay_ [protected]

The maximum delay for this recognizer.

Definition at line 99 of file recognizer.h.

The semaphore for blocking.

Definition at line 102 of file recognizer.h.

unsigned long Recognizer::start_delay_ [protected]

Keep track of the start of delay.

Definition at line 117 of file recognizer.h.

unsigned long Recognizer::start_time_ [protected]

Keep track of when the initiator was started.

Definition at line 111 of file recognizer.h.

State* Recognizer::state_ [protected]

The current state for the recognizer.

Definition at line 90 of file recognizer.h.

Semaphore for the state.

Definition at line 87 of file recognizer.h.

Status of waiting for the service.

Definition at line 105 of file recognizer.h.

bool Recognizer::succeeded_ [protected]

Whether the connection event succeeded or not.

Definition at line 84 of file recognizer.h.

std::string Recognizer::type_ [protected]

The type for this recognizer.

Definition at line 123 of file recognizer.h.


The documentation for this class was generated from the following files:
  • engagement_recognition/src/recognition/recognizers/recognizer.h
  • engagement_recognition/src/recognition/recognizers/recognizer.cpp

engagement_recognition
Author(s): Brett Ponsler (bponsler (at) wpi (dot) edu)
autogenerated on Fri Sep 9 10:35:49 2011