Commit 120645de authored by Pavel Vainerman's avatar Pavel Vainerman

(codegen): Сделал getMonitInfo() const-ной функцией

parent 7d75f118
......@@ -273,8 +273,8 @@
virtual void timerInfo( const uniset::TimerMessage* tm ) override{}
virtual void sigterm( int signo ) override;
virtual bool activateObject() override;
virtual std::string getMonitInfo(){ return ""; } /*!< пользовательская информация выводимая в getInfo() */
virtual std::string getTypeOfMessage( int t ){ return uniset::strTypeOfMessage(t); } /*!< получение названия типа сообщения. Используется в getInfo() */
virtual std::string getMonitInfo() const { return ""; } /*!< пользовательская информация выводимая в getInfo() */
virtual std::string getTypeOfMessage( int t ) const { return uniset::strTypeOfMessage(t); } /*!< получение названия типа сообщения. Используется в getInfo() */
<xsl:if test="normalize-space($DISABLE_REST_API)!='1'">
#ifndef DISABLE_REST_API
virtual void httpGetUserData( Poco::JSON::Object::Ptr&amp; jdata ){} /*!&lt; для пользовательских данных в httpGet() */
......@@ -1042,7 +1042,7 @@ forceOut(false),
end_private(false)
{
mycrit &lt;&lt; "<xsl:value-of select="$CLASSNAME"/>: init failed!!!!!!!!!!!!!!!" &lt;&lt; endl;
throw uniset::Exception( string(myname+": init failed!!!") );
throw uniset::Exception( std::string(myname+": init failed!!!") );
}
// -----------------------------------------------------------------------------
// ( val, confval, default val )
......@@ -1625,10 +1625,10 @@ askPause(2000),
forceOut(false)
{
mycrit &lt;&lt; "<xsl:value-of select="$CLASSNAME"/>: init failed!!!!!!!!!!!!!!!" &lt;&lt; endl;
throw uniset::SystemError( string(myname+": init failed!!!") );
throw uniset::SystemError( std::string(myname+": init failed!!!") );
}
// -----------------------------------------------------------------------------
<xsl:value-of select="$CLASSNAME"/>_SK::<xsl:value-of select="$CLASSNAME"/>_SK( ObjectId id, xmlNode* cnode, const string&amp; _argprefix ):
<xsl:value-of select="$CLASSNAME"/>_SK::<xsl:value-of select="$CLASSNAME"/>_SK( ObjectId id, xmlNode* cnode, const std::string&amp; _argprefix ):
<xsl:if test="normalize-space($BASECLASS)!=''"><xsl:value-of select="normalize-space($BASECLASS)"/>(id),</xsl:if>
<xsl:if test="normalize-space($BASECLASS)=''">UniSetObject(id),</xsl:if>
// Инициализация идентификаторов (имена берутся из конф. файла)
......
......@@ -61,7 +61,7 @@ class <xsl:value-of select="$CLASSNAME"/>_SK:
{
public:
<xsl:if test="not(normalize-space($OID))=''">
<xsl:value-of select="$CLASSNAME"/>_SK( uniset::ObjectId id = uniset::uniset_conf()->getObjectID("<xsl:value-of select="$OID"/>"), xmlNode* node=uniset::uniset_conf()->getNode("<xsl:value-of select="normalize-space($OID)"/>"), const string&amp; argprefix="" );
<xsl:value-of select="$CLASSNAME"/>_SK( uniset::ObjectId id = uniset::uniset_conf()->getObjectID("<xsl:value-of select="$OID"/>"), xmlNode* node=uniset::uniset_conf()->getNode("<xsl:value-of select="normalize-space($OID)"/>"), const std::string&amp; argprefix="" );
</xsl:if>
<xsl:if test="normalize-space($OID)=''">
<xsl:value-of select="$CLASSNAME"/>_SK( uniset::ObjectId id, xmlNode* node=uniset::uniset_conf()->getNode("<xsl:value-of select="normalize-space($OID)"/>") );
......
......@@ -8,7 +8,7 @@
ВСЕ ВАШИ ИЗМЕНЕНИЯ БУДУТ ПОТЕРЯНЫ.
*/
// --------------------------------------------------------------------------
// generate timestamp: 2017-07-13+03:00
// generate timestamp: 2017-08-29+03:00
// -----------------------------------------------------------------------------
#ifndef UObject_SK_H_
#define UObject_SK_H_
......@@ -158,8 +158,8 @@ class UObject_SK:
virtual void timerInfo( const uniset::TimerMessage* tm ) override{}
virtual void sigterm( int signo ) override;
virtual bool activateObject() override;
virtual std::string getMonitInfo(){ return ""; } /*!< пользовательская информация выводимая в getInfo() */
virtual std::string getTypeOfMessage( int t ){ return uniset::strTypeOfMessage(t); } /*!< получение названия типа сообщения. Используется в getInfo() */
virtual std::string getMonitInfo() const { return ""; } /*!< пользовательская информация выводимая в getInfo() */
virtual std::string getTypeOfMessage( int t ) const { return uniset::strTypeOfMessage(t); } /*!< получение названия типа сообщения. Используется в getInfo() */
#ifndef DISABLE_REST_API
virtual void httpGetUserData( Poco::JSON::Object::Ptr& jdata ){} /*!< для пользовательских данных в httpGet() */
......
......@@ -11,7 +11,7 @@
ВСЕ ВАШИ ИЗМЕНЕНИЯ БУДУТ ПОТЕРЯНЫ.
*/
// --------------------------------------------------------------------------
// generate timestamp: 2017-07-13+03:00
// generate timestamp: 2017-08-29+03:00
// -----------------------------------------------------------------------------
#include <memory>
#include <iomanip>
......@@ -53,7 +53,7 @@ forceOut(false),
end_private(false)
{
mycrit << "UObject: init failed!!!!!!!!!!!!!!!" << endl;
throw uniset::Exception( string(myname+": init failed!!!") );
throw uniset::Exception( std::string(myname+": init failed!!!") );
}
// -----------------------------------------------------------------------------
// ( val, confval, default val )
......
......@@ -50,7 +50,7 @@ void LostTestProc::sysCommand( const uniset::SystemMessage* sm )
}
}
// -----------------------------------------------------------------------------
string LostTestProc::getMonitInfo()
string LostTestProc::getMonitInfo() const
{
ostringstream inf;
inf << "COUNT SENSORS: " << slist.size() << endl;
......
......@@ -30,7 +30,7 @@ class LostTestProc:
virtual void timerInfo( const uniset::TimerMessage* tm ) override;
virtual void sysCommand( const uniset::SystemMessage* sm ) override;
virtual std::string getMonitInfo() override;
virtual std::string getMonitInfo() const override;
size_t ncycle = { 0 };
bool waitEmpty = { false };
......
......@@ -51,7 +51,7 @@ void TestProc::sysCommand( const uniset::SystemMessage* sm )
}
}
// -----------------------------------------------------------------------------
string TestProc::getMonitInfo()
string TestProc::getMonitInfo() const
{
// int* p = 0;
// (*p) = 10;
......
......@@ -28,7 +28,7 @@ class TestProc:
virtual void sensorInfo( const uniset::SensorMessage* sm ) override;
virtual void timerInfo( const uniset::TimerMessage* tm ) override;
virtual void sysCommand( const uniset::SystemMessage* sm ) override;
virtual std::string getMonitInfo() override;
virtual std::string getMonitInfo() const override;
void test_depend();
void test_undefined_state();
......
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