Commit 24febc7c authored by Pavel Vainerman's avatar Pavel Vainerman

Добавил explicit где советовал cppcheck

parent 6c151936
......@@ -47,7 +47,7 @@ class PostgreSQLResult
{
public:
PostgreSQLResult(){}
PostgreSQLResult( const pqxx::result& res );
explicit PostgreSQLResult( const pqxx::result& res );
~PostgreSQLResult();
typedef std::vector<std::string> COL;
......
......@@ -136,7 +136,7 @@ class DBServer_SQLite:
{
public:
DBServer_SQLite( UniSetTypes::ObjectId id, const std::string& prefix );
DBServer_SQLite( const std::string& prefix );
explicit DBServer_SQLite( const std::string& prefix );
virtual ~DBServer_SQLite();
/*! глобальная функция для инициализации объекта */
......
......@@ -10,7 +10,7 @@
class ComediInterface
{
public:
ComediInterface( const std::string& dev );
explicit ComediInterface( const std::string& dev );
~ComediInterface();
int getAnalogChannel( int subdev, int channel, int range = 0, int aref = AREF_GROUND )
......
......@@ -171,7 +171,7 @@ class CardList:
{
public:
CardList(int size) : std::vector<ComediInterface * >(size) { }
explicit CardList( int size ) : std::vector<ComediInterface * >(size) { }
~CardList()
{
......
......@@ -13,7 +13,7 @@ class LogicException:
{
public:
LogicException(): UniSetTypes::Exception("LogicException") {}
LogicException( const std::string& err): UniSetTypes::Exception(err) {}
explicit LogicException( const std::string& err): UniSetTypes::Exception(err) {}
};
......@@ -31,7 +31,7 @@ class Element
internal
};
Element( ElementID id ): myid(id) {};
explicit Element( const ElementID& id ): myid(id) {};
virtual ~Element() {};
......
......@@ -95,7 +95,7 @@
class LProcessor
{
public:
LProcessor( const std::string& name = "" );
explicit LProcessor( const std::string& name = "" );
virtual ~LProcessor();
void open( const std::string& lfile );
......
......@@ -13,7 +13,7 @@ class ModbusRTUMaster;
class RTUStorage
{
public:
RTUStorage( ModbusRTU::ModbusAddr addr );
explicit RTUStorage( ModbusRTU::ModbusAddr addr );
~RTUStorage();
void poll( const std::shared_ptr<ModbusRTUMaster>& mb )
......
......@@ -308,7 +308,7 @@ class SharedMemory:
struct HistoryItem
{
HistoryItem( size_t bufsize = 0 ): id(UniSetTypes::DefaultObjectId), buf(bufsize) {}
explicit HistoryItem( size_t bufsize = 0 ): id(UniSetTypes::DefaultObjectId), buf(bufsize) {}
HistoryItem( const UniSetTypes::ObjectId _id, const size_t bufsize, const long val ): id(_id), buf(bufsize, val) {}
inline void init( unsigned int size, long val )
......
......@@ -72,7 +72,7 @@ namespace UniSetUDP
{
UDPMessage();
UDPMessage( UDPPacket& p );
explicit UDPMessage( UDPPacket& p );
size_t transport_msg( UDPPacket& p );
static size_t getMessage( UDPMessage& m, UDPPacket& p );
......
......@@ -36,7 +36,7 @@ class SViewer
{
public:
SViewer(const std::string& ControllersSection, bool isShort = true);
explicit SViewer(const std::string& ControllersSection, bool isShort = true);
virtual ~SViewer();
void view();
......
......@@ -4,8 +4,8 @@
struct UException
{
UException() {}
UException( const std::string& e ): err(e) {}
UException( const char* e ): err( std::string(e)) {}
explicit UException( const std::string& e ): err(e) {}
explicit UException( const char* e ): err( std::string(e)) {}
~UException() {}
const char* getError()
......@@ -20,7 +20,7 @@ struct UTimeOut:
public UException
{
UTimeOut(): UException("UTimeOut") {}
UTimeOut( const std::string& e ): UException(e) {}
explicit UTimeOut( const std::string& e ): UException(e) {}
~UTimeOut() {}
};
//---------------------------------------------------------------------------
......@@ -28,7 +28,7 @@ struct USysError:
public UException
{
USysError(): UException("USysError") {}
USysError( const std::string& e ): UException(e) {}
explicit USysError( const std::string& e ): UException(e) {}
~USysError() {}
};
//---------------------------------------------------------------------------
......
......@@ -216,7 +216,7 @@ class debugbuf : public streambuf
{
public:
///
debugbuf(streambuf* b)
explicit debugbuf(streambuf* b)
: streambuf(), sb(b) {}
protected:
#ifdef MODERN_STL_STREAMS
......@@ -277,7 +277,7 @@ class stringsigbuf : public streambuf
}
///
stringsigbuf( stringbuf* b )
explicit stringsigbuf( stringbuf* b )
: streambuf(), sb(b) {}
typedef sigc::signal<void, const std::string&> StrBufOverflow_Signal;
......@@ -362,4 +362,4 @@ struct DebugStream::debugstream_internal
nullbuf nbuf;
};
//--------------------------------------------------------------------------
#endif
\ No newline at end of file
#endif
......@@ -42,7 +42,7 @@ using namespace std;
class MPush: public unary_function< const std::shared_ptr<UniSetManager>& , bool>
{
public:
MPush(const UniSetTypes::TransportMessage& msg): msg(msg) {}
explicit MPush(const UniSetTypes::TransportMessage& msg): msg(msg) {}
bool operator()( const std::shared_ptr<UniSetManager>& m ) const
{
try
......@@ -68,7 +68,7 @@ class MPush: public unary_function< const std::shared_ptr<UniSetManager>& , bool
class OPush: public unary_function< const std::shared_ptr<UniSetObject>& , bool>
{
public:
OPush(const UniSetTypes::TransportMessage& msg): msg(msg) {}
explicit OPush(const UniSetTypes::TransportMessage& msg): msg(msg) {}
bool operator()( const std::shared_ptr<UniSetObject>& o ) const
{
try
......
......@@ -292,7 +292,7 @@ struct CInfo
{
}
CInfo( ConfirmMessage& cm ):
explicit CInfo( ConfirmMessage& cm ):
sensor_id(cm.sensor_id),
value(cm.value),
time(cm.time),
......
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