Commit a7e93e3f authored by Pavel Vainerman's avatar Pavel Vainerman

убрал обнаруженный в h-файле "using std::string" исправил

соответствующие ошибки.
parent de1ea9fc
...@@ -121,7 +121,7 @@ void DBServer_MySQL::confirmInfo( const uniset::ConfirmMessage* cem ) ...@@ -121,7 +121,7 @@ void DBServer_MySQL::confirmInfo( const uniset::ConfirmMessage* cem )
} }
} }
//-------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------
bool DBServer_MySQL::writeToBase( const string& query ) bool DBServer_MySQL::writeToBase( const std::string& query )
{ {
dbinfo << myname << "(writeToBase): " << query << endl; dbinfo << myname << "(writeToBase): " << query << endl;
......
...@@ -169,7 +169,7 @@ namespace uniset ...@@ -169,7 +169,7 @@ namespace uniset
virtual void sensorInfo( const uniset::SensorMessage* sm ) override; virtual void sensorInfo( const uniset::SensorMessage* sm ) override;
virtual void confirmInfo( const uniset::ConfirmMessage* cmsg ) override; virtual void confirmInfo( const uniset::ConfirmMessage* cmsg ) override;
bool writeToBase( const string& query ); bool writeToBase( const std::string& query );
void createTables( MySQLInterface* db ); void createTables( MySQLInterface* db );
inline std::string tblName( int key ) inline std::string tblName( int key )
......
...@@ -87,7 +87,7 @@ namespace uniset ...@@ -87,7 +87,7 @@ namespace uniset
virtual void confirmInfo( const uniset::ConfirmMessage* cmsg ) override; virtual void confirmInfo( const uniset::ConfirmMessage* cmsg ) override;
virtual void sigterm( int signo ) override; virtual void sigterm( int signo ) override;
bool writeToBase( const string& query ); bool writeToBase( const std::string& query );
void createTables( std::shared_ptr<PostgreSQLInterface>& db ); void createTables( std::shared_ptr<PostgreSQLInterface>& db );
inline std::string tblName(int key) inline std::string tblName(int key)
......
...@@ -169,7 +169,7 @@ namespace uniset ...@@ -169,7 +169,7 @@ namespace uniset
virtual void sensorInfo( const uniset::SensorMessage* sm ) override; virtual void sensorInfo( const uniset::SensorMessage* sm ) override;
virtual void confirmInfo( const uniset::ConfirmMessage* cmsg ) override; virtual void confirmInfo( const uniset::ConfirmMessage* cmsg ) override;
bool writeToBase( const string& query ); bool writeToBase( const std::string& query );
void createTables( SQLiteInterface* db ); void createTables( SQLiteInterface* db );
inline std::string tblName(int key) inline std::string tblName(int key)
......
...@@ -136,7 +136,7 @@ namespace uniset ...@@ -136,7 +136,7 @@ namespace uniset
protected: protected:
virtual void build( const string& lfile ); virtual void build( const std::string& lfile );
virtual void step(); virtual void step();
......
...@@ -2122,7 +2122,7 @@ namespace uniset ...@@ -2122,7 +2122,7 @@ namespace uniset
return myhelp; return myhelp;
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
Poco::JSON::Object::Ptr MBSlave::httpRequest( const string& req, const Poco::URI::QueryParameters& p ) Poco::JSON::Object::Ptr MBSlave::httpRequest( const std::string& req, const Poco::URI::QueryParameters& p )
{ {
if( req == "regs" ) if( req == "regs" )
return request_regs(req, p); return request_regs(req, p);
......
...@@ -416,7 +416,7 @@ namespace uniset ...@@ -416,7 +416,7 @@ namespace uniset
#ifndef DISABLE_REST_API #ifndef DISABLE_REST_API
// http API // http API
virtual Poco::JSON::Object::Ptr httpHelp( const Poco::URI::QueryParameters& p ) override; virtual Poco::JSON::Object::Ptr httpHelp( const Poco::URI::QueryParameters& p ) override;
virtual Poco::JSON::Object::Ptr httpRequest( const string& req, const Poco::URI::QueryParameters& p ) override; virtual Poco::JSON::Object::Ptr httpRequest( const std::string& req, const Poco::URI::QueryParameters& p ) override;
#endif #endif
protected: protected:
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
// #define _(n) n // #define _(n) n
//#endif //#endif
using std::string;
/** Ideally this should have been a namespace, but since we try to be /** Ideally this should have been a namespace, but since we try to be
compilable on older C++ compilators too, we use a struct instead. compilable on older C++ compilators too, we use a struct instead.
......
...@@ -167,7 +167,7 @@ namespace uniset ...@@ -167,7 +167,7 @@ namespace uniset
#ifndef DISABLE_REST_API #ifndef DISABLE_REST_API
// http API // http API
virtual Poco::JSON::Object::Ptr httpHelp( const Poco::URI::QueryParameters& p ) override; virtual Poco::JSON::Object::Ptr httpHelp( const Poco::URI::QueryParameters& p ) override;
virtual Poco::JSON::Object::Ptr httpRequest( const string& req, const Poco::URI::QueryParameters& p ) override; virtual Poco::JSON::Object::Ptr httpRequest( const std::string& req, const Poco::URI::QueryParameters& p ) override;
#endif #endif
// -------------------------------------------- // --------------------------------------------
...@@ -329,7 +329,7 @@ namespace uniset ...@@ -329,7 +329,7 @@ namespace uniset
#ifndef DISABLE_REST_API #ifndef DISABLE_REST_API
// http api // http api
Poco::JSON::Object::Ptr request_consumers( const std::string& req, const Poco::URI::QueryParameters& p ); Poco::JSON::Object::Ptr request_consumers( const std::string& req, const Poco::URI::QueryParameters& p );
Poco::JSON::Object::Ptr request_lost( const string& req, const Poco::URI::QueryParameters& p ); Poco::JSON::Object::Ptr request_lost( const std::string& req, const Poco::URI::QueryParameters& p );
Poco::JSON::Object::Ptr getConsumers(uniset::ObjectId sid, ConsumerListInfo& clist, bool ifNotEmpty = true ); Poco::JSON::Object::Ptr getConsumers(uniset::ObjectId sid, ConsumerListInfo& clist, bool ifNotEmpty = true );
#endif #endif
......
...@@ -199,6 +199,8 @@ namespace uniset ...@@ -199,6 +199,8 @@ namespace uniset
/*! замок для блокирования совместного доступа к cписку таймеров */ /*! замок для блокирования совместного доступа к cписку таймеров */
mutable uniset::uniset_rwmutex lstMutex; mutable uniset::uniset_rwmutex lstMutex;
PassiveTimer tmLast; PassiveTimer tmLast;
Debug::type loglevel = { Debug::LEVEL3 };
}; };
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
} // end of uniset namespace } // end of uniset namespace
......
...@@ -38,19 +38,19 @@ namespace uniset ...@@ -38,19 +38,19 @@ namespace uniset
uniset::ObjectId id = conf->getObjectID(idname); uniset::ObjectId id = conf->getObjectID(idname);
if( id == uniset::DefaultObjectId ) if( id == uniset::DefaultObjectId )
throw uniset::SystemError("(make_object<" + string(typeid(T).name()) + ">): Not found ID for '" + idname + "'"); throw uniset::SystemError("(make_object<" + std::string(typeid(T).name()) + ">): Not found ID for '" + idname + "'");
auto xml = conf->getConfXML(); auto xml = conf->getConfXML();
std::string s( (secname.empty() ? idname : secname) ); std::string s( (secname.empty() ? idname : secname) );
xmlNode* cnode = conf->findNode(xml->getFirstNode(), s, idname); xmlNode* cnode = conf->findNode(xml->getFirstNode(), s, idname);
if( cnode == 0 ) if( cnode == 0 )
throw uniset::SystemError("(make_object<" + string(typeid(T).name()) + ">): Not found xmlnode <" + s + " name='" + idname + "' ... >"); throw uniset::SystemError("(make_object<" + std::string(typeid(T).name()) + ">): Not found xmlnode <" + s + " name='" + idname + "' ... >");
std::shared_ptr<T> obj = std::make_shared<T>(id, cnode, std::forward<_Args>(__args)...); std::shared_ptr<T> obj = std::make_shared<T>(id, cnode, std::forward<_Args>(__args)...);
if (obj == nullptr) if (obj == nullptr)
throw uniset::SystemError("(make_object<T> == nullptr" + string(typeid(T).name())); throw uniset::SystemError("(make_object<T> == nullptr" + std::string(typeid(T).name()));
return obj; return obj;
} }
...@@ -65,13 +65,13 @@ namespace uniset ...@@ -65,13 +65,13 @@ namespace uniset
xmlNode* cnode = conf->findNode(root, secname, ""); xmlNode* cnode = conf->findNode(root, secname, "");
if( cnode == 0 ) if( cnode == 0 )
throw uniset::SystemError("(make_object_x<" + string(typeid(T).name()) + ">): Not found xmlnode <" + secname + " ... >"); throw uniset::SystemError("(make_object_x<" + std::string(typeid(T).name()) + ">): Not found xmlnode <" + secname + " ... >");
string idname = conf->getProp(cnode, "name"); std::string idname = conf->getProp(cnode, "name");
uniset::ObjectId id = conf->getObjectID(idname); uniset::ObjectId id = conf->getObjectID(idname);
if( id == uniset::DefaultObjectId ) if( id == uniset::DefaultObjectId )
throw uniset::SystemError("(make_object_x<" + string(typeid(T).name()) + ">): Not found ID for '" + idname + "'"); throw uniset::SystemError("(make_object_x<" + std::string(typeid(T).name()) + ">): Not found ID for '" + idname + "'");
return std::make_shared<T>(id, cnode, std::forward<_Args>(__args)...); return std::make_shared<T>(id, cnode, std::forward<_Args>(__args)...);
...@@ -114,7 +114,7 @@ namespace uniset ...@@ -114,7 +114,7 @@ namespace uniset
} }
catch( const uniset::Exception& ex ) catch( const uniset::Exception& ex )
{ {
m->log()->crit() << m->getName() << "(" << __FUNCTION__ << "): " << "(create " << string(typeid(T).name()) << "): " << ex << std::endl; m->log()->crit() << m->getName() << "(" << __FUNCTION__ << "): " << "(create " << std::string(typeid(T).name()) << "): " << ex << std::endl;
throw; throw;
} }
} }
......
...@@ -64,16 +64,16 @@ Debug::type const Debug::ANY = Debug::type( ...@@ -64,16 +64,16 @@ Debug::type const Debug::ANY = Debug::type(
Debug::EXCEPTION ); Debug::EXCEPTION );
Debug::type Debug::value(string const& val) Debug::type Debug::value( std::string const& val)
{ {
type l = Debug::NONE; type l = Debug::NONE;
string v(val); std::string v(val);
while (!v.empty()) while (!v.empty())
{ {
string::size_type st = v.find(','); std::string::size_type st = v.find(',');
//string tmp(lowercase(v.substr(0, st))); //string tmp(lowercase(v.substr(0, st)));
string tmp(v.substr(0, st)); std::string tmp(v.substr(0, st));
if(tmp.empty()) if(tmp.empty())
...@@ -98,7 +98,7 @@ Debug::type Debug::value(string const& val) ...@@ -98,7 +98,7 @@ Debug::type Debug::value(string const& val)
break; break;
} }
if (st == string::npos) break; if (st == std::string::npos) break;
v.erase(0, st + 1); v.erase(0, st + 1);
} }
......
...@@ -29,7 +29,7 @@ using namespace uniset; ...@@ -29,7 +29,7 @@ using namespace uniset;
//const std::string ObjectIndex::sepNode = ":"; //const std::string ObjectIndex::sepNode = ":";
// ----------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------
string ObjectIndex::getNameById( const ObjectId id ) const noexcept std::string ObjectIndex::getNameById( const ObjectId id ) const noexcept
{ {
return getMapName(id); return getMapName(id);
} }
...@@ -46,11 +46,11 @@ ObjectId ObjectIndex::getNodeId(const std::__cxx11::string& name) const noexcept ...@@ -46,11 +46,11 @@ ObjectId ObjectIndex::getNodeId(const std::__cxx11::string& name) const noexcept
// ----------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------
std::string ObjectIndex::getBaseName( const std::string& fname ) noexcept std::string ObjectIndex::getBaseName( const std::string& fname ) noexcept
{ {
string::size_type pos = fname.rfind('/'); std::string::size_type pos = fname.rfind('/');
try try
{ {
if( pos != string::npos ) if( pos != std::string::npos )
return fname.substr(pos + 1); return fname.substr(pos + 1);
} }
catch(...) {} catch(...) {}
......
...@@ -189,8 +189,8 @@ timeout_t LT_Object::askTimer( uniset::TimerId timerid, timeout_t timeMS, clock_ ...@@ -189,8 +189,8 @@ timeout_t LT_Object::askTimer( uniset::TimerId timerid, timeout_t timeMS, clock_
{ {
li->curTick = ticks; li->curTick = ticks;
li->tmr.setTiming(timeMS); li->tmr.setTiming(timeMS);
uinfo << "(LT_askTimer): заказ на таймер([" uinfo << "(LT_askTimer): заказ на таймер ["
<< timerid << "]" << getTimerName(timerid) << ") " << timeMS << " [мс] уже есть..." << endl; << timerid << "]" << getTimerName(timerid) << " " << timeMS << " [мс] уже есть..." << endl;
return sleepTime; return sleepTime;
} }
} }
...@@ -200,8 +200,8 @@ timeout_t LT_Object::askTimer( uniset::TimerId timerid, timeout_t timeMS, clock_ ...@@ -200,8 +200,8 @@ timeout_t LT_Object::askTimer( uniset::TimerId timerid, timeout_t timeMS, clock_
tlst.emplace_back(timerid, timeMS, ticks, p); tlst.emplace_back(timerid, timeMS, ticks, p);
} // unlock } // unlock
uinfo << "(LT_askTimer): поступил заказ на таймер([" << timerid << "]" uinfo << "(LT_askTimer): поступил заказ на таймер [" << timerid << "]"
<< getTimerName(timerid) << ") " << timeMS << " [мс]\n"; << getTimerName(timerid) << " " << timeMS << " [мс]\n";
} }
else // отказ (при timeMS == 0) else // отказ (при timeMS == 0)
{ {
......
...@@ -34,7 +34,7 @@ class UConnector ...@@ -34,7 +34,7 @@ class UConnector
inline std::string getUIType() inline std::string getUIType()
{ {
return string("uniset"); return std::string("uniset");
} }
std::string getConfFileName(); std::string getConfFileName();
......
...@@ -93,7 +93,7 @@ class UModbus ...@@ -93,7 +93,7 @@ class UModbus
// DebugStream dlog; // DebugStream dlog;
uniset::ModbusTCPMaster* mb; uniset::ModbusTCPMaster* mb;
int port; int port;
string ip; std::string ip;
int tout_msec; int tout_msec;
}; };
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
......
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