00001 // ---------------------------------------------------------------------------- 00002 // CERTI - HLA RunTime Infrastructure 00003 // Copyright (C) 2002, 2003 ONERA 00004 // 00005 // This file is part of CERTI-libCERTI 00006 // 00007 // CERTI-libCERTI is free software ; you can redistribute it and/or 00008 // modify it under the terms of the GNU Lesser General Public License 00009 // as published by the Free Software Foundation ; either version 2 of 00010 // the License, or (at your option) any later version. 00011 // 00012 // CERTI-libCERTI is distributed in the hope that it will be useful, but 00013 // WITHOUT ANY WARRANTY ; without even the implied warranty of 00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 // Lesser General Public License for more details. 00016 // 00017 // You should have received a copy of the GNU Lesser General Public 00018 // License along with this program ; if not, write to the Free Software 00019 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00020 // USA 00021 // 00022 // $Id: ObjectClassBroadcastList.hh,v 3.10 2008/06/11 15:19:22 rousse Exp $ 00023 // ---------------------------------------------------------------------------- 00024 00025 #ifndef CERTI_OBJECT_CLASS_BROADCAST_LIST_HH 00026 #define CERTI_OBJECT_CLASS_BROADCAST_LIST_HH 00027 00028 #include "certi.hh" 00029 #include "NetworkMessage.hh" 00030 #include "SecurityServer.hh" 00031 00032 #include <list> 00033 00034 #define MAX_STATE_SIZE 1024 00035 00036 namespace certi { 00037 00038 class ObjectBroadcastLine { 00039 public: 00040 enum State { sent, waiting, notSub }; 00041 00042 ObjectBroadcastLine(FederateHandle fed, State init = notSub); 00043 00044 FederateHandle Federate ; 00045 00046 State state[MAX_STATE_SIZE+1] ; 00047 00048 }; 00049 00053 class ObjectClassBroadcastList { 00054 00055 public: 00056 ObjectClassBroadcastList(NetworkMessage *, AttributeHandle = 0); 00057 ~ObjectClassBroadcastList(); 00058 00059 void clear(); 00060 void addFederate(FederateHandle, AttributeHandle = 0); 00061 void sendPendingMessage(SecurityServer *server); 00062 00063 NetworkMessage *message ; 00064 00065 private: 00066 NetworkMessage *adaptMessage(ObjectBroadcastLine *line); 00067 00069 ObjectBroadcastLine *getLineWithFederate(FederateHandle theFederate); 00070 00071 bool isWaiting(ObjectBroadcastLine *line); 00072 00077 void sendPendingDOMessage(SecurityServer *server); 00078 void sendPendingRAVMessage(SecurityServer *server); 00079 00080 AttributeHandle maxHandle ; 00081 std::list<ObjectBroadcastLine *> lines ; 00082 /* The message buffer used to send Network messages */ 00083 MessageBuffer NM_msgBufSend; 00084 }; 00085 00086 } // namespace certi 00087 00088 #endif // CERTI_OBJECT_CLASS_BROADCAST_LIST_HH 00089 00090 // $Id: ObjectClassBroadcastList.hh,v 3.10 2008/06/11 15:19:22 rousse Exp $