Homepage Demos Overview Downloads Tutorials Reference
Credits

CrashTestBehavior.h

Go to the documentation of this file.
00001 //-*-c++-*-
00002 #ifndef INCLUDED_CrashTestBehavior_h_
00003 #define INCLUDED_CrashTestBehavior_h_
00004 
00005 #include "Behaviors/BehaviorBase.h"
00006 #include "Wireless/Wireless.h"
00007 
00008 //! Demonstrates (lack of) blocking using serr to (not) pinpoint a crash
00009 class CrashTestBehavior : public BehaviorBase {
00010 public:
00011   CrashTestBehavior() : 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       if(i==33)
00021         *(int*)0xDEADDEAD=0x600DB4E;
00022     }
00023     //Hate to break it to you, but we're never going to get here...
00024   }
00025   
00026   virtual std::string getName() const {
00027     // Name is used for menus, or debugging.
00028     return "CrashTestBehavior";
00029   }
00030   
00031   static std::string getClassDescription() {
00032     // This string will be shown by the HelpControl or by the tooltips of the Controller GUI
00033     return "A little demo of blocking output before a crash after output #33 (yes, this crashes the AIBO)";
00034   }
00035   
00036 };
00037 
00038 /*! @file
00039  * @brief Defines CrashTestBehavior, demonstrates (lack of) blocking using serr to (not) pinpoint a crash
00040  * @author ejt (Creator)
00041  *
00042  * $Author: ejt $
00043  * $Name: tekkotsu-2_2 $
00044  * $Revision: 1.2 $
00045  * $State: Exp $
00046  * $Date: 2004/08/25 01:07:45 $
00047  */
00048 
00049 #endif

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