Commit 8f6ba6d9 authored by Aleksei Vinogradov's avatar Aleksei Vinogradov

объявил некоторые методы виртуальными для наследования

parent 2c50e7ad
......@@ -120,7 +120,7 @@ sender2(0)
}
dlog[Debug::INFO] << myname << "(init): init sender.. my node " << n_it.getProp("name") << endl;
sender = new UNetSender(h,p,shm,s_field,s_fvalue,ic);
sender = create_sender(h,p,shm,s_field,s_fvalue,ic);
sender->setSendPause(sendpause);
try
......@@ -129,7 +129,7 @@ sender2(0)
if( !h2.empty() )
{
dlog[Debug::INFO] << myname << "(init): init sender2.. my node " << n_it.getProp("name") << endl;
sender2 = new UNetSender(h2,p2,shm,s_field,s_fvalue,ic);
sender2 = create_sender(h2,p2,shm,s_field,s_fvalue,ic);
sender2->setSendPause(sendpause);
}
}
......@@ -241,7 +241,7 @@ sender2(0)
dlog[Debug::INFO] << myname << "(init): (node='" << n << "') add receiver "
<< h2 << ":" << p2 << endl;
UNetReceiver* r = new UNetReceiver(h,p,shm);
UNetReceiver* r = create_receiver(h,p,shm);
// на всякий принудительно разблокируем,
// чтобы не зависеть от значения по умолчанию
......@@ -266,7 +266,7 @@ sender2(0)
dlog[Debug::INFO] << myname << "(init): (node='" << n << "') add reserv receiver "
<< h2 << ":" << p2 << endl;
r2 = new UNetReceiver(h2,p2,shm);
r2 = create_receiver(h2,p2,shm);
// т.к. это резервный канал (по началу блокируем его)
r2->setLockUpdate(true);
......@@ -351,6 +351,17 @@ UNetExchange::~UNetExchange()
delete shm;
}
// -----------------------------------------------------------------------------
UNetReceiver* UNetExchange::create_receiver( const std::string& h, const ost::tpport_t p, SMInterface* shm )
{
return new UNetReceiver(h,p,shm);
}
// -----------------------------------------------------------------------------
UNetSender* UNetExchange::create_sender( const std::string h, const ost::tpport_t p, SMInterface* shm,
const std::string s_field, const std::string s_fvalue, SharedMemory* ic )
{
return new UNetSender(h,p,shm,s_field,s_fvalue,ic);
}
// -----------------------------------------------------------------------------
bool UNetExchange::checkExistUNetHost( const std::string& addr, ost::tpport_t port )
{
ost::IPV4Address a1(addr.c_str());
......
......@@ -99,7 +99,10 @@ class UNetExchange:
SMInterface* shm;
void step();
virtual UNetReceiver* create_receiver( const std::string& h, const ost::tpport_t p, SMInterface* shm );
virtual UNetSender* create_sender( const std::string h, const ost::tpport_t p, SMInterface* shm,
const std::string s_field="", const std::string s_fvalue="", SharedMemory* ic=0 );
virtual void processingMessage( UniSetTypes::VoidMessage *msg );
void sysCommand( UniSetTypes::SystemMessage *msg );
void sensorInfo( UniSetTypes::SensorMessage*sm );
......
......@@ -100,7 +100,7 @@ class UNetReceiver
bool recv();
void step();
void real_update();
virtual void real_update();
void initIterators();
......@@ -187,8 +187,8 @@ class UNetReceiver
bool d_cache_init_ok;
bool a_cache_init_ok;
void initDCache( UniSetUDP::UDPMessage& pack, bool force=false );
void initACache( UniSetUDP::UDPMessage& pack, bool force=false );
virtual void initDCache( UniSetUDP::UDPMessage& pack, bool force=false );
virtual void initACache( UniSetUDP::UDPMessage& pack, bool force=false );
};
// -----------------------------------------------------------------------------
#endif // UNetReceiver_H_
......
......@@ -49,7 +49,7 @@ class UNetSender
void real_send();
/*! (принудительно) обновить все данные (из SM) */
void updateFromSM();
virtual void updateFromSM();
/*! Обновить значение по ID датчика */
void updateSensor( UniSetTypes::ObjectId id, long value );
......@@ -60,7 +60,7 @@ class UNetSender
inline void setSendPause( int msec ){ sendpause = msec; }
/*! заказать датчики */
void askSensors( UniversalIO::UIOCommand cmd );
virtual void askSensors( UniversalIO::UIOCommand cmd );
/*! инициализация итераторов */
void initIterators();
......@@ -72,10 +72,10 @@ class UNetSender
SMInterface* shm;
bool initItem( UniXML_iterator& it );
virtual bool initItem( UniXML_iterator& it );
bool readItem( UniXML& xml, UniXML_iterator& it, xmlNode* sec );
void readConfiguration();
virtual void readConfiguration();
private:
UNetSender();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment