![]() |
User Manual, Developers Guide and API Documentation |
![]() |
00001 /******************************************************************************* 00002 * This file is part of openWNS (open Wireless Network Simulator) 00003 * _____________________________________________________________________________ 00004 * 00005 * Copyright (C) 2004-2007 00006 * Chair of Communication Networks (ComNets) 00007 * Kopernikusstr. 5, D-52074 Aachen, Germany 00008 * phone: ++49-241-80-27910, 00009 * fax: ++49-241-80-22242 00010 * email: info@openwns.org 00011 * www: http://www.openwns.org 00012 * _____________________________________________________________________________ 00013 * 00014 * openWNS is free software; you can redistribute it and/or modify it under the 00015 * terms of the GNU Lesser General Public License version 2 as published by the 00016 * Free Software Foundation; 00017 * 00018 * openWNS is distributed in the hope that it will be useful, but WITHOUT ANY 00019 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 00020 * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 00021 * details. 00022 * 00023 * You should have received a copy of the GNU Lesser General Public License 00024 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00025 * 00026 ******************************************************************************/ 00027 00028 #ifndef WNS_LDK_COMMANDTYPESPECIFIERINTERFACE_HPP 00029 #define WNS_LDK_COMMANDTYPESPECIFIERINTERFACE_HPP 00030 00031 #include <WNS/Assure.hpp> 00032 #include <WNS/ldk/CommandProxy.hpp> 00033 00034 namespace wns { namespace ldk { 00035 00036 class CommandPool; 00037 class CommandReaderInterface; 00038 00039 class CopyCommandInterface 00040 { 00041 public: 00042 virtual 00043 ~CopyCommandInterface(){}; 00044 00045 virtual Command* 00046 copy(const Command*) const = 0; 00047 }; 00048 00049 00050 namespace fun { 00051 class FUN; 00052 } 00053 00075 class CommandTypeSpecifierInterface 00076 { 00077 friend class CommandProxy; 00078 00079 public: 00080 CommandTypeSpecifierInterface() : 00081 id(invalidID) 00082 {} 00083 00084 virtual fun::FUN* getFUN() const = 0; // FIXME(fds) - doesn't belong here. well, maybe it does. 00085 00086 virtual ~CommandTypeSpecifierInterface() {}; 00087 00088 virtual Command* getCommand(const CommandPool* commandPool) const = 0; 00089 virtual Command* activateCommand(CommandPool* commandPool) const = 0; 00090 00108 virtual CommandPool* createReply(const CommandPool* original) const = 0; 00109 00110 virtual CopyCommandInterface* 00111 getCopyCommandInterface() const = 0; 00112 00113 #ifndef NDEBUG 00114 virtual size_t 00115 getCommandObjSize() const = 0; 00116 #endif 00117 00118 protected: 00119 void setPCIID(unsigned long _id) 00120 { 00121 assure( id == invalidID, "this FunctionalUnit has been registered at a Proxy before!"); 00122 id = _id; 00123 } 00124 public: 00125 unsigned long getPCIID() const 00126 { 00127 assure( id != invalidID, "this FunctionalUnit has not been registered at a Proxy yet!"); 00128 return id; 00129 } 00130 protected: 00131 bool registeredAtProxy() const 00132 { 00133 return id != invalidID; 00134 } 00135 00148 virtual void calculateSizes(const CommandPool* commandPool, Bit& commandPoolSize, Bit& dataSize) const = 0; 00149 virtual void commitSizes(CommandPool* commandPool) const = 0; 00150 private: 00151 virtual Command* createCommand() const = 0; 00152 virtual Command* copyCommand(const Command* src) const = 0; 00153 virtual CommandReaderInterface* getCommandReader(CommandProxy*) = 0; 00154 00155 unsigned long id; 00156 static const unsigned long invalidID; 00157 }; 00158 00159 } // ldk 00160 } // wns 00161 00162 #endif // NOT defined WNS_LDK_COMMANDTYPESPECIFIERINTERFACE_HPP 00163 00164
1.5.5