radiostate.h

来自「基于omnet++开发的Mf框架下的802.11协议仿真。」· C头文件 代码 · 共 79 行

H
79
字号
/* -*- mode:c++ -*- ********************************************************
 * file:        RadioState.h
 *
 * author:      Andreas Koepke
 *
 * copyright:   (C) 2004 Telecommunication Networks Group (TKN) at
 *              Technische Universitaet Berlin, Germany.
 *
 *              This program is free software; you can redistribute it 
 *              and/or modify it under the terms of the GNU General Public 
 *              License as published by the Free Software Foundation; either
 *              version 2 of the License, or (at your option) any later 
 *              version.
 *              For further information see file COPYING 
 *              in the top level directory
 ***************************************************************************
 * part of:     framework implementation developed by tkn
 * description: Blackboard Parameter that reflects the current state of
 *              the radio
 ***************************************************************************
 * changelog:   $Revision$
 *              last modified:   $Date: 2004-07-20 22:11:00 +0200 (Tue, 20 Jul 2004) $
 *              by:              $Author: omfw-willkomm $
 **************************************************************************/

#ifndef RADIOSTATE_H
#define RADIOSTATE_H

#include <omnetpp.h>

/**
 * @brief Class to hold the radio state of the host
 *
 * This Blackboard parameter holds the actual state of the
 * radio. Possible states are : IDLE, RECV, SEND and SLEEP
 *
 * IDLE: the radio is idle
 *
 * RECV: the radio is receiving a message
 *
 * SEND: the radio is sending a message
 *
 * SLEEP: the radio is sleeping
 *
 * @ingroup utils
 * @author Andreas K鰌ke
 * @sa Blackboard
 **/
class RadioState : public cPolymorphic
{
 public:
  /** @brief possible states of the radio*/
  enum States 
    {
      IDLE,
      RECV,
      SEND,
      SLEEP
    };

private:
  /** @brief Variable that hold the actaul state*/
    States state;

public:    
  /** @brief function to get the state*/
    States getState() const { return state; }
  /** @brief set the state of the radio*/
    void setState(States s) { state = s; }

  /** @brief Constructor*/
    RadioState(States s=IDLE) : cPolymorphic(), state(s) {};
    
};



#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?