Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

BehaviorBase.h File Reference

Describes BehaviorBase from which all Behaviors should inherit. More...

#include "Events/EventListener.h"
#include "Shared/ReferenceCounter.h"
#include "Motion/MotionManagerMsg.h"
#include "Behaviors/Controls/ControlBase.h"
#include <string>
#include <set>
#include <map>
#include "Controls/BehaviorSwitchControl.h"
Include dependency graph for BehaviorBase.h:

Go to the source code of this file.

Classes

class  BehaviorBase
 The basis from which all other Behaviors should inherit. More...
class  BehaviorBase::MonitorMotion
 An instance is created for each motion activated through addMotion(), listening in case the motion is removed by some other means, thus invalidating the MC_ID. More...

Defines

#define BEH_DEFAULTS   ControlBase::DEFAULTS
 Argument for REGISTER_BEHAVIOR_OPT and REGISTER_BEHAVIOR_MENU_OPT, indicates default options (does not start automatically).
#define BEH_START   ControlBase::BEH_START
 Argument for REGISTER_BEHAVIOR_OPT and REGISTER_BEHAVIOR_MENU_OPT, indicates the behavior should be activated at launch instead of waiting for the user to do it manually.
#define BEH_RETAIN   ControlBase::BEH_RETAIN
 Argument for REGISTER_BEHAVIOR_OPT and REGISTER_BEHAVIOR_MENU_OPT, indicates the behavior's memory allocation will *not* be freed between activations, so state will be maintained.
#define BEH_NONEXCLUSIVE   ControlBase::BEH_NONEXCLUSIVE
 Argument for REGISTER_BEHAVIOR_OPT and REGISTER_BEHAVIOR_MENU_OPT, indicates the behavior can be run alongside other behaviors.
#define DEFAULT_MENU   "User Behaviors"
 Menu name to place user behaviors by default when using REGISTER_BEHAVIOR.
#define DEFAULT_TK_MENU   "Framework Demos"
 Menu name for framework behaviors, to override DEFAULT_MENU.
#define REGISTER_BEHAVIOR_MENU_OPT(behaviorClass, menu, flags)
 Should be called in the global namespace of a translation unit (i.e. a '.cc' file) in order to register a behavior in the controller menu system.
#define REGISTER_BEHAVIOR_OPT(behaviorClass, flags)   REGISTER_BEHAVIOR_MENU_OPT(behaviorClass, DEFAULT_MENU, flags)
 Should be called in the global namespace of a translation unit (i.e. a '.cc' file) in order to register a behavior in the controller menu system.
#define REGISTER_BEHAVIOR_MENU(behaviorClass, menu)   REGISTER_BEHAVIOR_MENU_OPT(behaviorClass, menu, BEH_DEFAULTS)
 Should be called in the global namespace of a translation unit (i.e. a '.cc' file) in order to register a behavior in the controller menu system.
#define REGISTER_BEHAVIOR(behaviorClass)   REGISTER_BEHAVIOR_MENU_OPT(behaviorClass, DEFAULT_MENU, BEH_DEFAULTS)
 Should be called in the global namespace of a translation unit (i.e. a '.cc' file) in order to register a behavior in the controller menu system. See also REGISTER_BEHAVIOR_OPT, REGISTER_BEHAVIOR_MENU, and REGISTER_BEHAVIOR_MENU_OPT.

Detailed Description

Describes BehaviorBase from which all Behaviors should inherit.

Author:
ejt (Creator)

Definition in file BehaviorBase.h.


Define Documentation

#define BEH_DEFAULTS   ControlBase::DEFAULTS

Argument for REGISTER_BEHAVIOR_OPT and REGISTER_BEHAVIOR_MENU_OPT, indicates default options (does not start automatically).

Definition at line 18 of file BehaviorBase.h.

#define BEH_NONEXCLUSIVE   ControlBase::BEH_NONEXCLUSIVE

Argument for REGISTER_BEHAVIOR_OPT and REGISTER_BEHAVIOR_MENU_OPT, indicates the behavior can be run alongside other behaviors.

Definition at line 27 of file BehaviorBase.h.

#define BEH_RETAIN   ControlBase::BEH_RETAIN

Argument for REGISTER_BEHAVIOR_OPT and REGISTER_BEHAVIOR_MENU_OPT, indicates the behavior's memory allocation will *not* be freed between activations, so state will be maintained.

Definition at line 24 of file BehaviorBase.h.

Referenced by BehaviorBase::registerControllerEntry().

#define BEH_START   ControlBase::BEH_START

Argument for REGISTER_BEHAVIOR_OPT and REGISTER_BEHAVIOR_MENU_OPT, indicates the behavior should be activated at launch instead of waiting for the user to do it manually.

Definition at line 21 of file BehaviorBase.h.

#define DEFAULT_MENU   "User Behaviors"

Menu name to place user behaviors by default when using REGISTER_BEHAVIOR.

Definition at line 261 of file BehaviorBase.h.

#define DEFAULT_TK_MENU   "Framework Demos"

Menu name for framework behaviors, to override DEFAULT_MENU.

Definition at line 263 of file BehaviorBase.h.

#define REGISTER_BEHAVIOR ( behaviorClass   )     REGISTER_BEHAVIOR_MENU_OPT(behaviorClass, DEFAULT_MENU, BEH_DEFAULTS)

Should be called in the global namespace of a translation unit (i.e. a '.cc' file) in order to register a behavior in the controller menu system. See also REGISTER_BEHAVIOR_OPT, REGISTER_BEHAVIOR_MENU, and REGISTER_BEHAVIOR_MENU_OPT.

This version assumes the DEFAULT menu and will add the behavior to a behavior group so only one runs at a time.

Definition at line 282 of file BehaviorBase.h.

#define REGISTER_BEHAVIOR_MENU ( behaviorClass,
menu   )     REGISTER_BEHAVIOR_MENU_OPT(behaviorClass, menu, BEH_DEFAULTS)

Should be called in the global namespace of a translation unit (i.e. a '.cc' file) in order to register a behavior in the controller menu system.

This version allows you to specify a menu (use '/' to demark submenus), but uses the default style (exclusive execution, no auto-start).

Definition at line 278 of file BehaviorBase.h.

#define REGISTER_BEHAVIOR_MENU_OPT ( behaviorClass,
menu,
flags   ) 
Value:
const BehaviorSwitchControlBase* AUTO_REGISTER_NAME(behaviorClass,__LINE__) \
 = BehaviorBase::registerControllerEntry<behaviorClass>(#behaviorClass,menu,flags)

Should be called in the global namespace of a translation unit (i.e. a '.cc' file) in order to register a behavior in the controller menu system.

Specify the menu name (use '/' to demark submenus) and allows you to pass optional flags (see BEH_START, BEH_RETAIN, BEH_NONEXCLUSIVE).

Definition at line 268 of file BehaviorBase.h.

#define REGISTER_BEHAVIOR_OPT ( behaviorClass,
flags   )     REGISTER_BEHAVIOR_MENU_OPT(behaviorClass, DEFAULT_MENU, flags)

Should be called in the global namespace of a translation unit (i.e. a '.cc' file) in order to register a behavior in the controller menu system.

This version assumes the DEFAULT_MENU but allows you to pass optional flags (see BEH_START, BEH_RETAIN, BEH_NONEXCLUSIVE).

Definition at line 274 of file BehaviorBase.h.


Tekkotsu v5.1CVS
Generated Mon May 9 04:58:54 2016 by Doxygen 1.6.3