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("CrashTestBehavior") {}
00012   
00013   virtual void DoStart() {
00014     //call superclass first for housekeeping:
00015     BehaviorBase::DoStart();
00016 
00017     serr->printf("I will now crash immediately following line 33\n");
00018     //now do your code:
00019     for(unsigned int i=0; i<100; i++) {
00020       serr->printf("Hello serr!  This is %d\n",i);
00021       if(i==33)
00022         *(int*)0xDEADDEAD=0x600DB4E;
00023     }
00024     //Hate to break it to you, but we're never going to get here...
00025   }
00026   
00027   static std::string getClassDescription() {
00028     // This string will be shown by the HelpControl or by the tooltips of the Controller GUI
00029     return "A little demo of blocking output before a crash after output #33 (yes, this crashes the AIBO)";
00030   }
00031   
00032   virtual std::string getDescription() const { return getClassDescription(); }
00033 };
00034 
00035 /*! @file
00036  * @brief Defines CrashTestBehavior, demonstrates (lack of) blocking using serr to (not) pinpoint a crash
00037  * @author ejt (Creator)
00038  *
00039  * $Author: ejt $
00040  * $Name: tekkotsu-2_2_1 $
00041  * $Revision: 1.3 $
00042  * $State: Exp $
00043  * $Date: 2004/11/11 01:45:35 $
00044  */
00045 
00046 #endif

Tekkotsu v2.2.1
Generated Tue Nov 23 16:36:37 2004 by Doxygen 1.3.9.1