User Manual, Developers Guide and API Documentation

ConnectionIdentifier.hpp

Go to the documentation of this file.
00001 /*******************************************************************************
00002  * This file is part of openWNS (open Wireless Network Simulator)
00003  * _____________________________________________________________________________
00004  *
00005  * Copyright (C) 2004-2009
00006  * Chair of Communication Networks (ComNets)
00007  * Kopernikusstr. 5, D-52074 Aachen, Germany
00008  * email: info@openwns.org
00009  * www: http://www.openwns.org
00010  * _____________________________________________________________________________
00011  *
00012  * openWNS is free software; you can redistribute it and/or modify it under the
00013  * terms of the GNU Lesser General Public License version 2 as published by the
00014  * Free Software Foundation;
00015  *
00016  * openWNS is distributed in the hope that it will be useful, but WITHOUT ANY
00017  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
00018  * A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00019  * details.
00020  *
00021  * You should have received a copy of the GNU Lesser General Public License
00022  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00023  *
00024  ******************************************************************************/
00025 
00030 #ifndef WIMAC_CONNECTIONIDENTIFIER_HPP
00031 #define WIMAC_CONNECTIONIDENTIFIER_HPP
00032 
00033 #include <string>
00034 
00035 #include <WNS/SmartPtr.hpp>
00036 #include <WNS/Cloneable.hpp>
00037 
00038 #include <WIMAC/StationManager.hpp>
00039 
00040 namespace wimac {
00041     class Component;
00042     class ConnectionClassifier;
00043     class ConnectionRule;
00044 
00045     namespace service {
00046         class ConnectionManager;
00047     }
00048 
00049     namespace tests {
00050         class TestConnectionManager;
00051     }
00052 
00058     class ConnectionIdentifier :
00059             public wns::RefCountable,
00060             public wns::Cloneable<ConnectionIdentifier>,
00061             public wns::IOutputStreamable
00062     {
00063     public:
00064         typedef wns::SmartPtr<ConnectionIdentifier> Ptr;
00065         typedef std::list<Ptr> List;
00066         typedef wimac::StationID StationID;
00067         typedef unsigned int CID;
00068 
00072         enum ConnectionType {
00073             NoType = 0,
00074             InitialRanging = 1,
00075             Basic = 2,
00076             PrimaryManagement = 3,
00077             SecondaryManagement = 4,
00078             Data = 5
00079         };
00080 
00081         enum Direction {
00082             NoDirection = 0x0,
00083             Downlink = 0x1,
00084             Uplink = 0x2,
00085             Bidirectional = 0x3 // Downlink | Uplink
00086         };
00087 
00088         enum QoSCategory {
00089             NoQoS = 0,
00090             Signaling = 1,
00091             UGS = 2,
00092             rtPS = 3,
00093             nrtPS = 4,
00094             BE = 5,
00095             MaxQoSCategory = BE
00096         };
00097 
00098         typedef int Frames;
00099 
00100         ConnectionIdentifier(StationID baseStation,
00101                               StationID subscriberStation,
00102                               StationID remoteStation,
00103                               ConnectionType connectionType,
00104                               Direction direction,
00105                               int qos);
00106 
00107 
00108         ConnectionIdentifier (StationID baseStation,
00109                               CID cid,
00110                               StationID subscriberStation,
00111                               StationID remoteStation,
00112                               ConnectionType connectionType,
00113                               Direction direction,
00114                               int qos);
00115 
00116         ConnectionIdentifier( const ConnectionIdentifier& other );
00117 
00121         CID getID() const { return cid_; }
00122 
00126         std::string doToString() const;
00127 
00128         bool operator==( const ConnectionIdentifier& rhs ) const
00129         {
00130             return ( baseStation_ == rhs.baseStation_ )
00131                 && ( cid_ == rhs.cid_ );
00132         }
00133 
00134         bool operator<( const ConnectionIdentifier& rhs ) const
00135         {
00136             if ( baseStation_ == rhs.baseStation_ )
00137                 return cid_ < rhs.cid_;
00138             return baseStation_ < rhs.baseStation_;
00139         }
00140 
00146         bool integrityCheck() const;
00147 
00149 
00153         ConnectionIdentifier::StationID baseStation_;
00154         CID cid_;
00155 
00156 
00157         ConnectionIdentifier::StationID subscriberStation_;
00158         ConnectionIdentifier::StationID remoteStation_;
00159         ConnectionType connectionType_;
00160         Direction direction_;
00161         int qos_;
00162 
00164         Frames ciNotListening_;
00165 
00167         struct {
00168             wimac::ConnectionClassifier* connectionClassifier;
00169         } commandKeyClasses_;
00170 
00171         // Is this a valid ConnectionIdentifier or an empty one?
00172         bool valid_;
00173 
00174     private:
00175         explicit ConnectionIdentifier ();
00176 
00177         friend class wimac::service::ConnectionManager;
00178         friend class wimac::tests::TestConnectionManager;
00179     };
00180 
00181     typedef ConnectionIdentifier::Ptr ConnectionIdentifierPtr;
00182     typedef std::list<ConnectionIdentifierPtr> ConnectionIdentifiers;
00183 }
00184 #endif

Generated on Tue May 22 03:32:09 2012 for openWNS by  doxygen 1.5.5