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 )
}
}
//--------------------------------------------------------------------------------------------
bool DBServer_MySQL::writeToBase( const string& query )
bool DBServer_MySQL::writeToBase( const std::string& query )
{
dbinfo << myname << "(writeToBase): " << query << endl;
......
......@@ -169,7 +169,7 @@ namespace uniset
virtual void sensorInfo( const uniset::SensorMessage* sm ) override;
virtual void confirmInfo( const uniset::ConfirmMessage* cmsg ) override;
bool writeToBase( const string& query );
bool writeToBase( const std::string& query );
void createTables( MySQLInterface* db );
inline std::string tblName( int key )
......
......@@ -87,7 +87,7 @@ namespace uniset
virtual void confirmInfo( const uniset::ConfirmMessage* cmsg ) 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 );
inline std::string tblName(int key)
......
......@@ -169,7 +169,7 @@ namespace uniset
virtual void sensorInfo( const uniset::SensorMessage* sm ) override;
virtual void confirmInfo( const uniset::ConfirmMessage* cmsg ) override;
bool writeToBase( const string& query );
bool writeToBase( const std::string& query );
void createTables( SQLiteInterface* db );
inline std::string tblName(int key)
......
......@@ -136,7 +136,7 @@ namespace uniset
protected:
virtual void build( const string& lfile );
virtual void build( const std::string& lfile );
virtual void step();
......
......@@ -2122,7 +2122,7 @@ namespace uniset
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" )
return request_regs(req, p);
......
......@@ -416,7 +416,7 @@ namespace uniset
#ifndef DISABLE_REST_API
// http API
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
protected:
......
......@@ -29,7 +29,6 @@
// #define _(n) n
//#endif
using std::string;
/** Ideally this should have been a namespace, but since we try to be
compilable on older C++ compilators too, we use a struct instead.
......
......@@ -167,7 +167,7 @@ namespace uniset
#ifndef DISABLE_REST_API
// http API
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
// --------------------------------------------
......@@ -329,7 +329,7 @@ namespace uniset
#ifndef DISABLE_REST_API
// http api
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 );
#endif
......
......@@ -199,6 +199,8 @@ namespace uniset
/*! замок для блокирования совместного доступа к cписку таймеров */
mutable uniset::uniset_rwmutex lstMutex;
PassiveTimer tmLast;
Debug::type loglevel = { Debug::LEVEL3 };
};
// -------------------------------------------------------------------------
} // end of uniset namespace
......
......@@ -38,19 +38,19 @@ namespace uniset
uniset::ObjectId id = conf->getObjectID(idname);
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();
std::string s( (secname.empty() ? idname : secname) );
xmlNode* cnode = conf->findNode(xml->getFirstNode(), s, idname);
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)...);
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;
}
......@@ -65,13 +65,13 @@ namespace uniset
xmlNode* cnode = conf->findNode(root, secname, "");
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);
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)...);
......@@ -114,7 +114,7 @@ namespace uniset
}
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;
}
}
......
......@@ -64,16 +64,16 @@ Debug::type const Debug::ANY = Debug::type(
Debug::EXCEPTION );
Debug::type Debug::value(string const& val)
Debug::type Debug::value( std::string const& val)
{
type l = Debug::NONE;
string v(val);
std::string v(val);
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(v.substr(0, st));
std::string tmp(v.substr(0, st));
if(tmp.empty())
......@@ -98,7 +98,7 @@ Debug::type Debug::value(string const& val)
break;
}
if (st == string::npos) break;
if (st == std::string::npos) break;
v.erase(0, st + 1);
}
......
......@@ -29,7 +29,7 @@ using namespace uniset;
//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);
}
......@@ -46,11 +46,11 @@ ObjectId ObjectIndex::getNodeId(const std::__cxx11::string& name) const noexcept
// -----------------------------------------------------------------------------------------
std::string ObjectIndex::getBaseName( const std::string& fname ) noexcept
{
string::size_type pos = fname.rfind('/');
std::string::size_type pos = fname.rfind('/');
try
{
if( pos != string::npos )
if( pos != std::string::npos )
return fname.substr(pos + 1);
}
catch(...) {}
......
......@@ -189,8 +189,8 @@ timeout_t LT_Object::askTimer( uniset::TimerId timerid, timeout_t timeMS, clock_
{
li->curTick = ticks;
li->tmr.setTiming(timeMS);
uinfo << "(LT_askTimer): заказ на таймер(["
<< timerid << "]" << getTimerName(timerid) << ") " << timeMS << " [мс] уже есть..." << endl;
uinfo << "(LT_askTimer): заказ на таймер ["
<< timerid << "]" << getTimerName(timerid) << " " << timeMS << " [мс] уже есть..." << endl;
return sleepTime;
}
}
......@@ -200,8 +200,8 @@ timeout_t LT_Object::askTimer( uniset::TimerId timerid, timeout_t timeMS, clock_
tlst.emplace_back(timerid, timeMS, ticks, p);
} // unlock
uinfo << "(LT_askTimer): поступил заказ на таймер([" << timerid << "]"
<< getTimerName(timerid) << ") " << timeMS << " [мс]\n";
uinfo << "(LT_askTimer): поступил заказ на таймер [" << timerid << "]"
<< getTimerName(timerid) << " " << timeMS << " [мс]\n";
}
else // отказ (при timeMS == 0)
{
......
......@@ -34,7 +34,7 @@ class UConnector
inline std::string getUIType()
{
return string("uniset");
return std::string("uniset");
}
std::string getConfFileName();
......
......@@ -93,7 +93,7 @@ class UModbus
// DebugStream dlog;
uniset::ModbusTCPMaster* mb;
int port;
string ip;
std::string ip;
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