InfoServer.h
См. документацию.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00023
00024 #ifndef InfoServer_H_
00025 #define InfoServer_H_
00026
00027 #include <map>
00028 #include <list>
00029 #include "MessageType.h"
00030 #include "UniSetObject.h"
00031 #include "InfoServer_i.hh"
00032
00033 class ISRestorer;
00034
00078 class InfoServer:
00079 public UniSetObject,
00080 public POA_InfoServer_i
00081 {
00082 public:
00083 InfoServer( UniSetTypes::ObjectId id=UniSetTypes::DefaultObjectId, ISRestorer* d=0 );
00084 virtual ~InfoServer();
00085
00086 virtual UniSetTypes::ObjectType getType(){ return UniSetTypes::getObjectType("InfoServer"); }
00087
00088
00089
00091 virtual void ackMessage(UniSetTypes::MessageCode msgid, const UniSetTypes::ConsumerInfo& ci,
00092 UniversalIO::UIOCommand cmd, CORBA::Boolean acknotify);
00094 virtual void ackMessageRange(UniSetTypes::MessageCode from, UniSetTypes::MessageCode to,
00095 const UniSetTypes::ConsumerInfo& ci,
00096 UniversalIO::UIOCommand cmd, CORBA::Boolean acknotify);
00097
00098
00100 struct ConsumerInfoExt:
00101 public UniSetTypes::ConsumerInfo
00102 {
00103 ConsumerInfoExt( UniSetTypes::ConsumerInfo ci,
00104 UniSetObject_i_ptr ref=0):
00105 ConsumerInfo(ci),ref(ref){}
00106
00107 UniSetObject_i_ptr ref;
00108 CORBA::Boolean ask;
00109 };
00110
00112 typedef std::list<ConsumerInfoExt> ConsumerList;
00113
00115 typedef std::map<UniSetTypes::MessageCode,ConsumerList> AskMap;
00116
00117
00118 protected:
00119
00120 virtual void processingMessage( UniSetTypes::VoidMessage *msg );
00121
00124 virtual void processing(UniSetTypes::AlarmMessage &amsg){};
00127 virtual void processing(UniSetTypes::InfoMessage &imsg){};
00130 virtual void processing(UniSetTypes::ConfirmMessage &cmsg){};
00131
00132
00136 void preprocessing( UniSetTypes::TransportMessage& tmsg, bool broadcast );
00137 void preprocessingConfirm( UniSetTypes::ConfirmMessage& am, bool broadcast );
00138
00139 virtual bool activateObject();
00140
00141
00145 virtual void dumpOrdersList(UniSetTypes::MessageCode mid, const ConsumerList& lst);
00146
00148 virtual void readDump();
00149
00151 template<class TMessage>
00152 void event(UniSetTypes::MessageCode key, TMessage& msg, CORBA::Boolean askn);
00153
00154
00156 template <class TMessage>
00157 void send(ConsumerList& lst, TMessage& msg, CORBA::Boolean acknotify);
00158 bool addConsumer(ConsumerList& lst, const UniSetTypes::ConsumerInfo& cons, CORBA::Boolean acknotify);
00159 bool removeConsumer(ConsumerList& lst, const UniSetTypes::ConsumerInfo& cons, CORBA::Boolean acknotify);
00160
00161
00163 void ask(AskMap& askLst, UniSetTypes::MessageCode key,
00164 const UniSetTypes::ConsumerInfo& cons, UniversalIO::UIOCommand cmd,
00165 CORBA::Boolean acknotify);
00166
00168 ISRestorer* restorer;
00169
00170 private:
00171 friend class ISRestorer;
00172 bool dbrepeat;
00175 AskMap askList;
00177 UniSetTypes::uniset_mutex askMutex;
00178
00179 std::list<UniSetTypes::ConsumerInfo> routeList;
00180 };
00181
00182 #endif
00183