Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | Related Pages

MediumIndication.h

00001 /* -*- mode:c++ -*- ********************************************************
00002  * file:        MediumIndication.h
00003  *
00004  * author:      Andreas Koepke
00005  *
00006  * copyright:   (C) 2006 Telecommunication Networks Group (TKN) at
00007  *              Technische Universitaet Berlin, Germany.
00008  *
00009  *              This program is free software; you can redistribute it
00010  *              and/or modify it under the terms of the GNU General Public
00011  *              License as published by the Free Software Foundation; either
00012  *              version 2 of the License, or (at your option) any later
00013  *              version.
00014  *              For further information see file COPYING
00015  *              in the top level directory
00016  ***************************************************************************
00017  * part of:     framework implementation developed by tkn
00018  **************************************************************************/
00019 
00020 #ifndef MEDIUM_INDICATION_H
00021 #define MEDIUM_INDICATION_H
00022 
00023 #include <omnetpp.h>
00024 #include <Blackboard.h>
00025 #include <sstream>
00026 
00036 class MediumIndication : public BBItem
00037 {
00038     BBITEM_METAINFO(BBItem);
00039     
00040  public:
00042     enum States {
00043         IDLE,
00044         BUSY
00045     };
00046     
00047  protected:
00048     States state;
00049     
00050  public:
00052     MediumIndication(States s=IDLE) : BBItem(), state(s) {
00053     };
00054 
00056     States getState() const  {
00057         return state;
00058     }
00059     
00061     void setState(States s) {
00062         state = s;
00063     }
00064     
00066     std::string info() const {
00067         std::ostringstream ost;
00068         ost << " medium is ";
00069         if(state == IDLE) {
00070             ost << "idle";
00071         }
00072         else {
00073             ost << "busy";   
00074         }
00075         return ost.str();
00076     }
00077 };
00078 
00079 
00080 #endif

Generated on Fri Jan 12 08:29:32 2007 for Mobility Framework by  doxygen 1.4.4