InteractionBroadcastList.hh

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 // CERTI - HLA RunTime Infrastructure
00003 // Copyright (C) 2002-2005  ONERA
00004 //
00005 // This program is free software ; you can redistribute it and/or
00006 // modify it under the terms of the GNU Lesser General Public License
00007 // as published by the Free Software Foundation ; either version 2 of
00008 // the License, or (at your option) any later version.
00009 //
00010 // This program is distributed in the hope that it will be useful, but
00011 // WITHOUT ANY WARRANTY ; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00013 // Lesser General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU Lesser General Public
00016 // License along with this program ; if not, write to the Free Software
00017 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00018 // USA
00019 //
00020 // $Id: InteractionBroadcastList.hh,v 3.9 2008/05/30 14:01:05 erk Exp $
00021 // ----------------------------------------------------------------------------
00022 
00023 #ifndef CERTI_INTERACTION_BROADCAST_LIST_HH
00024 #define CERTI_INTERACTION_BROADCAST_LIST_HH
00025 
00026 #include "certi.hh"
00027 #include "NetworkMessage.hh"
00028 #include "SecurityServer.hh"
00029 
00030 #include <list>
00031 
00032 namespace certi {
00033 
00034 struct InteractionBroadcastLine
00035 {
00036 public:
00037     enum State {
00038         sent, waiting, notSub
00039     };
00040 
00041     InteractionBroadcastLine(FederateHandle fed, State init = notSub)
00042         : federate(fed), state(init) { };
00043 
00044     FederateHandle federate ;
00045     State state ;
00046 };
00047 
00048 class InteractionBroadcastList
00049 {
00050 public:
00051     InteractionBroadcastList(NetworkMessage *theMsg);
00052     ~InteractionBroadcastList();
00053 
00054     void clear();
00055     void addFederate(FederateHandle theFederate);
00056     void sendPendingMessage(SecurityServer *Server);
00057 
00062     NetworkMessage *message ;
00063 
00064 private:
00065     InteractionBroadcastLine *getLineWithFederate(FederateHandle theFederate);
00066     /* The message buffer used to send Network messages */
00067     MessageBuffer NM_msgBufSend;
00068     std::list<InteractionBroadcastLine *> lines ;
00069 };
00070 
00071 }
00072 
00073 #endif // CERTI_INTERACTION_BROADCAST_LIST_HH
00074 
00075 // $Id: InteractionBroadcastList.hh,v 3.9 2008/05/30 14:01:05 erk Exp $

Generated on Thu Apr 30 15:53:49 2009 for CERTIDeveloperDocumentation by doxygen 1.5.5