Homepage Demos Overview Downloads Tutorials Reference
Credits

HelloWorldBehavior.h

Go to the documentation of this file.
00001 //-*-c++-*-
00002 #ifndef INCLUDED_HelloWorldBehavior_h_
00003 #define INCLUDED_HelloWorldBehavior_h_
00004 
00005 #include "Behaviors/BehaviorBase.h"
00006 #include "Wireless/Wireless.h"
00007 
00008 //! Demonstrates serr, sout, and cout
00009 class HelloWorldBehavior : public BehaviorBase {
00010 public:
00011   HelloWorldBehavior() : BehaviorBase() {}
00012   
00013   virtual void DoStart() {
00014     //call superclass first for housekeeping:
00015     BehaviorBase::DoStart();
00016 
00017     //now do your code:
00018     for(unsigned int i=0; i<100; i++)
00019       serr->printf("Hello serr!  This is %d\n",i);
00020     for(unsigned int i=0; i<10; i++)
00021       sout->printf("Hello sout!  This is %d\n",i);
00022     for(unsigned int i=0; i<10; i++)
00023       cout << "Hello cout!  This is " << i << endl;
00024     for(unsigned int i=0; i<10; i++)
00025       printf("Hello printf!  This is %d\n",i);
00026 
00027     //we'll just stop right away since this Behavior has no 'active' state.
00028     DoStop();
00029   }
00030   
00031   virtual std::string getName() const {
00032     // Name is used for menus, or debugging.
00033     return "HelloWorldBehavior";
00034   }
00035   
00036   static std::string getClassDescription() {
00037     // This string will be shown by the HelpControl or by the tooltips of the Controller GUI
00038     return "A little demo of text output";
00039   }
00040   
00041 };
00042 
00043 /*! @file
00044  * @brief Defines HelloWorldBehavior, a little demo of text output (serr, sout, and cout)
00045  * @author ejt (Creator)
00046  *
00047  * $Author: ejt $
00048  * $Name: tekkotsu-2_2 $
00049  * $Revision: 1.4 $
00050  * $State: Rel $
00051  * $Date: 2003/10/07 00:59:33 $
00052  */
00053 
00054 #endif

Tekkotsu v2.2
Generated Tue Oct 19 14:19:14 2004 by Doxygen 1.3.9.1